Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • MB 273 posts 936 karma points
    Aug 01, 2020 @ 17:28
    MB
    0

    Converting SFD > SQL > Syntax error when importing

    Dear everyone,

    I have a large sdf file (114mb) which I have imported into CompactView and exported as SQL.

    I create a new, empty database, opened a new query and pasted all the SQL inside but when I run it I get a lot of these errors:

    Msg 102, Level 15, State 1, Line 857175
    Incorrect syntax near ')'.
    
    Msg 102, Level 15, State 1, Line 857175
    Incorrect syntax near 'ACTION'.
    
    ALTER TABLE [cmsContentTypeAllowedContentType] ADD CONSTRAINT [FK_cmsContentTypeAllowedContentType_cmsContentType] FOREIGN KEY ([Id])
       REFERENCES [cmsContentType] () ON DELETE NO ACTION ON UPDATE NO ACTION;
    
    ALTER TABLE [cmsContentTypeAllowedContentType] ADD CONSTRAINT [FK_cmsContentTypeAllowedContentType_cmsContentType1] FOREIGN KEY ([AllowedId])
       REFERENCES [cmsContentType] () ON DELETE NO ACTION ON UPDATE NO ACTION;
    
    ALTER TABLE [cmsContentVersion] ADD CONSTRAINT [FK_cmsContentVersion_cmsContent_nodeId] FOREIGN KEY ([ContentId])
       REFERENCES [cmsContent] () ON DELETE NO ACTION ON UPDATE NO ACTION;
    
    ALTER TABLE [cmsContentXml] ADD CONSTRAINT [FK_cmsContentXml_cmsContent_nodeId] FOREIGN KEY ([nodeId])
       REFERENCES [cmsContent] () ON DELETE NO ACTION ON UPDATE NO ACTION;
    

    The list continues with these empty parentheses. I don't know SQL so it's hard for me to track down the issue.

    Do I have to install Umbraco first in the empty database? I just want to switch from SDF to SQL.

    Thank you!

  • Huw Reddick 1702 posts 5999 karma points MVP c-trib
    Aug 04, 2020 @ 06:43
    Huw Reddick
    1

    You may find it works better if you use the sqlcmd line to import the file rather than pasting it into a sql window. I've had problems in the past when just pasting large SQL files in the query windows.

    like below

    sqlcmd -S <server> -i C:\<your file here>.sql 
    

    replace

    qlcmd -S <server>\instance -i C:\<your file here>.sql
    
  • Yakov Lebski 539 posts 2101 karma points
    Aug 08, 2020 @ 02:26
  • MB 273 posts 936 karma points
    Aug 08, 2020 @ 14:46
    MB
    0

    This worked like a charm! I did however get a lot of SQL files but I used this command to combine them:

    copy /b *.sql combined-sql-database.sql
    

    Thanks for the help everone, it's much appreciated!

    // Mike

  • Huw Reddick 1702 posts 5999 karma points MVP c-trib
    Aug 08, 2020 @ 13:39
    Huw Reddick
    0

    Yes, I used the same tool. What version of SQL are you importing it into?

    Did you try loading from the sql cmd line?

Please Sign in or register to post replies

Write your reply to:

Draft