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.
| Author |
Topic |
|
Ben_Almighty
Starting Member
2 Posts |
Posted - 2009-11-19 : 20:04:25
|
| Hi All,I am new to SQL Server 2008 and I am currently facing some difficulty about SQL Server. I am just wondering can a Procedure be written in a user define function(which I seriously doubt is possible)? As I come across a function in Oracle that did just that. If it is not possible can anyone suggest a round about.Any help is greatly appreaciated.Thank |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-11-19 : 20:29:37
|
| What do you need to accomplish? Give us a few specifics about your situation and we'll try to help |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-20 : 01:30:10
|
quote: Originally posted by Ben_Almighty Hi All,I am new to SQL Server 2008 and I am currently facing some difficulty about SQL Server. I am just wondering can a Procedure be written in a user define function(which I seriously doubt is possible)? As I come across a function in Oracle that did just that. If it is not possible can anyone suggest a round about.Any help is greatly appreaciated.Thank
Post the procedure code that you want to be as a functionMadhivananFailing to plan is Planning to fail |
 |
|
|
Ben_Almighty
Starting Member
2 Posts |
Posted - 2009-11-23 : 19:53:58
|
| Hi guys,Sorry for the late reply.The code below are from Oracle,CURSOR INSTRUCTION_CURISSELECT StorerKey, SkuFROM INSTRUCTIONWHERE ( INSTRUCTIONDETAIL.INSTRUCTIONTYPE = pInstructionType ) ;PROCEDURE PROCESS_INSTRUCTION(lpStorerKey in VARCHAR2, lpSku in VARCHAR2, lpCountryOfOrigin in VARCHAR2, lpCountry in VARCHAR2, lpPort in VARCHAR2, lpPartnerKey in VARCHAR2, lpRecRelType in VARCHAR2, lpInstructionLevel out VARCHAR2, lpInstructionFilter out VARCHAR2 )ISBEGIN*****some code ran here **********some code ran here **********some code ran here **********some code ran here *****END;PROCESS_INSTRUCTION(INSTRUCTION_REC.StorerKey);Basically, there is a Procedure embedded in a Function. And during the execution of this code, the Procedure is called within the function. Can it be done in MS SQL Server 2008? Or the Procedure and Function has to be created separately? Understand the detail is a little stretchy here, but if need I can post the entire code. But it will be lenghty.Thank for your helpRegards,B.H |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-25 : 01:02:29
|
| No. It is not possible. They need to be created seperatelyMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|