Alex Rivera | Logout

Is there an 'anytype' type for SQL Server

Asked 2012-02-07T16:13:30.170
8

Like the parameter in ISNULL function?

Something we can use to define:

create function getvalue
(
    @param1 varchar(max),
    @param2 varchar(max),
    @value anytype
)
return anytype

as
...
Edit
Report

1 Answer

2

The short answer is No. sql_variant let's you get close, but not quite.

If sql_variant isn't enough, you can overcome this by having multiple nullable parameters of all of the relevant types, but it's not pretty.

answered 2012-02-07T16:16:54.420

Your Answer