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 |
|
u2envy1
Yak Posting Veteran
77 Posts |
Posted - 2008-10-31 : 02:34:47
|
| Does any1 know if SQL can do this like ORACLE ?**ORACLE**DECLARE My_Val Table.Column%TYPE**SQL**DECLAREMy_Val intOracle gets the data type from the table & column. So if you change the data type in future you dont have to change every sp.Is this possible in SQL ? |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-10-31 : 02:47:05
|
No, in T-SQL it's not possible.Webfred No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
u2envy1
Yak Posting Veteran
77 Posts |
Posted - 2008-10-31 : 02:52:22
|
| Thx webfred.Is it still not possible in SQL server 2008 ? |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-10-31 : 05:07:27
|
Yes it's still NOT possible in SQL Server 2008.But there it's new to declare and define in one:declare @myvar vachar(10) = 'Webfred' instead ofdeclare @myvar vachar(10)set @myvar = 'Webfred' GreetingsWebfred No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2008-10-31 : 06:52:38
|
| I guess the closest in sql server is a user defined datatype, but it really isn't the same thing.- Lumbago |
 |
|
|
u2envy1
Yak Posting Veteran
77 Posts |
Posted - 2008-11-03 : 01:45:46
|
| Thx peeps.Its always a pleasure to talk to experts on this forum. |
 |
|
|
|
|
|