Data type for storing script files

  • HI ,

    I want store some script files in my table . Which data type i have to use to store script files .

    Regards,

    Lavanya sri

  • Lavanyasri (8/17/2011)


    HI ,

    I want store some script files in my table . Which data type i have to use to store script files .

    Regards,

    Lavanya sri

    If your scripts are small you could do with NVARCHAR(4000)

    For larger one use NVARCHAR(MAX)

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • HI Eugene,

    Thanks for quick reply .

    if we want to stor the data in a table nvarchar(max) is correct . But if we want to store the complete file which data type we should go for ???

  • Script file is the text isn't it?

    So nvarchar(max) is the best for this. There is an option to store nibanry data in ntext, text ot image datatype, but it's not advisable for storing files.

    BTW, files better to be stored in the file system (it just happen to be designed precisely for this).

    Database is designed to store data.

    But, if you insist...

    There is FILESTREAM which integrates SQLServer with NTFS file system.

    http://technet.microsoft.com/en-us/library/bb933993.aspx

    Yeah, you will need to migrate to SQL2008 to use it...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply