Archive for June 14th, 2008
How do I check if a SQL Server 2005 installation has been Service Packed?
You can check whether a SQL Server 2005 installation has been service packed by running the following SQL code:
SELECT SERVERPROPERTY (‘productlevel’)
If SQL Server has been service packed, it will return with the Service Pack version installed, eg. “SP2″. If it has not been service packed, it will return with the result “RTM”.
Add comment June 14, 2008
How do I create and use a Synonym for a table in SQL Server 2005?
To create a synonym, run the following SQL code:
USE AdventureWorks;
GO
CREATE SYNONYM MyLocation
FOR AdventureWorks.Production.Location;
GO
To use the synonym, run the following SQL code:
USE AdventureWorks;
GO
SELECT TOP 5 * FROM MyLocation;
GO
To drop the synonym, run the following SQL code:
USE AdventureWorks;
GO
DROP SYNONYM MyLocation;
GO
Add comment June 14, 2008