-1
我有一個存儲過程,一旦我把我的參數放在SSRS報告中我想更新列中的數據reason_for_exceptioning,筆記和異常取決於我放入參數中。SQL Server/SSRS - 使用存儲過程來更新數據
CREATE PROCEDURE [dbo].[ExceptionOutages]
@start_date datetime
,@hostname2 nvarchar(max)
,@error_flag bit
AS
BEGIN
SET NOCOUNT ON;
UPDATE PostExceptionMatchingTable
SET [reason_for_exceptioning] = @reason_for_exceptioning
,[notes] = @notes
,[exceptioned] = @exceptioned
SELECT [client]
,[hostname]
,[hostname2]
,[hostname_2]
,[os]
,[measure]
,[end_seconds]
,[start_seconds]
,[error_flag]
,[end_datetime]
,[start_datetime]
,[end_date]
,[start_date]
,[datetime_difference]
,[outage_seconds]
,[percentage]
,[inc_number]
,[inc_brief_description]
,[inc_status]
,[inc_description]
,[inc_priority]
,[inc_sla_breach_exception]
,[inc_sla_breach_reason]
,[inc_status2]
,[inc_report_date]
,[inc_resolve_date_target]
,[inc_affected_user_company]
,[crq_number]
,[crq_brief_description]
,[crq_description]
,[crq_change_timing]
,[crq_start_date]
,[crq_end_date]
,[crq_outage_start_date]
,[crq_outage_end_date]
,[crq_priority]
,[crq_request_status]
,[Expr1]
,[wlg_log_date]
,[wlg_description]
,[wlg_detailed_description]
,[submit_date]
,[hour_difference]
,[day_difference]
,[reason_for_exceptioning]
,[notes]
,[exceptioned]
FROM [availability_outages].[dbo].[PostExceptionMatchingTable]
where [start_date] = @start_date
and [hostname2] = @hostname2
and [error_flag] = @error_flag
END
我不完全知道從哪裏把更新的存儲過程
只需在select語句之前編寫更新語句即可。 – qxg
我已經更新了上面的代碼,但是我得到了標量變量錯誤 –
where reason_for_exceptioning,notes,and exception from from? – qxg