Click here to Skip to main content
15,925,723 members
Home / Discussions / Database
   

Database

 
AnswerRe: Question Pin
Colin Angus Mackay30-Aug-06 9:59
Colin Angus Mackay30-Aug-06 9:59 
GeneralRe: Question Pin
messages30-Aug-06 23:31
messages30-Aug-06 23:31 
QuestionCompare 2 DataTables Pin
Omkar Ghaisas30-Aug-06 4:36
Omkar Ghaisas30-Aug-06 4:36 
AnswerRe: Compare 2 DataTables Pin
Mike Dimmick30-Aug-06 12:23
Mike Dimmick30-Aug-06 12:23 
QuestionHow retrive the values from a Table Pin
dayakar_dn30-Aug-06 3:03
dayakar_dn30-Aug-06 3:03 
AnswerRe: How retrive the values from a Table Pin
_AK_30-Aug-06 3:11
_AK_30-Aug-06 3:11 
QuestionStored Procedure with Output Pin
joshp121730-Aug-06 2:47
joshp121730-Aug-06 2:47 
AnswerRe: Stored Procedure with Output Pin
Sage30-Aug-06 14:30
Sage30-Aug-06 14:30 
Insert Into TableA ( ColumnList )
Select SimiliarColumnLIst
From TableB
Where Conditional

After your insert statement, add either of the following

SELECT @@IDENTITY

OR

SELECT SCOPE_IDENTITY()

@@IDENTITY will return the ID of the last record inserted. If you have triggers on your table(s), then it would be the ID of the last record inserted by a trigger, in which case SCOPE_IDENTITY() returns the ID of the newest record, even if a trigger were to perform inserts against other tables. I personally always use SCOPE_IDENTITY() since I know what it will return now and in teh future, regardless of changes to the DB.

- Sage

LinkRenter
QuestionSQL Mail Pin
Arghya_mp30-Aug-06 0:27
Arghya_mp30-Aug-06 0:27 
AnswerRe: SQL Mail Pin
kumarprabhakar7430-Aug-06 2:35
kumarprabhakar7430-Aug-06 2:35 
QuestionSQL Query Pin
aaraaayen29-Aug-06 20:18
aaraaayen29-Aug-06 20:18 
AnswerRe: SQL Query Pin
_AK_29-Aug-06 23:02
_AK_29-Aug-06 23:02 
GeneralRe: SQL Query Pin
aaraaayen29-Aug-06 23:57
aaraaayen29-Aug-06 23:57 
GeneralRe: SQL Query Pin
_AK_30-Aug-06 0:07
_AK_30-Aug-06 0:07 
QuestionHow to maintain isolation level in MSSQL SERVER 2000? Pin
param thaker29-Aug-06 19:12
param thaker29-Aug-06 19:12 
AnswerRe: How to maintain isolation level in MSSQL SERVER 2000? Pin
Mike Dimmick30-Aug-06 0:18
Mike Dimmick30-Aug-06 0:18 
GeneralRe: How to maintain isolation level in MSSQL SERVER 2000? Pin
param thaker30-Aug-06 3:07
param thaker30-Aug-06 3:07 
QuestionBULK INSERT with CONVERT or CAST? Pin
Yong Yau29-Aug-06 16:36
Yong Yau29-Aug-06 16:36 
AnswerRe: BULK INSERT with CONVERT or CAST? Pin
Sage30-Aug-06 14:33
Sage30-Aug-06 14:33 
GeneralRe: BULK INSERT with CONVERT or CAST? Pin
Yong Yau31-Aug-06 16:01
Yong Yau31-Aug-06 16:01 
GeneralRe: BULK INSERT with CONVERT or CAST? Pin
Sage1-Sep-06 0:17
Sage1-Sep-06 0:17 
Questionsql Table Lookup best methods? Pin
ronhawker29-Aug-06 12:31
ronhawker29-Aug-06 12:31 
AnswerRe: sql Table Lookup best methods? Pin
kumarprabhakar7430-Aug-06 2:40
kumarprabhakar7430-Aug-06 2:40 
QuestionError In Visul C++ .net About Oledb Pin
javad_200529-Aug-06 10:20
javad_200529-Aug-06 10:20 
AnswerRe: Error In Visul C++ .net About Oledb Pin
Mike Dimmick29-Aug-06 11:52
Mike Dimmick29-Aug-06 11:52 

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.