Have you ever wanted to check that a server exists before using it. Here is a solution that use SQLDMO from within TSQL to get the status of a SQL Server service. It also works for 2000 instances.
I have named it sp_ServerStatus for it to be based in master.
This returns the status integer and a text description through OUTPUT properties of the SP.
Example
DECLARE @s int, @t varchar(100)
exec sp_ServerStatus 'MySQLServer\instance1',@s output, @t output
select @s, @t
SP that shows information from a given database
It is used to show information from a database. It shows the creation date, it calculates the time in days, months and hours since its creation and it shows all the users with rights in that database.
2002-01-27
2,169 reads