| RE: [SQLDownUnder] .net TransactionScope and Deferred Constraints |
- From: Adrian Martin
- Subject: RE: [SQLDownUnder] .net TransactionScope and Deferred Constraints
- Date: Mon, 04 Sep 2006 00:36:03 -0700
- Follow-Ups:
- Prev by Date: RE: [SQLDownUnder] .net TransactionScope and Deferred Constraints
- Next by Date: [SQLDownUnder] xp_fixeddrives Stored Procedure
- Previous by thread: RE: [SQLDownUnder] .net TransactionScope and Deferred Constraints
- Next by thread: RE: [SQLDownUnder] .net TransactionScope and Deferred Constraints
- Index(es):
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
An approach I've taken is to set Outlook to send items after a
specified delay, that helps me take the time to cancel sending if I suddenly
realise I didn't need to send that. Adrian Martin IT
Systems Coordinator Workways
Association Inc From:
SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx
[mailto:SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of sql@xxxxxxxxxxx My mistake, code error… Please ignore my email. That always happens 5 seconds after you
send it! cheers From:
SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx
[mailto:SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Hello, I am wanting to create surveys with varying amount of
questions by inserting into two relations (this is a simplified version) Survey (SurveyID INT, SurveyName VARCHAR) SurveyQuestions (QuestionID INT, SurveyID INT,
QuestionText VAHRCHAR) I am trying to achieve this by using
TransactionScope. My code is looking something like this (c#): Using (TransactionScope scope = new TransactionScope) {
Using (SqlCommand insertSurvey ….)
{
…..
insertSurvey.ExecuteNonQuery; }
Using (SqlCommand insertQuestion ….)
{
…. Foreach
(SurveyQuestion q in questions)
{ …. insertSurveyQuestion.ExecuteNonQuery;
***
}
}
scope.Commit(); } My problem is that when the code gets to *** I am
violating foreign key constraints. How can I set the transaction to defer the checking
of the constrains either in my ADO.net code or in my T-SQL kind regards,
|
(Click here for more information on the sqldownunder mailling list)
