Viewing 15 posts - 1,546 through 1,560 (of 6,036 total)
Every query has a common block:
FROM dbo.RequestorToCapabilityDeferred_vw r
INNER JOIN dbo.Capability_tbl c ON r.capabilityId = c.capabilityId
LEFT OUTER JOIN dbo.CapabilityStatus_tbl CS on r.capabilityStatusid = CS.capabilityStatusid
It should be made into...
_____________
Code for TallyGenerator
March 23, 2016 at 11:46 pm
Brandie Tarvin (3/22/2016)
Anyone have any advice?
Leave it.
Forget about it.
I found the new BOL absolutely useless.
Google may not be perfect, but at least it gets you what you need...
_____________
Code for TallyGenerator
March 23, 2016 at 12:14 am
You must have a mapping table between varieties of flavors and "flavor groups" (or how do you name it).
When you say "all chocolate flavors" you mean "chocolate", "chocolate swirl", etc....
_____________
Code for TallyGenerator
March 23, 2016 at 12:08 am
For non-clustered indexes you may create pairs if identical indexes and disable one of them.
Then you run something like this:
IF INDEXPROPERTY(OBJECT_ID('dbo.TableName'), 'IX_Index1_Odd', 'IsDisabled') = 0
BEGIN
ALTER INDEX IX_Index1_Even ON dbo.TableName...
_____________
Code for TallyGenerator
March 22, 2016 at 6:15 pm
David Hall-426383 (3/22/2016)
_____________
Code for TallyGenerator
March 22, 2016 at 3:45 pm
Or - eliminate the variable @Result completely:
declare @List varchar(max) = '123456789'
declare @ChunkSize int = 3
declare @SepChar char(1) = ','
SELECT STUFF((
SELECT @SepChar + SUBSTRING(@List, N, @ChunkSize)
FROM dbo.Tally t
where
N >= 1...
_____________
Code for TallyGenerator
March 22, 2016 at 3:38 pm
kuopaz (3/22/2016)
declare @List varchar(max) = '123456789'
declare @ChunkSize int = 3
declare @SepChar char(1) =...
_____________
Code for TallyGenerator
March 22, 2016 at 3:29 pm
ColdCoffee (3/18/2016)
1. For every row in OrderDetails table with ActionCode not equal to 'V' , check the last...
_____________
Code for TallyGenerator
March 22, 2016 at 2:44 pm
This should be incredibly faster:
SELECT StatusName PNRStatus from dbo.Status S
WHERE EXISTS (SELECT * FROM [Transactions] T WHERE T.[PNRStatus]=S.StatusName)
ORDER BY PNRStatus
SELECT [AgentID] from dbo.Agent A
WHERE EXISTS (SELECT * FROM [Transactions]...
_____________
Code for TallyGenerator
March 22, 2016 at 2:25 pm
Luis Cazares (3/18/2016)
You'd be better by creating a table with a date column to identify each "file"
- and a clustered index with this column in the first position.
_____________
Code for TallyGenerator
March 21, 2016 at 8:06 pm
select
datepart(yyyy, D.Date)as "Year",
count(*)as "A",
sum(DV.PageCount)as "B"
FROM [DB].[dbo].[Test] D with (nolock)
INNER join (
SELECT TestumentID, TestumentVersionID, PageCount, ROW_NUMBER() OVER(PARTITION BY TestumentID ORDER BY [TestumentVersionID] DESC ) RN
FROM [DB].[dbo].[TestVersion]
) DV with (nolock) on...
_____________
Code for TallyGenerator
March 21, 2016 at 4:02 pm
INNER JOIN dbo.fnMyFunction('2016-3-21') F ON F.ColumnName = OtherTable.ColumnName
dbo.fnMyFunction must be a table function to be used in a JOIN.
_____________
Code for TallyGenerator
March 21, 2016 at 3:42 pm
Jeff Moden (3/18/2016)
Heh... maybe I should call up one of the old standards, document it, and call it "JMOD" for short. 😀
Plagiarist!!!
:w00t:
As for CHAR(0) - well, it's actually a character,...
_____________
Code for TallyGenerator
March 20, 2016 at 9:17 pm
ScottPletcher (3/17/2016)
_____________
Code for TallyGenerator
March 17, 2016 at 8:22 pm
TheSQLGuru (3/17/2016)
1) using a temp table (NOT table variable!!)
Not sure if there is much of a difference here.
Scoping - yes, quite different.
Can you name anything else?
_____________
Code for TallyGenerator
March 17, 2016 at 7:08 pm
Viewing 15 posts - 1,546 through 1,560 (of 6,036 total)