-- =============================================
ALTER PROCEDURE [dbo].[NST_GetCboCurrencyAfterUpdate]
@AccCurrency nvarchar(3)='',
@AccSgroup nvarchar(6)= '',
@AccInternalCie int=null
AS
BEGIN
SET NOCOUNT ON;
IF @AccInternalCie is not null and @AccCurrency <> '' and @AccSgroup <> ''
Begin
SELECT * FROM TblAccounts Where
AccInternalCie = @AccInternalCie and AccCurrency = @AccCurrency and AccSgroup = @AccSgroup ORDER BY AccDescription
End
Else if @AccInternalCie is not null and @AccCurrency <> ''
Begin
SELECT * FROM TblAccounts Where
AccInternalCie = @AccInternalCie and AccCurrency = @AccCurrency ORDER BY AccDescription
END
Else if @AccInternalCie is not null and @AccSgroup <> ''
Begin
SELECT * FROM TblAccounts Where
AccInternalCie = @AccInternalCie and AccSgroup = @AccSgroup ORDER BY AccDescription
END
Else if @AccCurrency <> '' and @AccSgroup <> ''
Begin
SELECT * FROM TblAccounts Where
AccCurrency = @AccCurrency and AccSgroup = @AccSgroup ORDER BY AccDescription
END
Else if @AccSgroup <> ''
Begin
SELECT * FROM TblAccounts Where
AccSgroup = @AccSgroup
Print @AccSgroup
END
Else if @AccCurrency <> ''
Begin
SELECT * FROM TblAccounts Where
AccCurrency = @AccCurrency ORDER BY AccDescription
END
Else if @AccInternalCie is not null
Begin
SELECT * FROM TblAccounts Where
AccInternalCie = @AccInternalCie
END
end
我有以下存储过程,我如何在 SQL SERVER MANAGEMENT STUDIO 中进行调试测试如何执行特定查询
Select * from TblAccounts where AccSGroup = '1000'
只说 AccSGroup 不等于 '' 所以
Else if @AccSgroup <> ''
Begin
SELECT * FROM TblAccounts
Where AccSgroup = @AccSgroup
Print @AccSgroup
END
应该执行查询并且必须绕过休息