March 26, 2012 at 8:59 am
Hi,
I am implementing SQL Server config for my packages. But before the package runs, I want to make sure that the DB where the config table reside is available. If it its not available I want to switch it to different server/db. Any suggestions how I can achieve that?
March 26, 2012 at 9:05 am
You could try SELECT TOP 1 1 FROM database.schema.table and see if an error is returned or not. Or, if it is a linked server it would be linkedserver.database.schema.table
Jared
CE - Microsoft
April 4, 2012 at 8:20 am
Thanks
April 4, 2012 at 9:02 am
You could also do an existence check on sys.objects for the table name or check that object_id('tablename') isn't NULL.
April 4, 2012 at 3:39 pm
check the state_desc column in master.sys.databases = 'online'
---------------------------------------------------------------------
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply