Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Administration - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 6525

Run Script in each databases in sql server

$
0
0
Hi All,I have a Script which just insert data into two tables (bankoffice1 and Bankoffice2). these 2 are tables are independent tables.Now I need to ran this Script into all my databases. Currently I have more than 100 databases in my production server. Currently I am going to each database then run the script one by one. Is there any way so that I ran the script in all databases running the SP like sp_msforeachdb? and also it should check whether the database has the tables (bankoffice1 and Bankoffice2) or not.If the tables are present then it will insert the data otherwise not.Please help!!

Viewing all articles
Browse latest Browse all 6525

Trending Articles