SSIS 的 Execute SQL Task 以 OLE DB Connection 呼叫,要取得 SP 的 Return Value

簡單 Sample

USE Northwind
–DROP TABLE t
CREATE TABLE t(PK INT IDENTITY PRIMARY KEY, C1 int,c2 INT)
GO
ALTER PROC spIns @C1 INT=0,@C2 INT=1
AS
INSERT t VALUES(@c1,@c2)
RETURN @@ROWCOUNT
GO

select * from t

declare @ret int
exec @ret=spIns DEFAULT,3
select @ret

exec spIns @C2=3

image

image

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

%d 位部落客按了讚: