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.
| Author |
Topic |
|
dkekesi
Starting Member
38 Posts |
Posted - 2011-04-14 : 11:25:24
|
| Hi All,I need to import documents into SQL database. The problem is that some documents are binary and some documents are text based (csv, xml, txt, etc.).Can they be stored in a single varbinary(max) column and retrieved properly? If not what is the best practice if I do not know in advance if the file will be binary or text (and I do not want to examine before loading them into SQL).Thanks for your kind help in advance.Best Regards,Daniel |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-04-14 : 11:29:47
|
| Then you wil have to treat them as binary. As to being retrieved it depends on how you load and extract but a binary should end up with what you started with.==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-04-14 : 12:01:16
|
| You may want to consider using filestream storage. I have not experimented much with it; these two pages have a lot of information about the pros and cons, how and why etc:http://msdn.microsoft.com/en-us/library/cc949109(v=sql.100).aspxhttp://www.simple-talk.com/sql/learn-sql-server/an-introduction-to-sql-server-filestream/Since you are not able to determine the type of the file - whether it is binary or not, the only other option that I can think of is what Nigel suggested. |
 |
|
|
dkekesi
Starting Member
38 Posts |
Posted - 2011-04-18 : 01:33:23
|
quote: Originally posted by sunitabeck You may want to consider using filestream storage. I have not experimented much with it; these two pages have a lot of information about the pros and cons, how and why etc:http://msdn.microsoft.com/en-us/library/cc949109(v=sql.100).aspxhttp://www.simple-talk.com/sql/learn-sql-server/an-introduction-to-sql-server-filestream/Since you are not able to determine the type of the file - whether it is binary or not, the only other option that I can think of is what Nigel suggested.
Nigel, Sunitabeck, thanks for the help. Filestream looks very promising in our case.Best Regards,Daniel |
 |
|
|
|
|
|
|
|