如何在 SQL Server Management Studio 中订购项目解决方案内容

发布于 2024-07-24 01:59:46 字数 150 浏览 6 评论 0原文

在针对 SQL Server 2005 运行的 SQL Server Management Studio (SSMS) 中,我有一个包含许多视图的解决方案。

这些视图不按字母顺序排序。

任何人都可以提供原因的解释,或者按字母顺序排序的解决方案吗?

In SQL Server Management Studio (SSMS) running against SQL Server 2005, I have a solution which contains a number of views.

These views are not sorted alphabetically.

Can anyone provide either an explanation of why, or a solution to order them alphabetically ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

哽咽笑 2024-07-31 01:59:46

我刚刚遇到这个 论坛帖子。 事情并没有变得更简单。

只需编辑 ssmssqlproj 文件即可。

我的项目(SQL Main)的文件是
位于“我的文档\SQL Server
Management Studio\项目\SQL
Main\SQL Main\SQL Main.ssmssqlproj”。
它只是一个 xml 文件。 改变
以下行

 
  

 
  

它将恢复为 true,以便您
如果你做的话需要重复这个
变化。 可能有更好的
微笑的方式

I just came across this forum post. It doesn't get any simpler.

Just edit the ssmssqlproj file.

The file for my project (SQL Main) is
located in "My Documents\SQL Server
Management Studio\Projects\SQL
Main\SQL Main\SQL Main.ssmssqlproj".
Its just an xml file. Change the
following line

<LogicalFolder Name="Queries" Type="0" Sorted="true">

to

<LogicalFolder Name="Queries" Type="0" Sorted="false">

It will revert back to true so you
need to repeat this if you make
changes. THere is probably a better
way Smile

歌入人心 2024-07-31 01:59:46

您可以安装一个工具来对 SQL Server 解决方案项目的内容进行排序。

请参阅以下参考资料。

http://web.archive.org/web/20121019155526/http://www.sqldbatips.com/showarticle.asp?ID=78" archive.org/web/20121019155526/http://www.sqldbatips.com/showarticle.asp?ID=78

请确保在尝试排序之前保存您的工作。

There is a tool that you can install to sort the contents of a SQL Server Solution project.

See the following reference.

http://web.archive.org/web/20121019155526/http://www.sqldbatips.com/showarticle.asp?ID=78

Please ensure you save your work, before attempting a sort.

通知家属抬走 2024-07-31 01:59:46

当您将新项目添加到项目时,它们将被添加到列表的末尾。 它们按照添加到项目的顺序保存,因为此顺序保存在相应的 *.ssmssqlproj 文件中。 要更改此顺序,请关闭项目/解决方案,然后找到 *.ssmssqlproj 文件并使用记事本或您最喜欢的 XML 编辑器对其进行编辑(始终先进行备份!)。 对 FileNode 元素及其子元素重新排序,以重新排序解决方案资源管理器中的项目外观。

When you add new item to the project they are added to the end of the list. They are kept in the order that they were added to the project because this order is preserved in the corresponding *.ssmssqlproj file. To change this order, close the project/solution, then locate the *.ssmssqlproj file and edit it with Notepad or your favorite XML editor (always make a backup first!). Reorder the FileNode elements along with their children to reorder the items appearance in the Solution Explorer.

谎言月老 2024-07-31 01:59:46

这是我采取的解决方案。 对源代码的推荐投赞成票,但是我这里没有安装.NET,所以我不得不采用手动方法。

  1. 完成您签出的任何项目或解决方案文件的工作,然后签入这些编辑。
  2. 获取解决方案中所有内容的最新版本。
  3. 检查所有内容
  4. 备份整个文件夹结构
  5. 在记事本中打开 .ssmssqlproj 文件
  6. 将记事本全屏最大化并关闭自动换行
  7. 编辑 .ssmssqlproj 文件,按所需顺序重新排序 XML 节点
  8. 保存 .ssmssqlproj 文件
  9. 重新检查。

将所有内容 似乎已经解决了我的问题。

Here's the solution I took. Up votes for the recommendation of the source code, however I don't have .NET installed here, so I had to go for a manual approach.

  1. finish working on any project or solution files you have checked out, and check these edits in.
  2. get latest version on everything in the solution.
  3. Check everything out
  4. Backup the whole folder structure
  5. open the .ssmssqlproj file in notepad
  6. maximise notepad full screen and turn word-wrapping off
  7. edit the .ssmssqlproj file, reordering the XML nodes in the required order
  8. save the .ssmssqlproj file
  9. check everything back in.

That seems to have fixed my issue.

梦里南柯 2024-07-31 01:59:46

请注意,排序区分大小写。

所以“B..sql”将出现在“a...sql”之前。

请记住以相同的大小写开始所有脚本(无论是小写还是大写)。

Please note that the sorting is case-sensitive.

So "B..sql" will come before "a...sql".

Remember to start all your scripts with the same casing (be it lower or upper).

述情 2024-07-31 01:59:46

另一种(我认为)更简单的编辑 ssmssqlprog 的方法是使用 MS XML Notepad 2007。这样我就可以拖动节点来对它们进行排序。 当然要复印一份。 2007 似乎是最新版本,可从...

http 获取://www.microsoft.com/en-us/download/details.aspx?id=7973

Another easier (I think) way to edit the ssmssqlprog is to do so with MS XML Notepad 2007. With that I could drag the nodes around to order them. Make a copy of course. 2007 appears to be the latest version and is available at ...

http://www.microsoft.com/en-us/download/details.aspx?id=7973

最单纯的乌龟 2024-07-31 01:59:46

处理此问题的另一种方法是从 Management Studio 开始一个新查询(而不是通过在解决方案中选择“新查询”)。

使用好名称将查询文件保存到解决方案文件夹中。
然后将“添加现有项目”添加到解决方案中。

它会添加您选择的名称并正确排序,而不是最初将文件创建为“SQLQuery1”。

也许好不了多少,但是编辑项目文件并重新打开的另一种选择。

Another way to handle this is to start with a new query from Management Studio (not by selecting 'New Query' in the solution).

Save the query file into the solution folder with a good name.
Then 'Add Existing Item' into the solution.

It adds with your chosen name, sorted correctly instead of creating the file initially as 'SQLQuery1'.

Maybe not much better, but another option to editing the project file and reopening.

瞳孔里扚悲伤 2024-07-31 01:59:46

在上一个答案的基础上,您可以将其添加为解决方案中的新查询,完成后,只需将其从解决方案中删除,然后将现有项目添加到解决方案中,然后选择新查询。 这样做可以在删除并重新添加之前将新查询添加到正确的解决方案文件夹中。

Building on the previous answer, you can add it as a new query in the solution, and when you are done, just remove it from the solution and then Add existing item to the solution, and select your new query. Doing it this way adds the new query to the correct solution folder for you before you remove and add back in.

圈圈圆圆圈圈 2024-07-31 01:59:46

还有另一种方法……虽然其中一种方法对我有用过几次……但有时它会变得很顽固。 找到损坏的位置。 截取文件名的屏幕截图。
选择出现故障之前需要删除的所有文件名。
在其他作品中,如果它对 a - f 进行排序,然后对 b - z 进行排序
删除 bz 之前出现的所有 af(不要删除它们),然后保存项目。
现在将它们添加回并再次保存项目。 急速。
到目前为止,这对我来说效果很好,而且相当容易做到。

And yet another way... while one of these ways worked for me several times... sometimes it becomes stubborn. Find the location where it is broken. Take a screenshot of the file names.
Select all the file names you need to remove before the glitch.
in other works, if it sorts a - f and then sorts b - z
Remove all the a-f (don't delete them) that occur before the b-z, then save the project.
Now add them back in and save the project again. Presto.
So far this has worked very well for me and is fairly easy to do.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文