Click here to Skip to main content
15,894,825 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,...

I have one database in that DB when i give DB_name i want to retrieve all the information about the DB like server name, login name, password


it possible or another idea for that...
Posted
Comments
Maciej Los 2-May-14 1:59am    
Using clear SQL command?

You can get Server name, instance name using following article

Enumerating Instances of SQL Server (ADO.NET)[^]

Regarding Logged In user please see below article.

SQL SERVER – 2005 – Get Current User – Get Logged In User[^]
 
Share this answer
 
To Get The ServerName

SQL
select @@SERVERNAME
 
Share this answer
 

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



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