Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 New Guid

Author  Topic 

shapper
Constraint Violating Yak Guru

450 Posts

Posted - 2009-09-24 : 12:47:11
Hello,

I have the following:

create table dbo.Documents
(
Id int identity not null,
Created datetime not null,
[Key] uniqueidentifier not null rowguidcol constraint
U_Documents_Key unique constraint DF_Documents_Key default newid(),
[File] varbinary(max) filestream constraint DF_Documents_File default
(0x),
constraint PK_Documents primary key clustered(Id)

}

I think I need the uniqueidentifier to use Filestream ... But when I
create a record I get:
00000000-0000-0000-0000-000000000000

What am I doing wrong?

Thanks,
Miguel

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2009-09-24 : 18:33:46
Can we see the INSERT stement that you are using to populate the record?

=======================================
Men build too many walls and not enough bridges. -Isaac Newton, philosopher and mathematician (1642-1727)
Go to Top of Page

shapper
Constraint Violating Yak Guru

450 Posts

Posted - 2009-09-25 : 06:36:55
I found the problem. It was not my SQL code.

I am using Entity Framework and the problem was there.
You need to decide on EF if the value should be generated by the database or by EF.

Thank You,
Miguel
Go to Top of Page
   

- Advertisement -