Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create a table with 180+ fields?
Message
From
29/05/2014 15:10:45
 
 
To
29/05/2014 14:50:52
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:
01600927
Views:
31
>>>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?
>>>
>>
>>Why not just have a character field that contains a string 180+ characters long that contains your bit pattern, ex. "0000110111101". Then just use string functions to determine if they're set or not?
>
>Or just six integers, one for each month, and then use bittest() to see which days are ticked.

But that doesn't cover the cases where you have months with more than 32 days... such as in the case of a quintuple leapyear. <g>
Previous
Reply
Map
View

Click here to load this message in the networking platform