|
-
May 11th, 2008, 12:09 PM
#1
Thread Starter
Lively Member
[RESOLVED] Huge Datatype at SQL v8.0
Hi friends,
I need to store large amount of data in one field like a product descriptions etc.
I am using MS SQL Server 8.0 Enterprise Edition-RTM.
I searched and found abt varchar(MAX) but guess that is not applicable in my SQL version.
Please help.
Thank you.
-
May 11th, 2008, 02:22 PM
#2
Re: Huge Datatype at SQL v8.0
Most people don't refer to SQL versions like 8.0.
MS SQL version 7.0 was the last version referred to as a version number like that.
Version 8.0 is called MS SQL 2000.
Version 9.0 is called MS SQL 2005.
varchar(max) is an MS SQL 2005 feature.
How many bytes do you need to store? VARCHAR() allows up to around 8000 (4000 if unicode).
-
May 13th, 2008, 12:40 PM
#3
Thread Starter
Lively Member
Re: Huge Datatype at SQL v8.0
Many Thanks, szlamany.
I need to store approx 6000 letters. I tried using varchar-8000 but it stores 1500 letters.
All I can do is spilit in 2 or 3 fields, any other thoughts!
Thank you.
-
May 13th, 2008, 12:55 PM
#4
Re: Huge Datatype at SQL v8.0
The TEXT() and NTEXT() datatypes allow for much larger storage (2,147,438,647 bytes).
But they have "search" issues - you cannot use LIKE operator for instance.
IMAGE is also a datatype that can be used - it can be used to store text.
I've never done anything like this.
In my opinion several columns of VARCHAR(8000) type would be more useful later - when doing queries and such.
Can you share with us some more details about what kind of data you are storing in this field. And what you need to do with it going forward.
-
May 13th, 2008, 01:02 PM
#5
Re: Huge Datatype at SQL v8.0
VarChar will store 8000 characters (or 4000 using unicode), so to only be storing 1500 suggests that whatever method you are using to store the data is not correct/apt.
-
May 14th, 2008, 06:54 AM
#6
Thread Starter
Lively Member
Re: Huge Datatype at SQL v8.0
Thank you, szlamany and si_the_geek
I am trying to insert data like Poiduct Descriptions, Customer reviews, customer feedback...
I am using a Insert query via a SQL procedure.
Thank you.
-
May 14th, 2008, 07:24 AM
#7
Re: Huge Datatype at SQL v8.0
@si - who is the member that does newspaper stuff in the region around China? I tried searching my subscribed threads for a name but wow - I've got 5000+ sub'd threads!
-
May 14th, 2008, 11:38 AM
#8
Re: Huge Datatype at SQL v8.0
I'm not sure.. perhaps StrangerInBeijing?
("only" sub'd 5000 threads? I'm just about to pass 12000! )
 Originally Posted by premz
I am using a Insert query via a SQL procedure.
Can you show us the code?
-
May 14th, 2008, 12:05 PM
#9
Re: Huge Datatype at SQL v8.0
 Originally Posted by si_the_geek
Yes - that's him. I just PM'd him to see if he can offer any insight on this thread.
("only" sub'd 5000 threads? I'm just about to pass 12000!  )
Can you show us the code?
I am pretty much a DB-only poster - you know how those threads can take lots and lots of posts to clear up
-
May 14th, 2008, 12:30 PM
#10
Thread Starter
Lively Member
Re: Huge Datatype at SQL v8.0
No idea whats up with that @si....anyways.
Here is what i am following to insert the data into database...
I set the datatype as varchar-8000
I am using a simple insert query passed via SQL Procedure from ASP code.
CREATE PROCEDURE test_insert
@i_prod_id bigint,
@i_prod_details varchar(8000)
AS
Insert into prodadditionals (pid, pdetails)
values (@i_prod_id,i_prod_details)
Am i doing wrong?
Thank you so much for your time.
-
May 14th, 2008, 12:48 PM
#11
Re: Huge Datatype at SQL v8.0
Let us see the ASP code - this is ASP.Net - right?
-
May 14th, 2008, 12:50 PM
#12
Re: Huge Datatype at SQL v8.0
Um.... let's take it from another POV ... HOW do you know it's only storing 1500 characters?
-tg
-
May 14th, 2008, 01:22 PM
#13
Thread Starter
Lively Member
Re: Huge Datatype at SQL v8.0
Thanks szlamany.
The Code is at ASP-Classic.
I tired inserting via SQL Analyzer and the ASP code, and it is working fine.
But i was unable to display it as i was downloading from SQL Analyser.
Finally, wrote a select query and displayed it over web page and i was able to insert dot 8000 letters.
Thanks much.
-
May 14th, 2008, 01:25 PM
#14
Re: Huge Datatype at SQL v8.0
query analyzer does not show the full size of a column that large.
there are options you can set under the Tools>Option menu under the Results tab to change this setting.
-
May 14th, 2008, 03:21 PM
#15
Re: [RESOLVED] Huge Datatype at SQL v8.0
that's what I was begining to suspect, which is why I asked... it's a common problem.
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|