Viewing 15 posts - 19,981 through 19,995 (of 22,219 total)
Well, that depends. If you have the keys needed to find the right row or rows in the child table and all the columns you want are in the child...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 14, 2008 at 6:31 am
If a PK looks like this:
Col1
,Col2
,Col3
Then in order to reference that as a foreign key, the code would look something like this:
ALTER TABLE [schema].[tablename]
CONSTRAINT [MyFKName] FOREIGN KEY
(Col1
,Col2
,Col3)
REFERENCES [schema].[parenttable]
(Col1
,Col2
,Col3)
The names of...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 14, 2008 at 6:25 am
From the sounds of things, you should also check some of the basic operations in the code like access order and/or join order. You need to make sure that the...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 14, 2008 at 6:19 am
If I do the entire design from scratch, how much of the fee do I get?
Seriously though. We're here because we enjoy the technical challenges and each others company. Ask...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 14, 2008 at 5:23 am
Depending on what kind of data you're trying to get back, yeah. Generally I've seen either a derived table or a correlated sub-query within the ON clause work extremely well...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 14, 2008 at 5:17 am
Yeah, if you want to equate data set or result set with derived table, then they're the same. Generally though, most people refer to a derived table as a subquery...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 14, 2008 at 5:13 am
According to Itzik Ben-Gan, a subquery is any of the scalar, multivalued or table expression queries written into an outer queries. He then goes on to refer to the scalar...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 11, 2008 at 11:49 am
He means it sounds like homework.
I'd suggest using a subqery with a TOP and ORDER BY.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 11, 2008 at 10:46 am
If you're trying add these values to a CTE, wouldn't you use UNION? Probably in a second CTE.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 11, 2008 at 10:44 am
There was absolute agreement on the OUTER JOIN being an issue. The question was, did placing filters on the INNER JOIN make a difference? Several people anecdotally believe(d) so (myself...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 11, 2008 at 9:45 am
mtassin (7/11/2008)
Grant Fritchey (7/11/2008)
rbarryyoung (7/11/2008)
Grant Fritchey (7/10/2008)
There's an "Anti-Rbar Alliance"?How do you join? ...
Uhhhm, .. do you want it in SQL-92 syntax or SQL-89 syntax?
😀
You know, either way works for...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 11, 2008 at 9:24 am
Generally, I've just passed all the fields back to the proc and updated them. Depending the app & the business needs, it usually doesn't matter if FieldX is updated from...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 11, 2008 at 8:05 am
The time differences on those are pretty trivial. The same number of scans and the same number of reads usually tell you most of what you need to know.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 11, 2008 at 8:03 am
You'll have to store the symbol and it's associated currency in a table in order to select on it. Otherwise you could create an enormous CASE statement, but the first...
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 11, 2008 at 7:06 am
ANSI settings are different for that user than the others. Probably, but not definately, ANSI_NULLS.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 11, 2008 at 7:03 am
Viewing 15 posts - 19,981 through 19,995 (of 22,219 total)