Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2015
    Posts
    3

    Answered: Import large MS SQL dump file into MS Server 2008

    Hi,

    I am new to using SQL and DBMS in general.

    In Windows, I am trying to import a large MS SQL dump file (4.1 GB) into MS SQL Server Management Studio 2008. Since it's a large file, I used

    sqlcmd -S <SERVER-NAME\INSTANCE> -i C:\<path_to_SQL_file>.sql -o C:\<path_to_output_file_1.txt
    However, the command produces the following error:

    Sqlcmd: Error: Syntax error at line 11302 near command '-' in file C:\<path_to_SQL_file>.sql
    In Mac OS X, sed -n '11302p' C:\<path_to_SQL_file>.sql produces

    ?????$R?}D?XL?)?_K??h?l????????p?^?'?F1璨???ωN?Q?? ?흞????????+/??I?*5jE?1????f?`?nL_?~E?????^ap??Ht?2???g
    ?2z7$(f???*??????C?????????A?K?хl?B?#??˞K?
    q??z?
    ??I.?
    ^ ?ݢ?G??cu?Zc?t?'?&L?W??s???W\|x??^_??PǴb???F???m:RY ?ES??-D??L?????n??'
    3???+?ecKd?vysEkz???wh~;o7?y??\??i
    I tried to inspect the file by splitting it using split command in OS X but the output is garbled.

    Do you think the file is wrongly encoded? How do you feel I should proceed trying to find the error?

    Apparently, the same DVD was sent to an earlier developer and it worked for him. For the time being, I can't contact him as he is on extended vacation.

    Any help is appreciated.

    Thanks!

  2. Best Answer
    Posted by Pat Phelan

    "It appears that you're trying to use a MySQL technique on a SQL Server database engine. They work differently at a fundamental level. Check out the SQL Server RESTORE DATABASE command if this is the case.

    -PatP"


  3. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    It appears that you're trying to use a MySQL technique on a SQL Server database engine. They work differently at a fundamental level. Check out the SQL Server RESTORE DATABASE command if this is the case.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  4. #3
    Join Date
    Apr 2015
    Posts
    3

    backup file

    Thanks for your response. There were two issues at end:

    1) It was wrongly saved as an .sql file instead of a backup data file .bak and therefore the many ? characters. Restoring the database worked.
    2) Win 7 has a bug that doesnt allow MS SQL Management Studio to restore databases from the root C:\ directory.

  5. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I knew about the ACL/Permissions issue, but didn't know about any bugs that affected the ability to restore backup files. Do you have a KB reference for this bug?

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  6. #5
    Join Date
    Apr 2015
    Posts
    3
    Unfortunately, I couldn't find a reference for the bug. Someone had mentioned on stackoverflow that Win7 doesn't allow SQL server to restore from C drive. I changed the drive and it worked. I tried to find that thread but I couldn't. Sorry!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •