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 |
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2009-04-13 : 10:40:04
|
| CREATE TABLE [dbo].[CPDPLP06]( [REQUEST_DATE] [datetime] NOT NULL DEFAULT (getdate()), [CODER_ID] [char](4) NULL, [LNB_RECORD] [varchar](7000) NULL, [LNB_RECORD2] [varchar](7000) NULL)Is it ok to define two columns of varchar(7000) each. The need is to store 13800 chars of data into a single column in a table. This table is being populated from a NET Cobol program from which we cannot do a cast to varchar(max). So it is not possible to define a single column of varchar(max). I tried it, and it always gave the truncation error.But is it advisable to have more than 8000 chars in a single row in SQL server 2005? |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2009-04-13 : 11:07:49
|
| No Dude...I later found out that having a varchar(max) and populating from NET Cobol is not possible, which is why I split it into two varchar columns. But the size goes over 8000 which worries me. I'm not sure if its alright. |
 |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2009-04-13 : 11:39:44
|
| what the heck are you populating it with, can you somehow save it binary which might shrink the size? just top of my head.<><><><><><><><><><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2009-04-13 : 11:56:13
|
| Its a crazy requirement in itself. I've tried to talk them out of it, but they r a bunch of morons.Binary seems to be worth a try. I'll give it a shot and let you know. |
 |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2009-04-13 : 13:34:58
|
| bad idea it truncates it. maybe xml? or change the requirements. Wait a second better use varbinary(max) same when casting the long string use varbinary(max)<><><><><><><><><><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
|
theboyholty
Posting Yak Master
226 Posts |
Posted - 2009-04-14 : 11:35:55
|
| Dude, HORRIBLE HORRIBLE table & field names. When designing your tables, please give some consideration for the poor sod who has to come and work out how it all works for maintenance/updates or reporting from it after you've moved on.Generously ignoring the underscores, I could make my peace with LNB_RECORD and LNB_RECORD2 (presumably they mean something to the people in your organisation) but CPDPLP06? What the hell is that supposed to be?Come on man, use your imagination. |
 |
|
|
|
|
|
|
|