Viewing 15 posts - 47,521 through 47,535 (of 49,552 total)
Miranda Johnson (1/30/2008)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 1:09 pm
Pretty much, assuming the table tower.nbdoc exists.
You just need to specify the column names for the insert and in the select. eg
INSERT INTO ATable (Col1, col2, col3, col4)
SELECT Value1, value2,...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 1:07 pm
gova (1/30/2008)
You beat me on that Gilamonster when I was typing the sample code.
🙂 I'm feeling a bit lazy tonight, so very simple sample code
BTW.
order by case when @sortorder...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 1:05 pm
Yes and no.
I prefer not to force row locks unless I know that only a very small number of rows are going to be updated. Preferably tune the trigger so...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 12:39 pm
Then you can try something like this.
select col1, col2 from
(Select distinct col1, col2, col3 from sometable) subquery
order by case when @sortorder = 1 then col1 else col3 end...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 12:29 pm
aruram (1/30/2008)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 12:24 pm
1st suggestion - rewrite the trigger and remove the cursor.
2nd suggestion - same as the first. 😉
What's the idea behind the trigger? What are you trying to do when the...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 11:57 am
Matt Miller (1/30/2008)
If the procedure in MASTER is marked as a system stored proc, then it overrides the...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 11:48 am
DonaldW (1/30/2008)
Significantly slower than you saw in your test.
Probably because you cleared the cache. I tend to prime the cache before running tests (run the query once so that I...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 11:41 am
Also note that truncating a log (removing inactive log entries) and shrinking the log (reducing the size on disk) are two separate things.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 11:37 am
goran (1/30/2008)
Gail, when you have found one (1!) application in the whole universe that uses the same name on a system stored procedure as on...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 11:36 am
Please don't cross post. It wastes people's time.
Please direct replies to the following thread:
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 11:30 am
Could be indexes, could be the queries, could be blocking. Without more information it's very hard to say.
Can you post the query that times out and the schema and indexes...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 11:23 am
Are those distincts necessary?
I believe that when distinct is specified, the order by (in your case, the case statement) must appear in the select clause.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 30, 2008 at 11:20 am
You can look in the dmv sys.dm_tran_locks
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 29, 2008 at 11:58 pm
Viewing 15 posts - 47,521 through 47,535 (of 49,552 total)