Tag: Sql Server 2008

Quickie – Concatenate Rows as a String

Today I needed to concatenate a field from multiple rows in SQL Server to get a […]

Problem with Database Restore

Last week, I restored a database from backup and was having the following error when trying […]

SQL Server 2005 | Add days, months and years to GetDate()

To get the current date in Sql Server queries and stored procedures, you use the GetDate() […]

SQL Server | Convert Varchar to UniqueIdentifier

There are 2 ways to Convert a string to a UniqueIdentifier (GUID) in SQL Server: SELECT CAST(‘449141d9-86c9-449d-be2c-1f171b4f4567’ as UNIQUEIDENTIFIER) SELECT CONVERT(UNIQUEIDENTIFIER, […]

SQL Server | Remove Special Characters

I needed to remove all the special characters from a field in a particular table in […]

SQL Server 2005 | Copy Database Diagrams

Next is the code to copy database diagrams from one database to another (tested on SQL […]