Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an 'anytype' type for SQL Server

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
...
like image 773
orange Avatar asked Feb 07 '12 16:02

orange


People also ask

Is there a list data type in SQL?

The LIST data type is a collection type that can store ordered non-NULL elements of the same SQL data type. The LIST data type supports, but does not require, duplicate element values. The elements of a LIST data type have ordinal positions.

What are the 3 types of functions in SQL Server?

There are three types of user-defined functions in SQL Server: Scalar Functions (Returns A Single Value) Inline Table Valued Functions (Contains a single TSQL statement and returns a Table Set) Multi-Statement Table Valued Functions (Contains multiple TSQL statements and returns Table Set)

What can I use instead of like in SQL?

You may come across the situation, where you need alternate to “like” keyword of SQL, that is to search for sub-string in columns of the table. The one way to achieve it to use instr() function, instr() function takes 3 parameters in account .

What is float data type in SQL?

float(n) Floating precision number data from -1.79E + 308 to 1.79E + 308. The n parameter indicates whether the field should hold 4 or 8 bytes. float(24) holds a 4-byte field and float(53) holds an 8-byte field. Default value of n is 53.


1 Answers

It sounds like you're looking for the sql_variant data type.

like image 56
Daniel Pratt Avatar answered Sep 20 '22 01:09

Daniel Pratt