Showing posts with label storing. Show all posts
Showing posts with label storing. Show all posts

Sunday, March 11, 2012

Calling a SP in UDF and Storing Value Return By SP In UDF

Hi EveryBody,
I need to call a Stored Procedure in a UDF.This input of SP would be a string and in turn that output Of SP would also be a string.Also i need to store the output of SP in a Calling UDF.Is it possible if Yes Please tell me How can i make It.Please help.
Thanks!!!
DheerajDECLARE @.outstring varchar(500), @.instring varchar(500)
EXEC dbo.usp_YourStoredProc @.instring,@.outstring OUTPUT
--now you can use the @.outstring in your code as you want.
|||

Hi Thanks for reply,
I have done this also but its giving me Error - "Only functions and extended stored procedures can be executed from within a function." .I think I have to make SP As Extended SP I dont know how to make it can you provide any kind of sample for it.It would get more clear to me.
Thanks,
Dheeraj Verma

|||rather than trying to convert a stored proc to extended stored proc you could convert your stored proc to a function, unless you have some DML statements in your function?

Sunday, February 12, 2012

Calculating and storing alternative calender/dates

Hi Engine room.

I want to automatically populate an alternative date column with hijri (Arabic) dates. So I will have two date columns in my datawarehouse table, one is for gregorian dates, the other for the equivalent in Hijri - a bilingual date system if you like. Now I guess I could do it in the SSI ETL tool and use Julian Dates, but the problem is storing the resulting value. - what data type should I use for hijri dates?

The dates can be input by the user in either format, which means the alternate date has to be populated.

Eventually I hope to make a bilingual system, I don't understand the user-defined types or how to define them, but I suspect they could be used in someway to help. Why am I doing this? - well eventually I hope to populate a cube for analysis and deliver a dual-language-dashboard using the new CTP3 stuff.

Any suggestions on how I can make this dual-date system? - with a view to making a bilingual system eventually.

adv(thnx)ance..Mark.

HijriCalendar is one of the Calendars defined in the .NET FCL(framewor. class library) so you can use either DateTime or INT to store it. The actual calulation start with MSDN Middleeast to see if code exist for it if not you have to look for code to do it. The links below will take you in the right direction.

http://authors.aspalliance.com/aspxtreme/sys/globalization/HijriCalendarClass.aspx

http://www.microsoft.com/globaldev/getWR/steps/wrg_clndr.mspx

http://www.microsoft.com/middleeast/msdn/