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

Database

 
GeneralRe: sql statement Pin
Anonymous2-Sep-04 0:46
Anonymous2-Sep-04 0:46 
GeneralRe: sql statement Pin
Jon Hulatt2-Sep-04 0:50
Jon Hulatt2-Sep-04 0:50 
GeneralSQL Server Extended Stored Procedures Pin
Anil Kumar Saharan1-Sep-04 11:53
Anil Kumar Saharan1-Sep-04 11:53 
GeneralMulti threaded ADO Pin
snodgrass1-Sep-04 4:28
snodgrass1-Sep-04 4:28 
Questiontrigger problem? Pin
sumank31-Aug-04 19:59
sumank31-Aug-04 19:59 
GeneralADO.net - Data source doesn't recognise my dataset Pin
savagerx31-Aug-04 6:53
savagerx31-Aug-04 6:53 
GeneralRe: ADO.net - Data source doesn't recognise my dataset Pin
Rocky Moore31-Aug-04 20:05
Rocky Moore31-Aug-04 20:05 
GeneralStored Proc not returning my Output Pin
matthias s.31-Aug-04 3:51
matthias s.31-Aug-04 3:51 
Hi,

I've written a stored procedure which should return a specific value and has an additional OUTPUT parameter. Here goes the code:
<br />
CREATE PROCEDURE dbo.Update_AddresseInfo<br />
<br />
	(<br />
		@UserID int,<br />
		@DateModified DateTime,<br />
		@ElementID int,<br />
		@Street varchar(50),<br />
		@City varchar(50),<br />
		@ZIP varchar(50),<br />
		@NewDateModified DateTime OUTPUT<br />
	)<br />
<br />
AS<br />
	declare @RetVal int<br />
	declare @DateNow DateTime<br />
	set @DateNow = GetDate()<br />
	<br />
    -- do some stuff <br />
<br />
    UPDATE dbo.AdresseInfo SET<br />
        Street = @Street, <br />
        ZIP = @ZIP, <br />
        City = @City, <br />
        DateModified = @DateNow<br />
    WHERE<br />
        ID = @ElementID<br />
        <br />
    if @@ERROR = 0<br />
    begin<br />
        set @NewDateModified = @DateNow<br />
        set @Retval = 0<br />
    end<br />
    else<br />
    begin<br />
        set @Retval = 2<br />
    end<br />
    <br />
    --  log this event<br />
    exec LogEvent @UserID, 1, 1<br />
    <br />
    select @Retval<br />
RETURN <br />

Unfortunately the NewDateModified does not contain what I expect, eventhough I've created a SqlParameter object with the correct Direction. I guess the problem is somewhere in my SQL code.

Any help is greatly appreceated.

Matthias


If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)

www.emvoid.de

GeneralRe: Stored Proc not returning my Output Pin
Michael P Butler31-Aug-04 4:45
Michael P Butler31-Aug-04 4:45 
GeneralRe: Stored Proc not returning my Output Pin
matthias s.31-Aug-04 4:55
matthias s.31-Aug-04 4:55 
GeneralRe: Stored Proc not returning my Output Pin
Michael P Butler31-Aug-04 5:07
Michael P Butler31-Aug-04 5:07 
GeneralRe: Stored Proc not returning my Output Pin
bnieland31-Aug-04 5:00
bnieland31-Aug-04 5:00 
GeneralSolution found! Pin
matthias s.31-Aug-04 5:19
matthias s.31-Aug-04 5:19 
GeneralTrace automation Pin
Deb22230-Aug-04 11:43
Deb22230-Aug-04 11:43 
GeneralDeriving from DataTable and adding rows in a different thread while displaying the table in a DataGrid. Pin
Michael Hulthin30-Aug-04 5:37
Michael Hulthin30-Aug-04 5:37 
GeneralSQL question Pin
NewPureLand28-Aug-04 18:00
NewPureLand28-Aug-04 18:00 
GeneralRe: SQL question Pin
NewPureLand28-Aug-04 19:38
NewPureLand28-Aug-04 19:38 
GeneralRe: SQL question Pin
Colin Angus Mackay28-Aug-04 22:55
Colin Angus Mackay28-Aug-04 22:55 
GeneralRe: SQL question Pin
mike.hall@lehigh.edu30-Aug-04 2:46
mike.hall@lehigh.edu30-Aug-04 2:46 
Generalfunctions Pin
jairajanbrothers27-Aug-04 23:42
jairajanbrothers27-Aug-04 23:42 
GeneralRe: functions Pin
Mazdak27-Aug-04 23:51
Mazdak27-Aug-04 23:51 
GeneralRe: functions Pin
Colin Angus Mackay28-Aug-04 2:04
Colin Angus Mackay28-Aug-04 2:04 
GeneralRe: functions Pin
Mazdak28-Aug-04 3:10
Mazdak28-Aug-04 3:10 
GeneralRe: functions Pin
Colin Angus Mackay28-Aug-04 4:31
Colin Angus Mackay28-Aug-04 4:31 
GeneralRe: functions Pin
Mazdak28-Aug-04 4:40
Mazdak28-Aug-04 4:40 

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.