Viewing 15 posts - 751 through 765 (of 1,228 total)
It works, but the day of week and time calculations don't have to be run multiple times. Apply is handy for this sort of thing:
SELECT
d.aRow,
d.aDate,
x.[Dayname],
x.TheTime,
Weekend = CASE...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 19, 2011 at 6:24 am
pespes009 (12/19/2011)
I think the problem is with the join on the
JOIN VR_DataLoad.prdrmkt.dbo.tbl_asset_instance ai
not that at all
Please...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 19, 2011 at 3:34 am
You will need to work outside of the stored procedure, checking each query separately, in order to get this working. Can you do this? Here's the first part. You don't...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 19, 2011 at 3:23 am
pespes009 (12/19/2011)
Which column please highlight ...Many thanks
The one which is referred to in the second query:
isNull(#a.DisposalType, '''') AS DisposalRoute,
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 19, 2011 at 3:11 am
The second column here isn't named:
INSERT #a
SELECT
currA.numAsset_instance_id,
CASE WHEN isnull(vcca.numAsset_instance_id, 0) > 0 THEN ''Retail''
WHEN isnull(vcaa.numAsset_instance_id, 0) > 0 THEN ''Auction''
ELSE ''Unassigned''
END
FROM VR_DataLoad.prdrmkt.dbo.v_current_asset_instance currA
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 19, 2011 at 2:50 am
CASE resolves a value or column:
SELECT aValue = CASE WHEN 1 = 1 THEN 10 ELSE 20 END
Your query fails because CASE is resolving a statement.
Try this:
;WITH MyTable AS (SELECT...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 19, 2011 at 2:37 am
pespes009 (12/19/2011)
When i run this stored proc it falls over with the multi-part idenfier.......
Easy to check if this is the case
SELECT TOP 10 * FROM VR_DataLoad.prdrmkt.dbo.v_current_asset_instance
SELECT TOP 10 *...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 19, 2011 at 2:19 am
Hi Sami
Can you change your data samples to DDL please? CTREATE TABLE and INSERTs. If you're not sure how to do it, read the link in my sig (please read...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 19, 2011 at 1:52 am
Please don't cross post, it fragments replies and wastes time.
Replies to http://www.sqlservercentral.com/Forums/FindPost1223667.aspx
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 19, 2011 at 1:45 am
Hi
Can you set up your sample data for easy consumption, like this:
CREATE TABLE #Sampledata (LEVEL1 datatype, LEVEL2 datatype, LEVEL3 datatype, LEVEL datatype, ID datatype, datatype, DESC datatype, CUSTNO datatype,...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 19, 2011 at 1:40 am
John Mitchell-245523 (12/16/2011)
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 16, 2011 at 5:10 am
GSquared (12/15/2011)
It does use SMTP. But so does Database Mail. SMTP is simply the mail transfer method ("Simple Mail Transfer Protocol"...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 15, 2011 at 3:45 pm
GilaMonster (12/14/2011)
btw, if I've understood you properly
DELETE FROM ContactGroupMember
WHERE NOT EXISTS (SELECT 1 FROM #FinalResults AS FR WHERE ContactGroupMember.ContactGroupId = FR.ContactGroupID AND ContactGroupMember.ContactId = fr.OwnerID)
This will generate different results to...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 15, 2011 at 5:08 am
Folks may be a little reluctant to help with this because it looks - forgive me if I'm wrong - as if someone fairly new to TSQL has gone a...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 14, 2011 at 11:25 am
Can you post the code in the stored procedure?
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
December 14, 2011 at 10:58 am
Viewing 15 posts - 751 through 765 (of 1,228 total)