Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to empty database Expand / Collapse
Author
Message
Posted Friday, November 2, 2007 6:54 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, September 11, 2013 7:37 AM
Points: 163, Visits: 287
Comments posted to this topic are about the item How to empty database
Post #417888
Posted Friday, October 23, 2009 12:01 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 20, 2010 7:50 AM
Points: 1, Visits: 8
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
Post #807630
Posted Friday, October 23, 2009 2:05 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, September 11, 2013 7:37 AM
Points: 163, Visits: 287
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
Post #807663
Posted Thursday, November 19, 2009 7:38 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, June 12, 2010 8:29 AM
Points: 1, Visits: 5
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'.
Post #822047
Posted Friday, November 20, 2009 2:47 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, September 11, 2013 7:37 AM
Points: 163, Visits: 287
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.



  Post Attachments 
DeleteFromAllTablesInDB.sqlplan (18 views, 2.36 KB)
Post #822188
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse