Sql Stored Proc fail.

Solarion

Honorary Master
Joined
Nov 14, 2012
Messages
21,887
Two hours now staring at this while it stares back at me stubbornly like an annoying creature. The Insert is not happening. I get the Record Inserted message, yet nothing. What can you see wrong :crying:

SP1.jpg

SP2.jpg
 

halfmoonforever

Expert Member
Joined
Feb 1, 2016
Messages
1,196
You also need to consider putting in some validation in your stored procedure and code. This could have been avoided if you actually output an error or success which would have shown the issue immediately.
 

Necropolis

Executive Member
Joined
Feb 26, 2007
Messages
8,401
You also need to consider putting in some validation in your stored procedure and code. This could have been avoided if you actually output an error or success which would have shown the issue immediately.

Well, no.

He stated that no exception was thrown...
 

SykomantiS

Expert Member
Joined
May 7, 2012
Messages
3,797
Well, no.

He stated that no exception was thrown...

Well, he could have checked for the returned value, to know if the insert was successful. SQL insert may fail, doesn't mean there will be an exception thrown, but you can still check for it.
 

Necropolis

Executive Member
Joined
Feb 26, 2007
Messages
8,401
Well, he could have checked for the returned value, to know if the insert was successful. SQL insert may fail, doesn't mean there will be an exception thrown, but you can still check for it.

I've never experienced an insert statement quietly failing before.
 

SykomantiS

Expert Member
Joined
May 7, 2012
Messages
3,797
Correct me if I'm wrong, but ExecuteNonQuery will return the number of rows affected, in this case 0, with no error in code?
 

Solarion

Honorary Master
Joined
Nov 14, 2012
Messages
21,887
Going to modify the code above to return the SCOPE_IDENTITY() field on insert. I'll post it here when done :)
 
Top