How can call stored procedure inside function in SQL server ?

 DECLARE @SQL VARCHAR(500)

 SELECT  @SQL = 'osql -S' + @@servername
                                + ' -E -q "exec [DataBaseName].[dbo].StoreProcedureName"'

EXEC master..xp_cmdshell @SQL

Post a Comment

0 Comments