Selasa, 20 Juli 2010

How to execute a TSQL statement for all databases

I wanted a quick way to execute a TSQL command against all databases.  I was having hard time getting the sp_MSforeachdb to work and didn’t want to write a cursor,  so I instead built a TSQL command which makes the commands I need to execute.  Not fancy, but it got the job done. --Command to be exeuted on all databases SELECT DATABASEPROPERTY( 'Northwind' ,'IsFulltextEnabled')--undocumented

Tidak ada komentar:

Posting Komentar