Tuesday, April 1, 2014

How to execute the output of the below query automatically

Hi All,


I want to execute the output of the below query automatically, instead of manually copying it and execute.


select 'alter database ['+name+'] set recovery simple' from master.sys.databases where database_id > 4 and state_desc = 'online'


Please provide me a script to do this.


ThanK


Kate


No comments:

Post a Comment