How to empty database

  • Comments posted to this topic are about the item How to empty database

  • Hi

    I tried to paste your script to empty a database into a query in SQL 2008 management studio and I keep getting the following set of errors:

    Msg 102, Level 15, State 1, Line 74

    Incorrect syntax near '?'.

    Msg 102, Level 15, State 1, Line 75

    Incorrect syntax near '?'.

    This is the lfirst line inside the While.. loop for cursor c. I have tried to change it, and nothing works unless I remove all lines inside the while loop (which is obviously defeating the purpose of the script!). Can you please suggest what I am doing wrong? I would like to use your script to see if I can empty my database just before deploying it

    Luis Valentim

  • Hi Luis,

    This script was written while SQL 2000 was actual version. I'll be back when I do test (or rewrite) on 2008.

    Boka

  • Hi,

    I would encourage you to revisit this script sooner rather than later. I would very much like to use if with SQL Express 2005. I get a few more errors than in the previous post.

    Msg 102, Level 15, State 1, Line 74

    Incorrect syntax near '?'.

    Msg 102, Level 15, State 1, Line 75

    Incorrect syntax near '?'.

    Msg 102, Level 15, State 1, Line 79

    Incorrect syntax near '?'.

    Msg 102, Level 15, State 1, Line 80

    Incorrect syntax near '?'.

    Msg 156, Level 15, State 1, Line 84

    Incorrect syntax near the keyword 'CLOSE'.

  • Hi Luis,

    It looks that problem was just in copying script from web page to query window. It added some special characters.

    You can find file with unchanged script attached. I have tested it on SQL 2005 Developer Edition and it works fine. Of course it should be rewritten to use new system views but I don't have time for that right now. Please let me know if this works for you.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply