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 2000 Forums
 Transact-SQL (2000)
 Field > 8000 chars

Author  Topic 

pithhelmet
Posting Yak Master

183 Posts

Posted - 2005-05-16 : 16:04:58

Hi Everyone -

We are creating a audit field in one of the tables,
the audit message can be over 8000 bytes in length...

What field type should be used??

thanks
tony

(SQL 2k)

X002548
Not Just a Number

15586 Posts

Posted - 2005-05-16 : 16:19:17
text?

BUT! I don't like the sound of what you're doing.

Can you explain it in more detail?



Brett

8-)
Go to Top of Page

pithhelmet
Posting Yak Master

183 Posts

Posted - 2005-05-16 : 19:01:57
Hi Brett and everyone -

We are receiving a data stream from serial devices, and the requirements state
that the entire communication stream shall be saved in HEX with a decimal
seperating the HEX values....


SOOOOOO

take a 3k communication audit, 2x the char (to get the hex representation) and add a decimal (.) between each character....

thus 3000 X 3 = 9000 audit

the audits are getting larger as the users are getting better with the handheld devices,
so i can only envision larger audits in the future.

Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-05-17 : 16:03:16
It's ususally a bad idea to confuse storage with presentation.
The best imo would be to store the data in it's native format,
and do the hex splitting when retrieving it.
(might be a good job for an udf in this case).

Alternatively if You really want to avoid TEXT datatype You can use multiple rows for each comstream.
streamID,line int, data varchar(8000).


rockmoose
Go to Top of Page

pithhelmet
Posting Yak Master

183 Posts

Posted - 2005-05-18 : 10:20:04
Hi Everyone -

I don't write the specs - i just try to implement them...
the analysts and support people didn't want another
program to load and run on the customers machines -
that is why the decimal seperattion in the database field...

i know i know - i just work here, and give them what they want,
even if it will cost more in the end, they want it this way,
and this way only...

rant over

gasp

thanks
tony

Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-05-18 : 13:35:14
Give them a view.
This will provide a layer of abstraction between the database and the loading program.
You can implement the actual storage as You see fit in the database, as long as the view
returns the text in the correct format.
Oh well, use text.

rockmoose
Go to Top of Page

pithhelmet
Posting Yak Master

183 Posts

Posted - 2005-05-18 : 17:29:23

Hello Everyone -

Thanks for the replies - text it is...

thanks again!!

take care
tony

Go to Top of Page
   

- Advertisement -