store exe file inside the db

store exe file inside the db

Post by oj » Sat, 14 Apr 2001 05:54:50



Amos,

You can use Image datatype.  Check out http://www.mssqlserver.com/faq/development-imagetext.asp
for more info on how to store the file.

-oj


  Hi ,

  I need to store .exe and .com files inside the database so later will be able to use cmdshell (or other, maybe sp_OA...) to put it back into the file system and exe it.

  Does anyone have an idea what's the best way to do it ?
  What is the data type must suitable for holding binary files or scripts? (I thought of nvarchar)

  Cheers,
  Amos

 
 
 

store exe file inside the db

Post by Amos » Sat, 14 Apr 2001 10:46:28


Hi ,

I need to store .exe and .com files inside the database so later will be able to use cmdshell (or other, maybe sp_OA...) to put it back into the file system and exe it.

Does anyone have an idea what's the best way to do it ?
What is the data type must suitable for holding binary files or scripts? (I thought of nvarchar)

Cheers,
Amos

 
 
 

store exe file inside the db

Post by Scott Whigha » Sat, 14 Apr 2001 06:25:49


As for the datatype question, depends on the size of the binary files/scripts.  If these are all SQL Scripts and they are less than 4k in size, you can use nvarchar (could expand to 8k with varchar).  If they exceed 4k/8k, you would need to use text datatype.

Good luck!

Scott Whigham
MCSE, MCDBA
http://www.gulfsouthconsulting.com/sqlserver

  Hi ,

  I need to store .exe and .com files inside the database so later will be able to use cmdshell (or other, maybe sp_OA...) to put it back into the file system and exe it.

  Does anyone have an idea what's the best way to do it ?
  What is the data type must suitable for holding binary files or scripts? (I thought of nvarchar)

  Cheers,
  Amos