Results 1 to 15 of 15

Thread: [RESOLVED] Huge Datatype at SQL v8.0

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Posts
    87

    Resolved [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.

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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).

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Posts
    87

    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.

  4. #4
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Posts
    87

    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.

  7. #7
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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!

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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! )
    Quote Originally Posted by premz
    I am using a Insert query via a SQL procedure.
    Can you show us the code?

  9. #9
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Huge Datatype at SQL v8.0

    Quote Originally Posted by si_the_geek
    I'm not sure.. perhaps StrangerInBeijing?
    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

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Posts
    87

    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.

  11. #11
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Huge Datatype at SQL v8.0

    Let us see the ASP code - this is ASP.Net - right?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  12. #12
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Posts
    87

    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.

  14. #14
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  15. #15
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width