ALTER PROCEDURE [dbo].[P_XF_经销商余额查询] @海螺库名称 VARCHAR(32), @经销商主键 INT AS BEGIN DECLARE @创建时间 datetime; DECLARE @结果 varchar; DECLARE @String varchar(300); begin TRY set @创建时间 = getDate(); --SELECT a.当前余额 from xs_mdw.[dbo].T_客户 a where a.客户ID = @经销商主键; set @String = 'SELECT a.当前余额 from xs_mdw.[dbo].[T_客户] a where a.客户ID ='+@经销商主键; exec @String; SELECT @String; set @结果 = '0'; end TRY BEGIN CATCH set @结果 = '1' END CATCH END |