alsoft88
SSC Enthusiast
Points: 115
More actions
May 23, 2008 at 10:47 am
#125370
Hi,
I have 50 databases that I need to issue the following SQL statement
ALTER TABLE CUST ADD ADDRESS_2 VARCHAR(50)
As I am constantly alter the table, is there any procedure I can speed up the process? Batch ?
Suggestions? Thanks in advance.
SwePeso
SSC-Dedicated
Points: 39758
May 26, 2008 at 2:19 am
#820132
Try this undocumented stored procedure
master..sp_msforeachdb 'ALTER TABLE [?]..CUST ADD ADDRESS_2 VARCHAR(50)'
if the table does not exist in current database, you will get an error for that database instead of creating the column.
N 56°04'39.16"E 12°55'05.25"
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply