Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Procedure Result as column data ..Need urgent help Expand / Collapse
Author
Message
Posted Tuesday, April 14, 2009 1:00 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, June 28, 2013 5:28 AM
Points: 42, Visits: 137
Hi

I have a proc which will take some paameters and returns a scalar value i want that result as the data for a column in a select query.


Example : My Procedure Will Return 'Raghu'

In the select statement for name column i want that result to come.


Please tell me it is very urgent

Thanks in Advance.


/********************************************************
Technology is just a tool,in terms of getting the kids working together and motivating them,the teacher is the most important.
********************************************************/
Post #696333
Posted Tuesday, April 14, 2009 1:25 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:08 PM
Points: 40,177, Visits: 36,580
Sorry, I'm not following you. Could you maybe show the procedure and explain a bit more what it currently returns and what you want it to return?


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #696341
Posted Tuesday, April 14, 2009 1:46 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, June 28, 2013 5:28 AM
Points: 42, Visits: 137
I have a SP which will accept ID and CultureID depending on there two things it will give me a scalar value that is "Name"

Now the above proc is working fine, the prob is i want to call that proc in a selec statement

like

select ID,(exec Proc ID) as Name from Table

I dont know how to do this but i want like this ...


/********************************************************
Technology is just a tool,in terms of getting the kids working together and motivating them,the teacher is the most important.
********************************************************/
Post #696347
Posted Tuesday, April 14, 2009 1:47 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, June 28, 2013 5:28 AM
Points: 42, Visits: 137
I have a SP which will accept ID and CultureID depending on there two things it will give me a scalar value that is "Name"

Now the above proc is working fine, the prob is i want to call that proc in a selec statement

like

select ID,(exec Proc ID) as Name from Table

I dont know how to do this but i want like this ...


/********************************************************
Technology is just a tool,in terms of getting the kids working together and motivating them,the teacher is the most important.
********************************************************/
Post #696348
Posted Tuesday, April 14, 2009 2:09 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:08 PM
Points: 40,177, Visits: 36,580
grngarlapati (4/14/2009)
Now the above proc is working fine, the prob is i want to call that proc in a selec statement

like
select ID,(exec Proc ID) as Name from Table

I dont know how to do this but i want like this ...


You can't call a procedure as part of a select statement.

How does it return name? It can't be as a return value, that has to be int.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #696354
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse