Click here to Skip to main content
15,884,693 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello

how i can understand that database in sql2008 attached or not attached?
Posted

1 solution

just write a query

SQL
SELECT NAME FROM SYS.DATABASES WHERE NAME = 'Your database Name'


IF it is attached you will get a record otherwise you won't
 
Share this answer
 
Comments
faezun 22-Dec-11 9:31am    
thank you :)
RaviRanjanKr 22-Dec-11 17:37pm    
5+

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900