Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我编写了一个存储过程,它使用批量插入从 *.csv 文件加载数据。当我提到物理路径时它工作正常。现在我想在 SQL Server 项目中使用相同的存储过程。因此我必须提到相对路径。无论如何我可以这样做吗?提前致谢。
Your best bet would be to either pass the root in as a parameter to the SP, or have a config table in your DB and set the root path there. Heck, you might as well just pass in the entire fully qualified name of the file if you can.