在SQL Server中生成CREATE INDEX语句

编程入门 行业动态 更新时间:2024-10-22 20:30:39
本文介绍了在SQL Server中生成CREATE INDEX语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有没有人有脚本列出SQL Server数据库中所有现有索引的CREATE INDEX语句?

Does anyone have a script to list of CREATE INDEX statements for all existing indexes in a SQL Server database?

此主题所有索引和列表的列表SQL Server DB中的索引列提供了有关如何查找它们的重要提示。但是生成 CREATE INDEX 语句的脚本会很棒。有时我们遇到没有足够数据的情况,或者在没有文档的情况下以特别方式添加索引,因此缺少create语句。就像我现在发现自己的情况一样。

This thread List of all index & index columns in SQL Server DB has great tips on how to find them. But a script to generate the CREATE INDEX statements would be great. Sometimes we come into a situation without adequate data, or indexes have been added in an ad-hoc manner over time without documentation, so the create statements are missing. Like in a situation I find myself in right now.

谢谢。

推荐答案

使用SQL Management Studio中的生成脚本并选择脚本索引选项(在高级脚本选项下)

Use Generate Scripts from SQL Management Studio and choose the "Script Indexes" options (under Advanced Scripting options)

更多推荐

在SQL Server中生成CREATE INDEX语句

本文发布于:2023-10-07 14:19:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1469622.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:语句   Server   SQL   INDEX   CREATE

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!