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, ‘449141d9-86c9-449d-be2c-1f171b4f4567’)
I needed to remove all the special characters from a field in a particular table in SQL Server to be used for searching purposes. After searching (binging :P)… I found the next SQL Server Function which did the trick.
This Function Removes any special character from the string value passed. All characters except 0-9, a-z and A-Z are all removed, whilst the remaining characters are returned back.
ALTER FUNCTION dbo.RemoveSpecialCharacters
RETURNS VARCHAR(256) WITH SCHEMABINDING
IF (@s is null)
RETURN null Continue reading
When i binged (yes I’m using bing :P), i found the following fix:
Happy Sql Server Managementing 🙂
I needed to copy a database from SQL Server 2005. To copy it, you need to put the database offline but sometimes it takes too long to go offline and even fails.
The problem might be that the database would still have active connections. Thus to solve this problem you need to: Continue reading
Tried to import a foxpro table to an excel file but the following errors loaded…
The following error kept popping up when trying to import data from a flat file source of type CSV to be imported in a table in SQL Server:
The product level is insufficient for component source “filename.csv”
To solve this problem, you need to install the Service Pack 2 of SQL Server 2005 from this link.
If you find other solutions… please let me know 😉