below is the stored procedure ALTER PROCEDURE [dbo].[stp_APDB_PersonStatusByPersonID] -- Add the parameters for the stored procedure here @PersonID int AS declare @sql nvarchar(max) declare @params nvarchar(max) declare @Status nvarchar(12) set @sql = '' set @params = '' set @sql = N'select [Status] from vw_PersonUnit where PersonID = @PersonID' set @params = N'@PersonID int' BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here EXEC @Status = sp_executesql @sql,@params, @PersonID = @PersonID; print @sql return @Status END
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.