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
 General SQL Server Forums
 New to SQL Server Programming
 Storing large amounts of data

Author  Topic 

webfort
Starting Member

9 Posts

Posted - 2008-03-31 : 07:49:11
Hi,

I was wondering if any one could help me, I need to store large amounts of data in my database, at present I have it set to nvchar (8000), I've looked around and noticed you can use text which stores up to 2 million, but is slow in displaying the information.

Any ideas or points in the right directions would be great.

Thanks

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-03-31 : 08:26:59
Are you using 2000 or 2005?

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2008-03-31 : 08:49:04
What sort of data do you want to store?
nvarchar has a max size of 4000 - are you currently using nvarchar or varchar?

If you are using v2005 then you could use varchar(max).
Otherwise you could split into many columns with a sequence.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

webfort
Starting Member

9 Posts

Posted - 2008-03-31 : 09:01:19
Sorry, I'm using 2000, the date I'm storing is HTML. At present I'm using varchar (8000). How would I do the sequence?
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2008-03-31 : 09:06:18
Split the data into varchar(8000) chunks then add those chunks to the table.
You could also have two columns on the table - varchar(8000) and text. If the size is less than 8000 then add it to the varchar - if greater add it to the text with a flag to indicate which. Then when you retrieve use the flag to decide which column to retrieve.

Are you sure the performance issue is not just because you are now returning a lot more data?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-04-01 : 01:48:52
You could store the data in the varchar(8000) and create as many rows as required for a given chunk of text, linking the rows with an ID . This approch would require some splitting as you are doing the INSERT.

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2008-04-01 : 05:33:08
Think that's already been said.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -