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
 Can a fucntion accept any datatype as a paramater

Author  Topic 

haden213
Starting Member

3 Posts

Posted - 2009-09-01 : 05:17:40
Is it possible for a function to accept any datatype as a parameter?

I have a function which processes some text. I need a function that can accept any datatype as a parameter and then cast it to varchar. I know I can do a cast before passing it to the function. But is it possible for a function to accept any datatype as a parameter?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-09-01 : 05:34:43
Try using SQL_VARIANT as datatype and see what will happen.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

haden213
Starting Member

3 Posts

Posted - 2009-09-01 : 06:00:58
Thanks for the quick response... Thats exactly what i needed..
Go to Top of Page
   

- Advertisement -