哪个用户帐户在没有 -U 和 -P 选项的 T-SQL 脚本中运行 SQLCMD? [英] Which user account is running SQLCMD in T-SQL Script without -U and -P option?

查看:19
本文介绍了哪个用户帐户在没有 -U 和 -P 选项的 T-SQL 脚本中运行 SQLCMD?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 T-SQl 脚本中使用 sqlcmd 将文本文件写入网络位置.但是,由于对网络文件夹的访问权限,SQLCMD 无法写入该位置.SP 正在我的用户帐户下运行,该帐户有权访问网络文件夹.

I am using sqlcmd in a T-SQl script to write a text file to a network location. However SQLCMD is failing to write to that location due to access permission to the network folder. SP is being run under my user account which has access to the network folder.

如果我没有在 TSQL 脚本中指定 -U 和 -P 选项,你能帮我在哪个帐户下运行 sqlcmd 吗?

Could you please help me under which account sqlcmd will run if I do not specify -U and -P option in TSQL Script?

推荐答案

用这个来查找用户名:

PRINT Suser_Sname();

这篇关于哪个用户帐户在没有 -U 和 -P 选项的 T-SQL 脚本中运行 SQLCMD?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆