Thursday, May 10, 2012

execute scalar function in sql server

As follows you can test your scalar function in sql server.Result holding variable type should be same as the function return type.

DECLARE @RESULT VARCHAR(2500)

EXEC @RESULT= FUNC_GET_VC_COLUMNS_ENCODED 'CO_LINE','PRI1234',0,1,1,1

PRINT @RESULT

Note:My sql server  version is 2008 R2.If you use sql server  2008 some time you might have to use schema also.

EXEC @RESULT= dbo.FUNC_GET_VC_COLUMNS_ENCODED 'CO_LINE','PRI1234',0,1,1,1

No comments:

Post a Comment