Click here to Skip to main content
15,893,814 members
Home / Discussions / Database
   

Database

 
GeneralRe: BULK INSERT using oracle ODBC driver Pin
hatemtaleb29-Oct-10 6:22
hatemtaleb29-Oct-10 6:22 
GeneralRe: BULK INSERT using oracle ODBC driver Pin
Mycroft Holmes29-Oct-10 12:40
professionalMycroft Holmes29-Oct-10 12:40 
GeneralRe: BULK INSERT using oracle ODBC driver Pin
Rajesh Anuhya29-Oct-10 18:57
professionalRajesh Anuhya29-Oct-10 18:57 
AnswerRe: BULK INSERT using oracle ODBC driver Pin
Rajesh Anuhya29-Oct-10 18:51
professionalRajesh Anuhya29-Oct-10 18:51 
Questioninsert and update Pin
future383929-Oct-10 0:02
future383929-Oct-10 0:02 
AnswerRe: insert and update Pin
Rajesh Anuhya29-Oct-10 0:15
professionalRajesh Anuhya29-Oct-10 0:15 
GeneralRe: insert and update Pin
future383929-Oct-10 0:22
future383929-Oct-10 0:22 
AnswerRe: insert and update Pin
Mycroft Holmes29-Oct-10 0:35
professionalMycroft Holmes29-Oct-10 0:35 
What you are doing is exactly the method we use.

Assumes ID is an identity primary key.

Test the variable one the way in, note the isnull treatment

If IsNull(@ID,0)=0
begin




future3839 wrote:
set identity_insert Person_prs off

This is wrong, leave the identity insert alone but remove the @ID from the value list

After the insert get the new identity value to pass back to the client

Set @ID = Scope_Identity
end
else
begin


Do the update

Return the ID as the result

Select @ID as ID

Never underestimate the power of human stupidity
RAH

GeneralRe: insert and update Pin
future383929-Oct-10 3:01
future383929-Oct-10 3:01 
GeneralRe: insert and update Pin
Mycroft Holmes29-Oct-10 12:38
professionalMycroft Holmes29-Oct-10 12:38 
AnswerRe: insert and update Pin
Rajesh Anuhya29-Oct-10 3:08
professionalRajesh Anuhya29-Oct-10 3:08 
GeneralRe: insert and update Pin
future383929-Oct-10 3:15
future383929-Oct-10 3:15 
GeneralRe: insert and update Pin
future383929-Oct-10 3:25
future383929-Oct-10 3:25 
Questionget the record identity from PostgreSQ/ Pin
Jassim Rahma28-Oct-10 4:57
Jassim Rahma28-Oct-10 4:57 
AnswerRe: get the record identity from PostgreSQ/ Pin
Chris Meech28-Oct-10 5:16
Chris Meech28-Oct-10 5:16 
AnswerRe: get the record identity from PostgreSQ/ Pin
David Skelly28-Oct-10 22:35
David Skelly28-Oct-10 22:35 
QuestionPivot? Pin
mark_w_28-Oct-10 3:08
mark_w_28-Oct-10 3:08 
AnswerRe: Pivot? Pin
Goutam Patra28-Oct-10 3:18
professionalGoutam Patra28-Oct-10 3:18 
GeneralRe: Pivot? Pin
mark_w_28-Oct-10 3:24
mark_w_28-Oct-10 3:24 
GeneralRe: Pivot? Pin
Goutam Patra28-Oct-10 3:35
professionalGoutam Patra28-Oct-10 3:35 
AnswerRe: Pivot? Pin
David Mujica28-Oct-10 4:19
David Mujica28-Oct-10 4:19 
GeneralRe: Pivot? Pin
mark_w_28-Oct-10 4:25
mark_w_28-Oct-10 4:25 
AnswerRe: Pivot? Pin
Mycroft Holmes28-Oct-10 13:56
professionalMycroft Holmes28-Oct-10 13:56 
GeneralRe: Pivot? Pin
mark_w_28-Oct-10 21:42
mark_w_28-Oct-10 21:42 
GeneralRe: Pivot? Pin
Mycroft Holmes28-Oct-10 22:20
professionalMycroft Holmes28-Oct-10 22:20 

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.