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.
| Author |
Topic |
|
7siva7
Starting Member
28 Posts |
Posted - 2011-11-21 : 22:32:00
|
| HiNeed help in stored proceduresCREATE PROCEDURE Proc_Name @var1 INT, @var2 INT, AS Here instead of giving Datatype (INT) Directly ,can we give like as follows(oracle)? var1 IN Table_Name.Column%TYPE, var2 IN Table_Name.Column%TYPE,as we use in Oracleplease help me with correct syntaxThanks HI |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-11-21 : 23:01:36
|
Not possible. You have to specifically define the data type for each variable KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
johntech
Yak Posting Veteran
51 Posts |
Posted - 2011-11-23 : 12:17:41
|
I'll give you a hint may help youThe %TYPE data type of Oracle, lets you create a variable and have that variable's data type be defined by a table or view column or a PL/SQL package variable.There is no equivalent for Oracle's %TYPE datatype in T-SQL, but it can be simulated (not very conveniently though) using User Defined Data types (UDT). Here is an example:EXEC sp_addtype 'MyType', 'smallint', NULLCREATE TABLE MyTable (i MyType)CREATE PROC MyProcASBEGINDECLARE @i MyTypeEND http://vyaskn.tripod.com/oracle_sql_server_differences_equivalents.htmhttp://www.ispirer.com/doc/sqlways/Output/SQLWays-1-037.html |
 |
|
|
|
|
|