September 15, 2004 at 9:22 am
Hello there, new to the forums.
We have an application which creates a db in SQL 2000. We want to create a script to give to our current customers which will
A. Look for a specific table in all db's on their server.
B. If the tables are found in db(s), export ALL info about that db to a text file. (SP's, Triggers, Table Structures..etc)
If someone could give me a nod in a direction, I'd really appreciate it. I'm new to this stuff and VERY new to scripting so any and all help is greatly appreciated.
September 15, 2004 at 11:13 am
There is an undocumented stored procedure called sp_MSforeachdb. This lets you run upto three commands on each database. You can find the syntax by using Enterprise Manager, expanding Master database. Click on Stored Procedures and look for that procedure. You should also be able to find information on it by doing a search on this forum.
Now the downside....permissions. Your clients would have to have permissions on ALL of the databases to find out if they exist and copy data from them. That's normally not the case.
-SQLBill
September 15, 2004 at 11:46 am
Thanks Bill! We're actually looking for a script that we can email/ftp to our clients and have them run it. Would this work in the same manner?
Anyone else?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply