如何在SQL Server中包括来自syscomments的换行符? [英] How do I include the newlines from syscomments in SQL Server?

查看:141
本文介绍了如何在SQL Server中包括来自syscomments的换行符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个脚本来获取文档中的所有触发器,但是我想添加换行符.我将其复制并粘贴到excel中,以便随后快速生成一些授权文档,但是最终生成的文本列中的所有内容都没有换行符.

I'm building a script to get all the triggers in the document, but I want to include newlines. I'm copying and pasting this into excel in order to then quickly generate some mandated documentation, but all the contents from the text column end up being generated without newlines.

我当前正在使用的会在文件结果中产生截断的行是:

The line I'm currently using, which produces truncation in results to file is:

SELECT OBJECT_DEFINITION(sys.objects.object_id)
FROM sys.objects 
WHERE type = 'TR'

推荐答案

Tools->Options->Query Results->Results to file

无需复制粘贴:)

这篇关于如何在SQL Server中包括来自syscomments的换行符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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