Skip to content

Instantly share code, notes, and snippets.

@aadennis
Created April 21, 2020 19:47
Show Gist options
  • Save aadennis/8b09c6914e151c24f1491a93502df0a5 to your computer and use it in GitHub Desktop.
Save aadennis/8b09c6914e151c24f1491a93502df0a5 to your computer and use it in GitHub Desktop.
use a_db1
go
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Description: Show the use of a simple out ,
-- mainly for demoing calling from PowerShell.
-- =============================================
drop PROCEDURE DemoSp
go
CREATE PROCEDURE DemoSp
-- Add the parameters for the stored procedure here
@in int,
@out int out
AS
BEGIN
SET NOCOUNT ON;
select @out = @in * 2;
SELECT @in, @out
END
GO
declare
@inArg int = 21,
@outArg int
exec DemoSp @inArg, @outArg out
print 'Back in the caller [' + convert(nvarchar,@outArg) + ']';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment