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 |
avijit_mca
Posting Yak Master
109 Posts |
Posted - 2009-01-05 : 07:48:56
|
create table junk (id varchar(20),name varchar(50))ALTER TABLE junkADD cola nvarchar(299) NULLIs it possible to create column with variable.My aim :declare @i as intdeclare @x as varchar(3)set @x='aa'+@iset @i=1while @i<=10beginALTER TABLE junkADD @x nvarchar(299) NULL -- ErrorendActually i want to create column run time. bcoz no of column are not fixed .. its depend on no of days in months.so if no of months is 30 then i need 30 + 2 (fixed column)column.if u have any good idea pls share with me.Regards,AvijitRegards,avijitRegards,avijit |
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2009-01-05 : 08:04:57
|
duplicate.http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=117175 |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2009-01-06 : 04:56:32
|
Don't post Duplicate...Entries |
|
|
|
|
|