Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Run through a list of database script
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Sniper83
Starting Member

5 Posts

Posted - 08/12/2008 :  09:48:10  Show Profile  Reply with Quote
I am using SQL-manager to create queries and the like. I have to check all databases whether a specific table (same name in every database) has a specific field set to identity specification = yes.

How can I do that. How can I run a script that runs through every database on the server..?

sodeep
Flowing Fount of Yak Knowledge

USA
7174 Posts

Posted - 08/12/2008 :  14:25:52  Show Profile  Reply with Quote
You can use Objectproperty() to check whether identity exists in specific table and loop through all tables with sp_MSforeachtable.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 08/12/2008 :  14:39:37  Show Profile  Reply with Quote
you can use sp_Msforeachdb to run through all dbs in your server
Go to Top of Page

Sniper83
Starting Member

5 Posts

Posted - 08/13/2008 :  02:43:08  Show Profile  Reply with Quote
Thank you very much.. I will try that right away.. :)
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000