Question : Type and Rowtype

Oracle has the ability, in PL/SQL, to get Field and Row type information to declare stored procedure parameters and/or variables.

For example, you can use

mytable.myfield.%type (not 100% sure the '.' is used before the %type, but you get the idea ;-) as the TYPE of a stored procedure parameter, which means that if the field type changes (perhaps to grow a string field) the stored-procedure does not need to be modified.

They also have the table.%rowtype feature to create a record type variable for an entire row of a table or view.

Does anyone know of any analogous constructs for SQL Server?

Jim

Answer : Type and Rowtype

What you can do is to define a custom data type, basing yourself on other data type.
But as far as i know there is nothing similar to the rowtype in SQL Server.

BTW, there is no . before the % :-)
Random Solutions  
 
programming4us programming4us