SQL Server 2005:如何在查询中自动包含数据库名称和括号

时间:2021-08-12 23:36:12

Good day,

In SQL Server 2005, when I write a new query, I like to drap and drop table and column names from the object explorer. However, when I drag and drop a table, is there a way to automatically include the database name?

在SQL Server 2005中,当我编写新查询时,我喜欢从对象资源管理器中删除和删除表名和列名。但是,当我拖放一个表时,有没有办法自动包含数据库名称?

(example: when I drag and drop the table Table1 in the query designer, I would like to have Database1.dbo.Table1 instead of just Table1)

(例如:当我将表Table1拖放到查询设计器中时,我想拥有Database1.dbo.Table1而不只是Table1)

Also, is there a way to automatically include '[' and ']' around the column and table names?

另外,有没有办法在列和表名称周围自动包含'['和']'?

Thank you!

1 个解决方案

#1


Sorry, not from drag and drop from object explorer.

对不起,不是从对象资源管理器中拖放。

One of the tools suggested in this question may help:

此问题中建议的工具之一可能有所帮助:

Need a tool to automatically indent and format SQL Server stored procedures

需要一个工具来自动缩进和格式化SQL Server存储过程

#1


Sorry, not from drag and drop from object explorer.

对不起,不是从对象资源管理器中拖放。

One of the tools suggested in this question may help:

此问题中建议的工具之一可能有所帮助:

Need a tool to automatically indent and format SQL Server stored procedures

需要一个工具来自动缩进和格式化SQL Server存储过程