Click here to Skip to main content
15,880,725 members
Home / Discussions / Database
   

Database

 
GeneralRe: Transpose multiple rows into multiple columns in SQL Server Pin
Member 1026233013-May-14 21:34
Member 1026233013-May-14 21:34 
QuestionSQL Server 2012 Cube Build failing. Pin
rnbergren12-May-14 9:52
rnbergren12-May-14 9:52 
QuestionAccess DB Pin
Zeyad Jalil11-May-14 19:45
professionalZeyad Jalil11-May-14 19:45 
AnswerRe: Access DB Pin
Bernhard Hiller11-May-14 22:30
Bernhard Hiller11-May-14 22:30 
AnswerRe: Access DB Pin
sankarsan parida12-May-14 19:33
professionalsankarsan parida12-May-14 19:33 
Questionhow to return primary key when insert statement violates unique constraint Pin
Nico Haegens10-May-14 7:21
professionalNico Haegens10-May-14 7:21 
AnswerRe: how to return primary key when insert statement violates unique constraint Pin
PIEBALDconsult10-May-14 7:44
mvePIEBALDconsult10-May-14 7:44 
GeneralRe: how to return primary key when insert statement violates unique constraint Pin
Nico Haegens10-May-14 8:05
professionalNico Haegens10-May-14 8:05 
Let me clarify:
Let's say I have a table called address with fields: id, street, streetnumber, busnumber, placeid.
id is the primary key of that table.
Now I insert a row in that table with data in the following fields: street, streetnumber, busnumber, placeid. id is generated by a sequence, but that part doesn't matter. The unique constraint is about those 4 fields.
Suppose I want to insert 2 people who live at the same address, but while this is unknown to me.
Instead of getting a unique constraint warning, I would like to get the id of the record that matches the data I'm trying to insert. I've thought about doing it in the same stored procedure, but I don't know that much about errorhandling inside a stored procedure. I am trying to avoid to having to handle it in my application.
Could you help me out with that?
GeneralRe: how to return primary key when insert statement violates unique constraint Pin
PIEBALDconsult10-May-14 10:22
mvePIEBALDconsult10-May-14 10:22 
GeneralRe: how to return primary key when insert statement violates unique constraint Pin
Nico Haegens10-May-14 23:07
professionalNico Haegens10-May-14 23:07 
GeneralRe: how to return primary key when insert statement violates unique constraint Pin
PIEBALDconsult11-May-14 5:56
mvePIEBALDconsult11-May-14 5:56 
AnswerRe: how to return primary key when insert statement violates unique constraint Pin
jschell11-May-14 8:17
jschell11-May-14 8:17 
GeneralRe: how to return primary key when insert statement violates unique constraint Pin
Nico Haegens12-May-14 3:20
professionalNico Haegens12-May-14 3:20 
GeneralRe: how to return primary key when insert statement violates unique constraint Pin
Richard.Berry10012-May-14 7:55
Richard.Berry10012-May-14 7:55 
GeneralRe: how to return primary key when insert statement violates unique constraint Pin
Eddy Vluggen12-May-14 8:49
professionalEddy Vluggen12-May-14 8:49 
GeneralRe: how to return primary key when insert statement violates unique constraint Pin
Corporal Agarn12-May-14 9:45
professionalCorporal Agarn12-May-14 9:45 
GeneralRe: how to return primary key when insert statement violates unique constraint Pin
jschell12-May-14 10:31
jschell12-May-14 10:31 
AnswerRe: how to return primary key when insert statement violates unique constraint Pin
Mycroft Holmes12-May-14 22:25
professionalMycroft Holmes12-May-14 22:25 
AnswerRe: how to return primary key when insert statement violates unique constraint Pin
Nico Haegens13-May-14 2:18
professionalNico Haegens13-May-14 2:18 
GeneralRe: how to return primary key when insert statement violates unique constraint Pin
Mycroft Holmes13-May-14 12:52
professionalMycroft Holmes13-May-14 12:52 
QuestionDatabase SQL Pin
Syafiqah Zahirah10-May-14 4:47
Syafiqah Zahirah10-May-14 4:47 
AnswerRe: Database SQL Pin
Peter Leow10-May-14 5:24
professionalPeter Leow10-May-14 5:24 
GeneralRe: Database SQL Pin
Syafiqah Zahirah11-May-14 3:43
Syafiqah Zahirah11-May-14 3:43 
AnswerRe: Database SQL Pin
Peter Leow11-May-14 4:13
professionalPeter Leow11-May-14 4:13 
GeneralRe: Database SQL Pin
Syafiqah Zahirah11-May-14 4:45
Syafiqah Zahirah11-May-14 4:45 

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.