Viewing 15 posts - 2,926 through 2,940 (of 5,394 total)
It's very hard to tell without table scripts, indexes script and actual execution plan.
Can you post the above?
If in doubt, you can check this article[/url] to see how to gather...
July 22, 2011 at 4:24 am
Wrap it inside parenthesis:
declare @i int = (select count(*) from sys.columns)
works for me.
Hope this helps
July 21, 2011 at 8:51 am
Tom.Thomson (7/20/2011)
How do I vote?? I want to vote for LJE (from earlier post, I guess Gianluca might want to too).
Nah... I have nothing against Larry.
Those who buy...
July 21, 2011 at 2:03 am
WayneS (7/20/2011)
July 21, 2011 at 1:55 am
Gianluca Sartori (7/20/2011)
Jeff Moden (7/20/2011)
BWAA-HAAA!!!! Don't hold back! Say what you really mean! 😛
It's always been a problem of mine. :blush:
However, just to make my point again.... http://wp.me/p1gueM-3N...
July 20, 2011 at 8:05 am
Jeff Moden (7/20/2011)
BWAA-HAAA!!!! Don't hold back! Say what you really mean! 😛
It's always been a problem of mine. :blush:
July 20, 2011 at 8:01 am
Use EXEC:
DECLARE @sql nvarchar(max)
SET @sql = N'
create view vwTest
as
select * from non_existence_table'
BEGIN TRY
EXEC(@sql)
END TRY
BEGIN CATCH
PRINT 'Oh no!'
END CATCH
July 20, 2011 at 2:35 am
Lynn Pettis (7/19/2011)
July 20, 2011 at 2:10 am
Jeff Moden (7/19/2011)
July 19, 2011 at 3:17 pm
Lynn Pettis (7/19/2011)
Besides the NOLOCK hint, my concern is the SELECT * FROM ... GROUP BY ... in the derived table.
Nice catch, Lynn. I suppose this is due to some...
July 19, 2011 at 2:57 pm
I don't see anything evil here (except the NOLOCK hint: seriously, get rid of that thing).
Can you post the estimated execution plan for both versions?
Also, can you post DDL for...
July 19, 2011 at 9:58 am
I tried reproducing the behaviour you describe, but I'm getting the same query plans for both statements.
-- SETUP
-- CREATE TABLE
CREATE TABLE testTable (
Id int identity(1,1),
dateColumn datetime
)
-- POPULATE TABLE
INSERT INTO testTable...
July 19, 2011 at 7:50 am
Mike01 (7/19/2011)
July 19, 2011 at 7:45 am
Did you see any difference in the actual execution plans?
July 19, 2011 at 7:18 am
Viewing 15 posts - 2,926 through 2,940 (of 5,394 total)