|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Friday, June 10, 2011 2:04 PM
Points: 65,
Visits: 67
|
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: 2 days ago @ 12:47 PM
Points: 363,
Visits: 638
|
|
Thanks! This is great. Do you have a version that is compatible with SQL 2008?
Adam Durr Remote DBA support www.bluegecko.net
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, February 20, 2013 3:54 AM
Points: 9,
Visits: 159
|
|
Hello!
I'm using SQL Server 2005 Standard and the script is not running. Always get a syntax error on the first select statement.
Any suggestions? I can't find any error...
beste regards Norbert
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 6:42 AM
Points: 65,
Visits: 344
|
|
I am using SQL Server 2005 Enterprise Edition (x64) and getting the following errors:
Msg 102, Level 15, State 1, Line 11 Incorrect syntax near ' '. Msg 102, Level 15, State 1, Line 41 Incorrect syntax near ' '. Msg 102, Level 15, State 1, Line 68 Incorrect syntax near ' '. Msg 102, Level 15, State 1, Line 74 Incorrect syntax near ' '. Msg 102, Level 15, State 1, Line 85 Incorrect syntax near ' '. Msg 137, Level 15, State 2, Line 90 Must declare the scalar variable "@CurrentDB". Msg 137, Level 15, State 2, Line 96 Must declare the scalar variable "@CurrentDB". Msg 137, Level 15, State 2, Line 131 Must declare the scalar variable "@SQLCmd". Msg 137, Level 15, State 2, Line 133 Must declare the scalar variable "@CurrentDB". Msg 102, Level 15, State 1, Line 141 Incorrect syntax near ' '.
RedGate SQLPrompt reports an error starting on line 32 ( as copied directly from the post): r.is_disabled,
Bill Soranno MCP, MCTS, MCITP DBA Database Administrator Winona State University Maxwell 148 "Quality, like Success, is a Journey, not a Destination" - William Soranno '92
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 10:46 AM
Points: 426,
Visits: 446
|
|
If you copy the script from the web page into a SQL query it contains non-printing characters that Transact-SQL does not like. If you copy the script into notepad first, you will see the non-printing characters.
To make the script runnable, you can use the find/replace function in notepad to replace the non-printing characters with an empty string.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, April 18, 2013 6:44 AM
Points: 194,
Visits: 198
|
|
Hi there, After copy and paste into notepad it still give me an syntax error Can you type it inside sql and attach it as a script no matter what I do it still give syntax error
Thanks, Ed Dror
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, October 14, 2009 10:25 AM
Points: 11,
Visits: 21
|
|
This is cleaned up. Works great. Thanks for the great script.
Jon
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, April 18, 2013 6:44 AM
Points: 194,
Visits: 198
|
|
Thank you very much it works!
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, October 26, 2012 9:46 AM
Points: 33,
Visits: 116
|
|
I am getting a bunch of syntax errors:
Msg 102, Level 15, State 1, Line 11 Incorrect syntax near ' '. Msg 102, Level 15, State 1, Line 41 Incorrect syntax near ' '. Msg 102, Level 15, State 1, Line 68 Incorrect syntax near ' '. Msg 102, Level 15, State 1, Line 74 Incorrect syntax near ' '. Msg 102, Level 15, State 1, Line 85 Incorrect syntax near ' '. Msg 137, Level 15, State 2, Line 90 Must declare the scalar variable "@CurrentDB". Msg 137, Level 15, State 2, Line 96 Must declare the scalar variable "@CurrentDB". Msg 137, Level 15, State 2, Line 131 Must declare the scalar variable "@SQLCmd". Msg 137, Level 15, State 2, Line 133 Must declare the scalar variable "@CurrentDB". Msg 102, Level 15, State 1, Line 141 Incorrect syntax near ' '.
Any ideas? I have tried to clean up the script but still get errors.
Thanks.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: 2 days ago @ 12:47 PM
Points: 363,
Visits: 638
|
|
Thanks for the help getting this script to work. It is not apparent immediately because you cannot see the extra spaces(blocks). You have to paste the script into notepad and then you can see the extra blocks at the beginning of each line.
You also have to go to line 84 and add a space after @CurrentDB so the line looks like
DECLARE @CurrentDB sysname Do this and the script works!
Adam Durr Remote DBA support www.bluegecko.net
|
|
|
|