Reputation: 575
How can I define a variable of specific data type in sql server like I do in Oracle
Declare
var emp.empno%type;
rec emp%rowtype;
in oracle when I define var emp.empno%type
then the oracle engine convert the data type of
var
to be the same data type of field emp.empno
and when I define rec emp%rowtype
the it convert the data type of rec
to row data type
and this row contain all the fields of the table emp
I will be thankful for your help.
Upvotes: 0
Views: 95
Reputation: 11966
You can't do that with SQL Server.
You can try to use user defined types, but that doesn't help much, as you can't modify the types after creating some objects using them.
Upvotes: 1