Albirt
Albirt

Reputation: 39

Error when inserting data in ssms through "Execute Stored Procedure"

The below shown is my program:

enter image description here

As You can see, all the table details are correct. But when I try to run it through the "Execute Stored Procedure", the details are not entered into the table.

Rather I get a output like this:

enter image description here

How I can solve this?

Note: Recently had MSDB in SUSPECT, so, took my friends MSDB log and data, is that causing the problem? If yes, what can i do about that?

Upvotes: 0

Views: 51

Answers (1)

Alan
Alan

Reputation: 66

The error message would certainly help. A quick, easy change would be to replace set @msg='Error' with set @msg= ERROR_MESSAGE(); so we can see the error.

If this isn't possible I suggest:

  1. Run the INSERT statement manually to see what message you get
  2. Check that the ID column is an Identity column as you don't provide the ID in the INSERT so I assume it should be

I hope this helps.

Upvotes: 2

Related Questions