|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 10:59 AM
Points: 1,109,
Visits: 523
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, June 13, 2013 9:12 AM
Points: 145,
Visits: 716
|
|
I get the following sql error message when running the script in SQL Server 2000 Query Analyzer or 2005 SQL Server Management Studio Express.
Server: Msg 197, Level 15, State 1, Line 64 EXECUTE cannot be used as a source when inserting into a table variable.
Thanks,
Howard
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, January 12, 2011 8:28 AM
Points: 162,
Visits: 180
|
|
| The script is only for SQL 2005...
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Tuesday, June 11, 2013 1:49 PM
Points: 315,
Visits: 1,364
|
|
I made a slight change in mine to take into account an Offline DB:
insert into @dbs select name from sys.databases where state_desc <> 'offline' order by name
Ken
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, December 10, 2009 1:50 AM
Points: 19,
Visits: 132
|
|
Hi,
Sorry I'm new to sql server 2005 and coding is not my strongest point. Can you please point me to exactly which line that I will need to change if I want to run this script for a specific db?
Thanks
J
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 10:59 AM
Points: 1,109,
Visits: 523
|
|
Hi there,
the simplest way is replacing this line
insert into @dbs select name from sys.databases order by name with this one
insert into @dbs values ('Name_of_DB') The nicest way will be removing the whole loop, but if you want to all DBs in the future, then you should add the loop again
cheers
Alejandro Pelc
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, May 01, 2013 2:58 PM
Points: 3,
Visits: 12
|
|
Thx for a nice script without errors Keep up the good work, mate!
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, June 07, 2010 3:34 AM
Points: 1,
Visits: 5
|
|
Hi Everyone,
I am new to scripting and I want to fetch the security information on a wide set of servers and databases including Production environment. Could you please confirm if this script creates the three variables permanently or are they meant to be temporary variables?
Many thanks in advance Katrina
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 12:36 PM
Points: 20,
Visits: 86
|
|
Very nice, thanks. I forwarded to my team.
Tom Powell http://philergia.wordpress.com/
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, May 02, 2013 9:10 PM
Points: 26,
Visits: 263
|
|
| Katrina, these variables were meant to be temporary.
|
|
|
|