Viewing 15 posts - 6,046 through 6,060 (of 7,608 total)
To return a single "OR'd" row, I think you can just add MAX()es to the "standard" & conditions:
SELECT
STUFF(
MAX(CASE...
June 3, 2014 at 10:23 am
I think the overhead of XML is unwarranted here, if I understand the desired output correctly. needed[/i].]
But,...
May 30, 2014 at 3:48 pm
Not 100% sure what output you want: the warranty date in a separate column based on its status or a status column itself, like below.
SELECT
machNameTab.machName
,warranty
,CASE WHEN warranty...
May 30, 2014 at 11:28 am
If you're saying all the tables already have the correct clustered indexes, as I noted in my previous post, I don't agree with that for at least:
dbo.DCSubRegionTran
This isn't something where...
May 30, 2014 at 11:16 am
First, as always, verify that you have the best clustered index on each table.
For example, just from a very quick look, table:
dbo.DCSubRegionTran
should have:
DCSRFiscYear
as its first clustering column, assuming you (nearly)...
May 30, 2014 at 10:17 am
I'd urge you to add a bit flag to the PROD table to indicate whether a given row has 7 consecutive valid flow values or not, rather than recomputing every...
May 28, 2014 at 2:23 pm
SELECT
ISNULL(sales.ItemCode, returns.ItemCode) AS ItemCode,
ISNULL(sales.total_sales, 0) - ISNULL(returns.total_returns, 0) AS NetSales
FROM (
SELECT T0.ItemCode, SUM(T0.LineTotal) as total_sales
...
May 27, 2014 at 11:55 am
sirishgreen (5/23/2014)
I took your advice:these dates result in an error:
@dtStart='20140418',@dtEnd='20140418'
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
Thanks
Simon
Then the error must be...
May 23, 2014 at 8:55 am
Just in general, if you (almost) always query table* "v0_AccountSecuritiesBASEL_III" by DataDate, then you should strongly consider clustering the table on that date first, rather than on -- my best...
May 22, 2014 at 3:31 pm
Instead of changing the code like that, just remove the UPDATE STATS statement entirely. You shouldn't be doing that all throughout code anyway.
May 22, 2014 at 1:44 pm
jmoorhead14 (5/22/2014)
DECLARE @spid int
SELECT
@spid = MIN(l.request_session_id)
FROM
sys.dm_tran_locks l
INNER JOIN sys.dm_tran_active_transactions t...
May 22, 2014 at 1:39 pm
If you're on Enterprise Edition you can add "ONLINE = ON" and the table can still be used while the index is being built.
I prefer to always explicitly specify the...
May 22, 2014 at 11:15 am
Sample data in a consumable format would be most helpful.
An example of what I am trying to get.
guid, 2014-05-10 01:04, 2014-05-10 01:14
I'm pretty sure my query gives you that. ...
May 22, 2014 at 10:11 am
Hmm, I expected my code to give you that.
Can the same guid appear more than once??
May 21, 2014 at 8:02 am
Instead of disabling the trigger, which would affect all row updates, of course, you might want to consider using CONTEXT_INFO() to selectively bypass trigger processing just for your updates.
For example:
CREATE...
May 20, 2014 at 1:33 pm
Viewing 15 posts - 6,046 through 6,060 (of 7,608 total)