Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Default value for binding' for uniqueidentifier in sql server 2008

I would like to set 00000000-0000-0000-0000-000000000000 as default value for a uniqueidentifier column. But I get the following error Error validating the default for column 'MyID'. :(

like image 225
Rauf Avatar asked Jul 21 '26 04:07

Rauf


1 Answers

create table #t
(
u uniqueidentifier default ('00000000-0000-0000-0000-000000000000')
)

works for me. Are you missing single quote marks around the literal?

This would be unusual though as generally these columns contain unique values.

like image 199
Martin Smith Avatar answered Jul 23 '26 17:07

Martin Smith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!