Jump to content

How to know if a database is not available


Recommended Posts

Guest Don Juan
Posted

Hi I need to create a SP with the following fake code:

(Sql Server 2005)

....

If DB1 is available and DB2 is available

Insert into DB3

Select field1, field2 from DB1

 

Insert into DB3

Select field1, field2 from DB2

Where status = 1

Else

Insert into DB3

Select 'One of databases is not available','0'

End

 

What I need is to know if a database is Restoring.. or Offline...

 

Thanks in advanced

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...