Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save file

Status
Not open for further replies.

cbsm

Programmer
Oct 3, 2002
229
FR
I know you're going to tell me this is a very bad idea - but I need to save (small) text files into my SQL Server (2005) database.
But I need to do it, and do not know how ...
I will never search for text in the file or things like this.
(I may have to 'recreate' the file - that's all)
1. What is the best type of field ? NText ? Image ? or ??
(I will never search for text in the file or things like this)
2. How do I write my "insert into" statement ?
3. How do I 'recreate' the file on the server ?

Thank you !!!
 
What version of SQL Server are you using?

If it's SQL2000, and you have ASCII files, then NText. If it's binary files (like images) then image.

For SQL2005 and up, use nvarchar(max) for ascii files and varbinary(max) for image files.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top