The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Databases
> Database Management
|
Database Data Types Question
Discuss Database Data Types Question in the Database Management forum on Dev Shed. Database Data Types Question Database Management forum discussing non-database specific SQL. Structured Query Language was designed to be a robust and standardized language for manipulating relational databases.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

July 24th, 2002, 01:47 AM
|
|
Registered User
|
|
Join Date: May 2002
Posts: 18
Time spent in forums: 33 m 59 sec
Reputation Power: 0
|
|
|
Database Data Types Question
Quick question, I will probably sound like a newb...but I don't have any good reference for these kind of questions.
I want to store a rather long piece of text in one of my tables in Microsoft SQL Server 2000. I looked over all the data types, char, varchar, text, ntext, and none of them seem to be able to hold this piece of text. The piece of text, according to Word, is 7,185 characters long, counting spaces etc. Is there a good way to store this in a database field? Or am I doing something stupid? If so, what's the alternative? Thanks. 
|

July 24th, 2002, 08:57 AM
|
 |
SwollenMember
|
|
Join Date: Jun 2000
Location: the master control
Posts: 264
Time spent in forums: 13 h 14 m 57 sec
Reputation Power: 13
|
|
|
i am not that familiar with SQL server, however i think that Oracle could handle this (however don't quote me). one solution might be to store the data in text files and the column that was supposed to have the data in it can now just have the name of the text file where the data resides. since the data is so large, this might be useful since you were probably not going to index the column anyway.
|

July 24th, 2002, 09:34 AM
|
 |
Modding: Oracle MsSQL Firebird
|
|
Join Date: Jun 2001
Location: Outside US
|
|
|
I think that ntext, text and image should be the answer.
Note ntext A Unicode text field that can hold up to 1,073,741,823 characters. These fields cannot be indexed or used in a WHERE clause.
Last edited by pabloj : July 24th, 2002 at 09:37 AM.
|

July 24th, 2002, 06:34 PM
|
|
Registered User
|
|
Join Date: May 2002
Posts: 18
Time spent in forums: 33 m 59 sec
Reputation Power: 0
|
|
|
That's interesting because I tried to copy and paste something that has substantially less characters into the field when it was of type ntext and it would not let me.
The Text File sounds like a good thing although I would have wanted to have users be able to search in the field where all the text would reside...
But according to you, pabloj, it won't work? I couldn't search for a specific word using a where clause even if I was able to put all the text in there?
|

July 25th, 2002, 09:39 AM
|
 |
SwollenMember
|
|
Join Date: Jun 2000
Location: the master control
Posts: 264
Time spent in forums: 13 h 14 m 57 sec
Reputation Power: 13
|
|
|
well, the hard part comes at indexing something that large. a search on each row for this field would take a long time and your queries would be very expensive. if you want to search for key words in this field, then you might want to consider redesigning your table structure and/or relationships. you could have 1 record id join to another table that has that record id many times for different key words. then you could have another table that has an id and the complete sentence (or your large amount of data). this table could join to the bridge as well, seeing as how 1 sentence would have many key words as well.
|

July 25th, 2002, 03:14 PM
|
 |
Contributing User
|
|
Join Date: May 2002
Location: NJ, USA
Posts: 91
Time spent in forums: 1 h 1 m 8 sec
Reputation Power: 11
|
|
|
Why not just store a pointer to your file?
__________________
- Walt
Will code for food.
|

July 25th, 2002, 03:40 PM
|
 |
SwollenMember
|
|
Join Date: Jun 2000
Location: the master control
Posts: 264
Time spent in forums: 13 h 14 m 57 sec
Reputation Power: 13
|
|
Quote: | Why not just store a pointer to your file? |
This was already posted...also he explained that he wanted to be able to have some search functionality using the where clause.
|

July 25th, 2002, 07:49 PM
|
 |
Contributing User
|
|
Join Date: May 2002
Location: NJ, USA
Posts: 91
Time spent in forums: 1 h 1 m 8 sec
Reputation Power: 11
|
|
|
The problem in trying to seach something so large is that it's not efficient. It would be better to add some keywords to search on.
|

July 25th, 2002, 08:28 PM
|
 |
SwollenMember
|
|
Join Date: Jun 2000
Location: the master control
Posts: 264
Time spent in forums: 13 h 14 m 57 sec
Reputation Power: 13
|
|
Quote: | The problem in trying to seach something so large is that it's not efficient. It would be better to add some keywords to search on. |
hrm...sounds a lot like...
Quote: | well, the hard part comes at indexing something that large. a search on each row for this field would take a long time and your queries would be very expensive. if you want to search for key words in this field, then you might want to consider redesigning your table structure and/or relationships. |
please read the posts first 
|

July 26th, 2002, 07:30 AM
|
 |
Contributing User
|
|
Join Date: May 2002
Location: NJ, USA
Posts: 91
Time spent in forums: 1 h 1 m 8 sec
Reputation Power: 11
|
|
|
So, basically, you got it covered. I guess my work is done here.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|