May 7, 2014 at 9:18 am
Hi,
I would like to know in with date did a SQL Server 2005 instance was installed on a server.
Can I know This using t-sql?
Other question that I have is if I can know if there was a SQL Server installed on the same server and in wich date it was unistalled.
Thank you
May 7, 2014 at 9:23 am
river1 (5/7/2014)
Hi,I would like to know in with date did a SQL Server 2005 instance was installed on a server.
Can I know This using t-sql?
from glenn Berrys diagnostic queries
-- When was SQL Server installed
SELECT @@SERVERNAME AS [Server Name], create_date AS [SQL Server Install Date]
FROM sys.server_principals WITH (NOLOCK)
WHERE name = N'NT AUTHORITY\SYSTEM'
OR name = N'NT AUTHORITY\NETWORK SERVICE' OPTION (RECOMPILE);
---------------------------------------------------------------------
May 7, 2014 at 10:07 am
Thank you.
What about the restores that were made.
Can I having only a database know how many restores were made to it?
I cannot use the msdb because I want to see what restires were made before the SQL Server instance was installed.
May 7, 2014 at 10:13 am
without the msdb you cannot retrieve that information.
If you still have the old msdb as a backup or OS files you could restore or attach it as a user database under a different name and then extract the information out of restorehistory in the normal way.
---------------------------------------------------------------------
May 7, 2014 at 10:20 am
Maybe they have the old OS files. I will check with them.
Thanks
May 7, 2014 at 10:20 am
george sibbald (5/7/2014)
river1 (5/7/2014)
Hi,I would like to know in with date did a SQL Server 2005 instance was installed on a server.
Can I know This using t-sql?
from glenn Berrys diagnostic queries
-- When was SQL Server installed
SELECT @@SERVERNAME AS [Server Name], create_date AS [SQL Server Install Date]
FROM sys.server_principals WITH (NOLOCK)
WHERE name = N'NT AUTHORITY\SYSTEM'
OR name = N'NT AUTHORITY\NETWORK SERVICE' OPTION (RECOMPILE);
Be very careful with NOLOCK and READ UNCOMMITED, apart from possibly bringing back incorrect data these two options will not be supported in future versions of sql server.
😎
May 7, 2014 at 10:24 am
Eirikur Eiriksson (5/7/2014)
george sibbald (5/7/2014)
river1 (5/7/2014)
Hi,I would like to know in with date did a SQL Server 2005 instance was installed on a server.
Can I know This using t-sql?
from glenn Berrys diagnostic queries
-- When was SQL Server installed
SELECT @@SERVERNAME AS [Server Name], create_date AS [SQL Server Install Date]
FROM sys.server_principals WITH (NOLOCK)
WHERE name = N'NT AUTHORITY\SYSTEM'
OR name = N'NT AUTHORITY\NETWORK SERVICE' OPTION (RECOMPILE);
Be very careful with NOLOCK and READ UNCOMMITED, apart from possibly bringing back incorrect data these two options will not be supported in future versions of sql server.
😎
I'll tell Glenn 🙂
Wasn't expecting the server name or create date to change.
---------------------------------------------------------------------
May 7, 2014 at 10:24 am
Eirikur Eiriksson (5/7/2014)
george sibbald (5/7/2014)
river1 (5/7/2014)
Hi,I would like to know in with date did a SQL Server 2005 instance was installed on a server.
Can I know This using t-sql?
from glenn Berrys diagnostic queries
-- When was SQL Server installed
SELECT @@SERVERNAME AS [Server Name], create_date AS [SQL Server Install Date]
FROM sys.server_principals WITH (NOLOCK)
WHERE name = N'NT AUTHORITY\SYSTEM'
OR name = N'NT AUTHORITY\NETWORK SERVICE' OPTION (RECOMPILE);
Be very careful with NOLOCK and READ UNCOMMITED, apart from possibly bringing back incorrect data these two options will not be supported in future versions of sql server.
😎
NOLOCK is deprecated but READ UNCOMMITED is not.
http://technet.microsoft.com/en-us/library/ms187373.aspx
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
May 7, 2014 at 10:28 am
My memory playing tricks on me:-P
Thanks Sean!
😎
May 7, 2014 at 10:44 am
Eirikur Eiriksson (5/7/2014)
My memory playing tricks on me:-PThanks Sean!
😎
I lost my memory long ago...thank {insert your supreme being here} for BOL. 😀
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
May 7, 2014 at 10:57 am
Sean Lange (5/7/2014)
Eirikur Eiriksson (5/7/2014)
My memory playing tricks on me:-PThanks Sean!
😎
I lost my memory long ago...thank {insert your supreme being here} for BOL. 😀
BOL even slower than my memory when I'm using the mobile 😛
May 7, 2014 at 2:04 pm
Sean Lange (5/7/2014)
Eirikur Eiriksson (5/7/2014)
george sibbald (5/7/2014)
river1 (5/7/2014)
Hi,I would like to know in with date did a SQL Server 2005 instance was installed on a server.
Can I know This using t-sql?
from glenn Berrys diagnostic queries
-- When was SQL Server installed
SELECT @@SERVERNAME AS [Server Name], create_date AS [SQL Server Install Date]
FROM sys.server_principals WITH (NOLOCK)
WHERE name = N'NT AUTHORITY\SYSTEM'
OR name = N'NT AUTHORITY\NETWORK SERVICE' OPTION (RECOMPILE);
Be very careful with NOLOCK and READ UNCOMMITED, apart from possibly bringing back incorrect data these two options will not be supported in future versions of sql server.
😎
NOLOCK is deprecated but READ UNCOMMITED is not.
Found it again here Deprecated Database Engine Features in SQL Server 2014, my memory is worse than I remembered:w00t:
😎
May 7, 2014 at 2:09 pm
Eirikur Eiriksson (5/7/2014)
Sean Lange (5/7/2014)
Eirikur Eiriksson (5/7/2014)
george sibbald (5/7/2014)
river1 (5/7/2014)
Hi,I would like to know in with date did a SQL Server 2005 instance was installed on a server.
Can I know This using t-sql?
from glenn Berrys diagnostic queries
-- When was SQL Server installed
SELECT @@SERVERNAME AS [Server Name], create_date AS [SQL Server Install Date]
FROM sys.server_principals WITH (NOLOCK)
WHERE name = N'NT AUTHORITY\SYSTEM'
OR name = N'NT AUTHORITY\NETWORK SERVICE' OPTION (RECOMPILE);
Be very careful with NOLOCK and READ UNCOMMITED, apart from possibly bringing back incorrect data these two options will not be supported in future versions of sql server.
😎
NOLOCK is deprecated but READ UNCOMMITED is not.
Found it again here Deprecated Database Engine Features in SQL Server 2014, my memory is worse than I remembered:w00t:
😎
Excellent. Thanks for the correction to my correction. 😉 In fact, in the article I posted it clearly states that both are deprecated. I am glad to see them go away. I never use either of them and they tend to cause lots of issues for people who don't fully understand what they do.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
May 7, 2014 at 2:23 pm
Sean Lange (5/7/2014)
I never use either of them and they tend to cause lots of issues for people who don't fully understand what they do.
NOLOCK turns the database into a box of chocolates, you never know what you are going to get.....:crazy:
May 7, 2014 at 2:28 pm
Eirikur Eiriksson (5/7/2014)
Sean Lange (5/7/2014)
I never use either of them and they tend to cause lots of issues for people who don't fully understand what they do.NOLOCK turns the database into a box of chocolates, you never know what you are going to get.....:crazy:
LOL. That is awesome!!!
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 15 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply