The below query can be used to generate scripts to bring SQL Server Databases from Offline state to Online.
SELECT 'ALTER DATABASE ['+name+'] SET ONLINE'+CHAR(10)+' GO'
FROM MASTER.sys.databases
WHERE name NOT IN ('master','tempdb','model','msdb','distribution') AND state_desc='OFFLINE'
cdx
ReplyDeleteGreat Article it its really informative and innovative keep us posted with new updates. its was really valuable. thanks a lot. Free Generator
ReplyDeleteThis is wonderful and quite informative website design agencies blog I have learnt so many things from here.
ReplyDelete