如何将查询结果导出到SQL Server 2014中的TXT [英] How export the result of a query to TXT in SQL server 2014

查看:130
本文介绍了如何将查询结果导出到SQL Server 2014中的TXT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我不是管理员,因此无法访问服务器。但我需要将查询结果导出到TXT文件。我无权访问BCP或xp_cmdshell存储过程。我需要一个不涉及在服务器上请求执行权限的解决方案。



我尝试过:



OPENROWSET但我不知道微软OLEDB的版本是否已经安装

I do not have access to the server since I am not an administrator. But I need to export the result of a query to a TXT file. I do not have access to BCP or the xp_cmdshell store procedure. I require a solution that does not involve requesting execution permissions on the server.

What I have tried:

OPENROWSET but i don't know the version of Microsoft OLEDB are instaled

推荐答案



您必须至少连接才能在服务器上运行。

为此您需要登录(凭据)进行身份验证:

- windows

- SQL用户/密码

在这两种情况下,你应该对要查询的对象拥有最低的SELECT权限。

如果是这种情况,则不需要xp_cmdshell启用。

您可以使用:

1)BCP.exe,它几乎是任何一台机器的一部分。

2)Powershell

3)ISQL

3)任何连接服务器和执行查询的语言。



GB
Hi,
You have to connect as minimum in order to run something on the server.
For this you need login (credentials) to authenticate :
- windows
- SQL user/password
In the both cases you should have minimum SELECT permissions on the objects you want to query.
If it is the case, no need xp_cmdshell enabled.
You can use :
1)BCP.exe which is part of almost any machine.
2)Powershell
3)ISQL
3)Any language to connect to server and execute queries.

GB


这篇关于如何将查询结果导出到SQL Server 2014中的TXT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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