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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Is this OK?

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

Posted - 2009-04-13 : 10:57:25
Vijay

Did you lose track of this thread maybe..

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=123468

<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page

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.
Go to Top of Page

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
Go to Top of Page

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.
Go to Top of Page

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
Go to Top of Page

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.
Go to Top of Page
   

- Advertisement -