Viewing 15 posts - 4,066 through 4,080 (of 10,144 total)
busraker (8/28/2013)
August 29, 2013 at 1:21 am
Grant Fritchey (8/28/2013)
Koen Verbeeck (8/28/2013)
JLMayes (8/28/2013)
TravisDBA (8/28/2013)
August 29, 2013 at 1:11 am
TheSQLGuru (8/28/2013)
...general best practice in any case) is to ALWAYS use aliases for EVERYTHING...
And again, just in case it was missed the first time around.
August 29, 2013 at 1:03 am
Can you post the actual execution plan, Kevin? As a .sqlplan attachment. It's the source of information for anyone wanting to optimise a query. There are plenty of folks around...
August 29, 2013 at 12:59 am
SQL Server is turning the OJ into an IJ because of the inner-joined "trail". You can get around it by changing the position of the ON clauses like this:
SELECT P.policy_internal_id,
RTRIM(P.contract_main_id)
+...
August 28, 2013 at 9:35 am
shafibinyunus (8/28/2013)
Try this..Declare @EndDate varchar(25)
select @EndDate =CONVERT(varchar,(convert(varchar(10), getdate(), 101) + ' ' + CAST(DATEPART(hh,getdate()) AS VARCHAR) +':'+ CAST(DATEPART(mi,getdate()) as VARCHAR) +':'+ CAST(DATEPART(ss,getdate()) AS VARCHAR)+CAST(DATEPART(ss,getdate()) AS VARCHAR)),109 )
print @EndDate
This returns incorrect...
August 28, 2013 at 8:42 am
It's to support correlated subqueries like this:
select *
from test1 t1
where t1.firstname1 in (select t2.firstname2 from test2 t2 where t2.firstname2 = t1.firstname1)
and is equivalent to this:
select *
from test1...
August 28, 2013 at 8:17 am
Write a SELECT statement joining the two tables which outputs the PK of the table you want to update, the existing domain value, and the value you want to change...
August 28, 2013 at 5:18 am
Revolting and unacceptable. But what has been done? What message will be sent out to this and other groups if nothing is done?
August 28, 2013 at 5:13 am
Not bad at all, busraker. Here's a slight mod which I think is a little easier to figure out, but the logic I think is the same as yours:
;WITH CountedData...
August 28, 2013 at 4:17 am
Here's another way:
SELECT p.ProductID, MAX(x.OrderList)
FROM @OrderDetail p
CROSS APPLY (
SELECT STUFF(
(SELECT ',' + CAST(o.OrderID AS varchar(5))
FROM @OrderDetail o
WHERE o.ProductID = p.ProductID
ORDER BY o.OrderID
FOR XML PATH(''))
, 1, 1, ' ')...
August 28, 2013 at 1:56 am
John's correct, here's another way:
SELECT
col1 = MIN(CASE WHEN t.value = x.min_value THEN value ELSE NULL END),
col2 = MIN(CASE WHEN t.value = x.min_value THEN t_stamp ELSE NULL END),
col3...
August 28, 2013 at 1:28 am
You haven't explained any rules for the assignment of 'flavour'. Will a guess be sufficient?
August 28, 2013 at 1:18 am
T.Ashish (8/27/2013)
Thanks again for your help.
I could not see any performance difference with/without function. I have pasted the function for you. Meanwhile I'm looking into third point you suggested.
CREATE...
August 28, 2013 at 1:10 am
A few comments.
1. This personalisation:
on wo . bu_id = bu . bu_id
with unnecessary spaces either side of object delimiters, makes the code irritating to read and will put folks...
August 27, 2013 at 7:26 am
Viewing 15 posts - 4,066 through 4,080 (of 10,144 total)