Click here to Skip to main content
15,891,976 members
Home / Discussions / Database
   

Database

 
AnswerRe: problem in sql server connection Pin
Jerry Hammond12-Jun-09 10:13
Jerry Hammond12-Jun-09 10:13 
GeneralRe: problem in sql server connection Pin
pampam11015-Jun-09 22:24
pampam11015-Jun-09 22:24 
QuestionStored Procedure with complex(ish) IF.....ELSE Pin
munklefish12-Jun-09 4:02
munklefish12-Jun-09 4:02 
AnswerRe: Stored Procedure with complex(ish) IF.....ELSE Pin
Blue_Boy12-Jun-09 4:12
Blue_Boy12-Jun-09 4:12 
QuestionRe: Stored Procedure with complex(ish) IF.....ELSE Pin
munklefish12-Jun-09 4:18
munklefish12-Jun-09 4:18 
AnswerRe: Stored Procedure with complex(ish) IF.....ELSE Pin
Rob Philpott12-Jun-09 4:22
Rob Philpott12-Jun-09 4:22 
AnswerRe: Stored Procedure with complex(ish) IF.....ELSE Pin
munklefish12-Jun-09 4:16
munklefish12-Jun-09 4:16 
AnswerRe: Stored Procedure with complex(ish) IF.....ELSE Pin
Rob Philpott12-Jun-09 4:20
Rob Philpott12-Jun-09 4:20 
Yeah, as posted above if you have more than one statement in your conditional code you need to place them in a begin-end block.

As a general point, the last two inserts you have there are almost identical, the first parameter being the only difference.

I think you could shorten it to this (or similiar):
IF @key IS null
begin
    INSERT INTO tbl_AddressBookMaster ([addMaster_UserId], [addMaster_Title], [addMaster_Description], [addMAster_NoRecipients])
    VALUES (@tmp_custID, 'Default', @tmp_Description, 0)
    SELECT @key = SCOPE_IDENTITY()
end

INSERT INTO tbl_AddressBookAddresses ([adds_ABMId], [adds_Email], [adds_RecipientForename], [adds_RecipientSurname])
VALUES (@key, @tmp_Email, @tmp_Forename, @tmp_Surname)


Make sense?

Regards,
Rob Philpott.

GeneralRe: Stored Procedure with complex(ish) IF.....ELSE Pin
munklefish12-Jun-09 4:35
munklefish12-Jun-09 4:35 
AnswerRe: Stored Procedure with complex(ish) IF.....ELSE Pin
Niladri_Biswas17-Jun-09 20:55
Niladri_Biswas17-Jun-09 20:55 
QuestionStored procedure across multiple servers? Pin
enipla12-Jun-09 3:13
enipla12-Jun-09 3:13 
AnswerRe: Stored procedure across multiple servers? Pin
saanj12-Jun-09 3:16
saanj12-Jun-09 3:16 
GeneralRe: Stored procedure across multiple servers? Pin
enipla12-Jun-09 3:41
enipla12-Jun-09 3:41 
GeneralRe: Stored procedure across multiple servers? Pin
enipla12-Jun-09 3:47
enipla12-Jun-09 3:47 
AnswerRe: Stored procedure across multiple servers? Pin
Abhijit Jana12-Jun-09 3:53
professionalAbhijit Jana12-Jun-09 3:53 
GeneralRe: Stored procedure across multiple servers? Pin
enipla12-Jun-09 4:00
enipla12-Jun-09 4:00 
GeneralRe: Stored procedure across multiple servers? Pin
Abhijit Jana12-Jun-09 4:15
professionalAbhijit Jana12-Jun-09 4:15 
GeneralRe: Stored procedure across multiple servers? Pin
enipla12-Jun-09 5:11
enipla12-Jun-09 5:11 
AnswerRe: Stored procedure across multiple servers? Pin
Jerry Hammond12-Jun-09 4:42
Jerry Hammond12-Jun-09 4:42 
AnswerRe: Stored procedure across multiple servers? Pin
enipla12-Jun-09 6:38
enipla12-Jun-09 6:38 
GeneralEncryption of SQL Server Database 2005 Pin
Isaac Gordon11-Jun-09 23:45
Isaac Gordon11-Jun-09 23:45 
GeneralRe: Encryption of SQL Server Database 2005 Pin
Blue_Boy12-Jun-09 0:34
Blue_Boy12-Jun-09 0:34 
GeneralRe: Encryption of SQL Server Database 2005 Pin
Isaac Gordon12-Jun-09 1:02
Isaac Gordon12-Jun-09 1:02 
GeneralRe: Encryption of SQL Server Database 2005 Pin
Blue_Boy12-Jun-09 1:08
Blue_Boy12-Jun-09 1:08 
GeneralRe: Encryption of SQL Server Database 2005 Pin
Jerry Hammond12-Jun-09 4:32
Jerry Hammond12-Jun-09 4:32 

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.