0

因此 linqpad 允许您命名查询,这样当您运行查询时,它会在您单击运行时作为查询本身的标题出现 - 当您同时进行多个选择时,这会有所帮助:MSQL 上是否有类似的功能管理工作室?

所以,IE 查询时,而不是

 Query1Table1|Query1Table2|Query1Table3
 Query2Table1|Query2Table2|Query2Table3
 Query3Table1|Query3Table2|Query3Table3

你可以看到

    'People'
 Query1Table1|Query1Table2|Query1Table3
    'Students'
 Query2Table1|Query2Table2|Query2Table3
    'class'
 Query3Table1|Query3Table2|Query3Table3
4

1 回答 1

1

不是我见过的。如果您正在寻找向结果添加一些详细/调试值的能力,您可以在实际选择之前进行一次性选择。您可以将这些语句包装在 If @debug 检查中,以便您可以轻松地有选择地打开/关闭它们。我对一些更复杂的查询执行此操作以帮助调试,尤其是在使用表变量时。举个简单的例子:

declare @debug bit;set @debug=1;

declare @t table (id int)
insert into @t select 1
insert into @t select 2
insert into @t select 3
insert into @t select 4
insert into @t select 5

-- Debugging
if (@debug=1) begin
select '@T contents:';
select * from @t
end

-- Actual select
select * from @t where id >3;
于 2012-05-17T19:00:23.620 回答