Click here to subscibe to newsletter

Incorrect INSERT format for GUIDs


[ Follow Ups ] [ Post Followup ] [ SQL Script Builder Forum ]

Posted by David Walker 75.146.141.142 on August 22 2008 12:22:54

When MS SQL Server is selected, and "Don't put quotes on numeric fields" is selected, and code is generated to insert UniqueIdentifiers, it looks like this:

Insert Into [TableName] (ColumnName)
VALUES ({FA623B33-CD43-5555-B981-9999FAAC9999})

This doesn't actually work in MS SQL Server. Uniqueidentifier values need single quotes around them. I *think* that you can have optional curly braces inside the quotes, but I know that they are not required. The curly braces by themselves won't work in MS SQL Server.

Thanks.


Follow Ups:



Post a Followup

* : (Required)

* Name:
E-Mail:

* Subject:

* Comments:

Optional Link URL:
Link Title:
Optional Image URL:

Enter the code shown :


[ Follow Ups ] [ Post Followup ] [ SQL Script Builder Forum ]

Copyright © 1999-2004 David Birebent All Rights Reserved.