Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create a table with 180+ fields?
Message
 
To
28/05/2014 18:19:08
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008 R2
Application:
Web
Miscellaneous
Thread ID:
01600848
Message ID:
01600860
Views:
42
Thanks Dragan, seems exactly what i need. Will check and update

>>Hi
>>I need to create a table with 2 character fields ( field1, field2 ) then fields of BIT type, default to 0 (false) , named
>>[0501], [0502] [0503].....and up to [1029], [1030], [1031]
>>Where 0501 represents May 1, etc... ( format mmdd)
>>Is there some way to program sql server to build this?
>
>Without trying to guess what you may want to do... I'd write a little prg. Using curly braces for textmerge as UT's pre tag reduces double lessthan and greaterthan to single ones (at least in preview).
>
>
>c=""
>ldDay=date(2000, 5, 1)
>ldEnd=date(2000, 10, 31)
>do while ldDay<= ldEnd
>   lcF=right(dtos(ldday),4)
>   ldday=ldDay+1
>   c=c+textmerge(", [{{lcF}}] bit default 0 ")
>enddo
>text to _cliptext noshow textmerge
>create table Blabla (field1 char(22), field2 char(34){{c}})
>endtext
>
Why do programs stop working correctly as soon as you leave the Fox?
Previous
Reply
Map
View

Click here to load this message in the networking platform