For some reason, I had to execute stored procedure from a function and since it is not possible and I tried as explained at Stackoverflow :: Execute Stored Procedure from a Function
Instead osql, I tried sqlcmd. It worked but I get multiple blank rows, rows with ------
and rows with NULL
value.
This function can not be changed to stored procedure.
Is there any way to suppress these messages and unwanted rows ?
Or is there any alternative for executing stored procedure inside functions ?
Sql:
master..xp_cmdshell 'sqlcmd -COM252\INSTANCE2008 -E -q
"SET NOCOUNT ON;
exec MyDatabaseName..storedProcName ''param1'', ''param2'' "'
I even tried pushing on temporary tables but unfortunately again, temporary tables can not be accessed on function.