简体   繁体   English

通过“执行存储过程”在ssms中插入数据时出错

[英]Error when inserting data in ssms through “Execute Stored Procedure”

The below shown is my program: 下面显示的是我的程序:

在此处输入图片说明

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: 相反,我得到这样的输出:

在此处输入图片说明

How I can solve this? 我该如何解决?

Note: Recently had MSDB in SUSPECT, so, took my friends MSDB log and data, is that causing the problem? 注意:最近在SUSPECT中有MSDB,因此,带了我的朋友MSDB日志和数据,这是引起问题的原因吗? If yes, what can i do about that? 如果是,我该怎么办?

The error message would certainly help. 错误消息肯定会有所帮助。 A quick, easy change would be to replace set @msg='Error' with set @msg= ERROR_MESSAGE(); 一个快速,简单的更改是将set @ msg ='Error'替换为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 手动运行INSERT语句以查看收到的消息
  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 请检查ID列是否为Identity列,因为您未在INSERT中提供ID,所以我认为应该

I hope this helps. 我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM