Microsoft SQL Server Management Studio - 查询结果为文本 [英] Microsoft SQL Server Management Studio - query result as text

查看:29
本文介绍了Microsoft SQL Server Management Studio - 查询结果为文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Microsoft SQL Server 中有一个数据库,我正在使用 Microsoft SQL Server Management Studio.

I have a database in Microsoft SQL Server and I am using Microsoft SQL Server Management Studio.

我可以选择将查询结果插入到文件中,尽管查询结果没有用任何特殊符号分隔.

I have an option to insert the query result to the file, although the results of the query are not separated by any special signs.

看起来像这样

select * from table_name

输出:

18 182 3386 NULL
18 790 12191 NULL

在文件中:

18          182         3386        NULL
18          790         12191       NULL

是否有可能修改查询,以便在每条记录后放置一个特殊字符,如下所示:

Is there any possibility to modify query so after every record it will put a special char, like this:

在文件中:

18;          182;         3386;        NULL;
18;          790;         12191;       NULL;

这样我就可以更轻松地将此数据库复制到其他程序中.

It will be easier then for me to copy this database to other programs.

推荐答案

在 SSMS 中:

Tools > Options > Query Results > Results To Text

顶部选项有Output Format,可以在那里设置分隔符.

Top option there is Output Format, can set a delimiter there.

这篇关于Microsoft SQL Server Management Studio - 查询结果为文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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