Click here to Skip to main content
15,913,055 members
Home / Discussions / Database
   

Database

 
GeneralInvalidOperationException ADO . NET Pin
wilsonian7-Oct-04 14:06
wilsonian7-Oct-04 14:06 
GeneralTwo Tables and Datalist problem Pin
David Fawn7-Oct-04 8:18
David Fawn7-Oct-04 8:18 
GeneralRe: Two Tables and Datalist problem Pin
Colin Angus Mackay7-Oct-04 11:11
Colin Angus Mackay7-Oct-04 11:11 
GeneralRe: Two Tables and Datalist problem Pin
David Fawn8-Oct-04 4:15
David Fawn8-Oct-04 4:15 
GeneralOutput vs select Pin
Not Active7-Oct-04 7:37
mentorNot Active7-Oct-04 7:37 
GeneralRe: Output vs select Pin
Kurt _B7-Oct-04 13:00
Kurt _B7-Oct-04 13:00 
GeneralRe: Output vs select Pin
Steven Campbell8-Oct-04 7:11
Steven Campbell8-Oct-04 7:11 
GeneralRe: Output vs select Pin
Grimolfr12-Oct-04 4:43
Grimolfr12-Oct-04 4:43 
I normally do this:
CREATE PROCEDURE dbo.data_ins
    @Ident bigint OUTPUT = NULL,
    @Data1 varchar(10),
    @Yadda int
AS

/* Insertion Query */

-- Set the OUTPUT parameter
-- (Note that SCOPE_IDENTITY() is trigger-safe,
-- whereas @@identity isn't.)
SET @Ident = SCOPE_IDENTITY()

-- Select the record just inserted
-- can be used to retrieve new identity and check
-- defaults, etc.
SELECT * FROM myTable WHERE ident = @Ident

RETURN @Ident
GO


This gives the developer using the procedure three separate options for retrieving the new identity.


Grim
(aka Toby)
MCDBA, MCSD, MCP+SB


SELECT * FROM user WHERE clue IS NOT NULL
GO
(0 row(s) affected)

GeneralRe: Output vs select Pin
Not Active12-Oct-04 6:09
mentorNot Active12-Oct-04 6:09 
GeneralRe: Output vs select Pin
Grimolfr12-Oct-04 7:59
Grimolfr12-Oct-04 7:59 
GeneralRe: Output vs select Pin
Not Active12-Oct-04 9:54
mentorNot Active12-Oct-04 9:54 
QuestionCan I bind more than 1 field in a HyperlinkColumn? Pin
DotNet7-Oct-04 7:14
DotNet7-Oct-04 7:14 
AnswerRe: Can I bind more than 1 field in a HyperlinkColumn? Pin
Not Active7-Oct-04 7:32
mentorNot Active7-Oct-04 7:32 
GeneralRe: Can I bind more than 1 field in a HyperlinkColumn? Pin
Michael Winburn7-Oct-04 7:40
Michael Winburn7-Oct-04 7:40 
QuestionOQL: Where to get started? Pin
sefaen6-Oct-04 19:50
sefaen6-Oct-04 19:50 
AnswerRe: OQL: Where to get started? Pin
sreejith ss nair7-Oct-04 1:15
sreejith ss nair7-Oct-04 1:15 
GeneraldataAdapter update problem Pin
PJ-Intellia6-Oct-04 3:32
PJ-Intellia6-Oct-04 3:32 
GeneralRe: dataAdapter update problem Pin
sreejith ss nair7-Oct-04 1:20
sreejith ss nair7-Oct-04 1:20 
GeneralRe: dataAdapter update problem Pin
shambho12-Oct-04 2:13
shambho12-Oct-04 2:13 
QuestionSave text with its format to database? Pin
bekunkun6-Oct-04 0:39
bekunkun6-Oct-04 0:39 
AnswerRe: Save text with its format to database? Pin
David Salter6-Oct-04 10:27
David Salter6-Oct-04 10:27 
GeneralRe: Save text with its format to database? Pin
bekunkun6-Oct-04 22:29
bekunkun6-Oct-04 22:29 
GeneralDataTable.Select() Pin
amatyasik5-Oct-04 5:57
amatyasik5-Oct-04 5:57 
GeneralRe: DataTable.Select() Pin
Guillermo Rivero5-Oct-04 6:15
Guillermo Rivero5-Oct-04 6:15 
GeneralRe: DataTable.Select() Pin
EdbertP5-Oct-04 16:59
EdbertP5-Oct-04 16:59 

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.