Get file contents via xp_cmdshell

☆樱花仙子☆ 提交于 2019-12-04 16:52:26

You could use BULK INSERT on the file and treat the file as a table with one row and one column. This should allow you to read the file directly into a VARBINARY field

Like this:

CREATE TABLE FileRead
(
  content VARBINARY(MAX)
)

BULK INSERT FileRead FROM [FilePath]

This requires SQL Server to have access to the file you are trying to read. It sounds like you are trying to "acquire" executables from a server you do not have access to? :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!