TRUNCATE TABLE master..sysdatabases

...and other neat SQL Server tricks
posts - 51, comments - 60, trackbacks - 14

SQL Server Utilties

Bcp, osql, and other command-line SQL Server utilities
The For Command: Part 2 - Multiple Tokens, AutoGenerate Files

This is Part 2 of the series on the for command. In an earlier article I covered using for to deploy SQL scripts against multiple servers. I'm going to enhance this a little by specifying multiple databases as well, and generating server and database lists automatically. I'll also add a little enhancement for deploying scripts in a particular order of execution. In the previous article I created a text file (servers.txt) that contained the names of the SQL Servers against which a number of scripts needed to be deployed. The assumption was that there was only a single database (with...

posted @ Wednesday, February 02, 2005 10:15 PM | Feedback (3) |

The For Command: Part 1-1/2 - Deploy Scripts to Multiple Servers

I've already posted an example in a previous article, and I'm going to post a couple more on neat things you can do with the DOS for command. I recently helped out a friend with a method to deploy stored procedures to multiple servers. Previously he was generating the scripts and running them manually in Query Analyzer, for up to 8 different servers. Getting bored and making mistakes, plus needing it to be foolproof for others to use, he was looking for a better way. Here it is. :) The for command can enumerate through file contents as well as...

posted @ Wednesday, February 02, 2005 10:11 PM | Feedback (3) |

Powered by:
Powered By Subtext Powered By ASP.NET