Saturday, November 12, 2011

How to check the version and service pack details in SQL Server?

We may use the below script to get the version details.

select @@version

Check out http://support.microsoft.com/kb/321185 for more details.

Reference: Zubair Ahmed (http://mssql-tech.blogspot.com/)

How to get product key details in SQL Server 2008 R2?

We may use the below script to extract product key details in SQL Server 2008 R2

USE master
GO
EXEC xp_regread 'HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\Microsoft SQL Server\100\BIDS\Setup','ProductID'
GO


Reference: Zubair Ahmed (http://mssql-tech.blogspot.com/)

How to enable the sa login in SQL Server 2008 R2?

If you don't see the 'sa' account in SQL server 2008 under security node even you have already enabled ' SQL Server and Windows Authentication mode' then Just follow the steps below to enable 'sa' login in SQL Server 2008 R2.


Method 1 - Enable the sa login by using Transact-SQL:


ALTER LOGIN sa ENABLE ;
GO
ALTER LOGIN sa WITH PASSWORD = '<enterStrongPasswordHere>' ;
GO

 

Method 2 - Enable the sa login by using Management Studio:

  1. In Object Explorer, expand Security, expand Logins, right-click sa, and then click Properties.
  2. On the General page, you might have to create and confirm a password for the sa login.
  3. On the Status page, in the Login section, click Enabled, and then click OK.



Reference: Zubair Ahmed (http://mssql-tech.blogspot.com/)

How to resolve "Msg 3013, Sev 16: BACKUP DATABASE is terminating abnormally. [SQLSTATE 42000]"?

If SQL database is getting failed leaving the below error message. Msg 3013, Sev 16: BACKUP DATABASE is terminating abnormally. [SQLSTATE ...