我正在尝试使用以下存储过程更新event\ u alerts表:
GO
ALTER procedure [dbo].[servermatch_servers]
@server_name varchar(25)
as
update event_alerts
set event_alerts.status_alert = (case when master_serverlist.Server_list is null then '0' else '1'
end)
from event_alerts inner join master_serverlist on master_serverlist.Server_list =
event_alerts.server_name where server_name = @server_name
c#代码打击:
using (SqlCommand command3 = new SqlCommand("servermatch_servers", conn1))
{
command3.CommandType = CommandType.StoredProcedure;
command3.Parameters.AddWithValue("@server_name", server);
command3.Parameters[@"server_name"].Direction = ParameterDirection.Input;
command3.ExecuteNonQuery();
}
服务器的值是从字符串中提取出来的,这是服务器名称的值,任何帮助都将不胜感激。提前谢谢
1条答案
按热度按时间qq24tv8q1#
我认为这是罪魁祸首-
试着把它改成