Hi is it possible to have a page of a website display the status of a database or MS SQL with .Net code ?, if so what code would i use.
Any help would be appreciated.
Thank You
Do you want see in your webpage SQL Server status (running, paused, etc) ?|||Idealy yes that would be great but it dosent matter particuarlly what kinda status, it would be great to get the server status as well as the database status but eather is fine.
Thank You
|||This just an idea, you can try to simulate to connect and disconnect in the EM and trace the whole process. Using this trace information you could figure out if there is any information about the status in a table or if there is something related to it.
Because as far as I know, SQL server is data in tables and instructions in system procedures. whatever you do in SQL Server is data and instructions. So the status must also be somewhere in a system table and you can try to retrieve it.
I was involved in something similar to this and this kind of work around gives results ( time consuming though to understand SQL procedures to extract information you want)
Good Luck!
|||Thanks for the idea but i need a quick solution, im really short on time and need a solution fast.
thanks anyway
|||Cant remember off the top of my head but check out some of the procs (and also extended procs) in the master DB. Perhaps you can find one that gives you the info you need..|||Hi shadowmaster,
Actually, to get the status of a database, you can use SQL Server SMO(SQL Management Objects).
The Database.Status property will return the database status.
http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.database.status.aspx
However, we cannot get the server status, because when a server is stopped, the service will not be available. In this case, we cannot even connect to that server. So we can only get the running status.
HTH. If this does not answer you question, please feel free to mark it as Not Answered and post your reply. Thanks!
sql
No comments:
Post a Comment