Click here to Skip to main content
15,890,438 members
Home / Discussions / Database
   

Database

 
AnswerRe: set password on database in sql server 2005 Pin
Blue_Boy21-Jul-11 22:24
Blue_Boy21-Jul-11 22:24 
JokeRe: set password on database in sql server 2005 Pin
dan!sh 21-Jul-11 22:27
professional dan!sh 21-Jul-11 22:27 
JokeRe: set password on database in sql server 2005 Pin
Blue_Boy21-Jul-11 22:28
Blue_Boy21-Jul-11 22:28 
GeneralRe: set password on database in sql server 2005 Pin
SajjadZare22-Jul-11 0:24
SajjadZare22-Jul-11 0:24 
GeneralRe: set password on database in sql server 2005 Pin
Blue_Boy22-Jul-11 2:56
Blue_Boy22-Jul-11 2:56 
AnswerRe: set password on database in sql server 2005 Pin
Shameel22-Jul-11 9:19
professionalShameel22-Jul-11 9:19 
QuestionEntity Framework and Default Values [answered] Pin
Pascal Ganaye21-Jul-11 6:33
Pascal Ganaye21-Jul-11 6:33 
AnswerRe: Entity Framework and Default Values [answer] Pin
Pascal Ganaye21-Jul-11 22:05
Pascal Ganaye21-Jul-11 22:05 
Replying to my own message.
My good colleague Adam found an excellent blog post about this exact problem.

The solution to this problem is simple is to edit the your model edmx file.
In the property element which originaly was:
<Property Name="ContactGUID" Type="uniqueidentifier">

I need to add the StoreGeneratedPattern="Identity" attribute.
<Property Name="SectionGUID" Type="uniqueidentifier" Nullable="false" StoreGeneratedPattern="Identity">


The generated SQL then seems very good, as not only the default value are not overwritten but they are returned to the client in a single query.

declare @generated_keys table(ContactGUID uniqueidentifier)
insert [dbo].[dtblContact](surname, forname)
   output inserted.ContactGUID into @generated_keys
   values ('Blog', 'Joe')
select t.ContactGUID
   from @generated_keys as g 
   join [dbo].dtblContact as t on g.ContactGUID = t.ContactGUID 
   where @@ROWCOUNT > 0

For
more details visit: http://leedumond.com/blog/using-a-guid-as-an-entitykey-in-entity-framework-4/[^]

modified on Friday, July 22, 2011 4:39 AM

QuestionHow to do a select statement from two or more tables? Pin
eight20-Jul-11 23:27
eight20-Jul-11 23:27 
AnswerRe: How to do a select statement from two or more tables? PinPopular
Blue_Boy20-Jul-11 23:43
Blue_Boy20-Jul-11 23:43 
GeneralRe: How to do a select statement from two or more tables? Pin
eight20-Jul-11 23:51
eight20-Jul-11 23:51 
GeneralRe: How to do a select statement from two or more tables? Pin
Blue_Boy21-Jul-11 0:58
Blue_Boy21-Jul-11 0:58 
AnswerRe: How to do a select statement from two or more tables? Pin
Niladri_Biswas24-Jul-11 22:26
Niladri_Biswas24-Jul-11 22:26 
General:-\ Select Pin
velmahesh20-Jul-11 18:22
velmahesh20-Jul-11 18:22 
AnswerRe: What is Buffer Pool in SqlServer? Pin
Mycroft Holmes20-Jul-11 20:51
professionalMycroft Holmes20-Jul-11 20:51 
AnswerRe: What is Buffer Pool in SqlServer? Pin
Blue_Boy20-Jul-11 21:25
Blue_Boy20-Jul-11 21:25 
GeneralRe: What is Buffer Pool in SqlServer? Pin
Shameel21-Jul-11 2:29
professionalShameel21-Jul-11 2:29 
GeneralRe: What is Buffer Pool in SqlServer? Pin
Blue_Boy21-Jul-11 2:44
Blue_Boy21-Jul-11 2:44 
AnswerRe: What is Buffer Pool in SqlServer? Pin
PIEBALDconsult21-Jul-11 2:45
mvePIEBALDconsult21-Jul-11 2:45 
QuestionSSRS 2005 Sub report issue (newbie) Pin
Paul E Davies19-Jul-11 1:07
Paul E Davies19-Jul-11 1:07 
AnswerRe: SSRS 2005 Sub report issue (newbie) Pin
Paul E Davies21-Jul-11 0:27
Paul E Davies21-Jul-11 0:27 
QuestionSQL Syntax Issue Pin
Frank Lepkowski18-Jul-11 3:04
Frank Lepkowski18-Jul-11 3:04 
AnswerRe: SQL Syntax Issue Pin
Tim Carmichael18-Jul-11 3:13
Tim Carmichael18-Jul-11 3:13 
AnswerRe: SQL Syntax Issue Pin
AnnieMacD18-Jul-11 3:38
AnnieMacD18-Jul-11 3:38 
QuestionDynamic Query Question Pin
Kevin Marois14-Jul-11 19:01
professionalKevin Marois14-Jul-11 19:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.