Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Pass query as parametere to Scalar function

Author  Topic 

rajnish
Starting Member

4 Posts

Posted - 2010-07-15 : 07:39:59
Hi All,
I am using a scalar function in my store procedure which returns me the integer ..But in the function i am using sub query for condition checking which I want to pass from the Sp to the function ..
Like
IN my store procedure
declare @result int
set @result=dbo.udf_GetCount('here i want to pass the written query which should execute in function') ..as i am doing some checks in my SP.

I was trying but it gives me an error
Error converting data type varchar to bigint.
Kindly help me for this solution.

Ranish chattha

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-07-15 : 07:48:08
You can't give a query to a function.
But why do you not want to execute the query without that function?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -