开发者

How to read/write or copy/paste text file locally using Stored procedure?

My Stored Procedure is using Bulk Insert Task. As per requirement of Bulk Insert, the text file should be on same server where database is.

Now file is residing on another machine. But database server can access file using shared network drive.

Now question is How my stored procedure can read or copy t开发者_如何转开发he file from network drive and write or paste it locally before running the Bulk Insert?

Thanks


You can enable xp_cmdshell and use it to issue a copy command to the shell.

But then, why would you need that? SQL Server supports bulk insert from remote locations.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜