Viewing 15 posts - 2,206 through 2,220 (of 6,036 total)
I assume, DealerCode belongs to table [dbo].[Sales].
SELECT [DealerCode]
,iis.[ForecastSegmentId]
,fs.ForecastSegmentId
,[Name]
FROM [dbo].[Sales] iis
RIGHT OUTER JOIN dbo.Forecast fs ON fs.ForecastId = iis.ForecastId and iis.dealercode = '11'
GROUP BY iis.DealerCode,iis.ForecastId,fs.ForecastId,Name
August 20, 2012 at 8:51 pm
CELKO (8/19/2012)
2. CONVERT() is an expensive string formatting function, with all those old Sybase options; substring and concatenation are cheap, simple and fast.
CREATE TABLE #TEMP (
[DATE] date
)
SET NOCOUNT ON...
August 20, 2012 at 5:11 pm
CELKO (8/18/2012)
CAST (SUBSTRING (IN_STR, 7, 4)+'-'+SUBSTRING (IN_STR, 3, 2))+'-'
+SUBSTRING (IN_STR, 1, 2)
AS DATE)
SET DATEFORMAT DMY
select CAST (SUBSTRING...
August 20, 2012 at 4:38 pm
pawan.boyina (8/18/2012)
If we need all the dates of a Year to be taken in that query, is it possible...
August 19, 2012 at 9:21 pm
Evil Kraig F (8/16/2012)
Why round trip to the data twice, Sergiy, when you've already got the answer from the subquery? That's non-optimal and more work, to boot. 😉
You...
August 16, 2012 at 8:27 pm
.........
create table #tmpGuarantor
(
ID int IDENTITY(1,1) PRIMARY KEY,
clientkey int,
GuarantorKey int
)
...........
update t1 set t1.GuarantorKey = t2.GuarantorKey
from #tmpTest t1
INNER JOIN (SELECT clientkey, MAX(id) AS lastID
FROM #tmpGuarantor
GROUP BY clientkey ) L ON...
August 16, 2012 at 5:37 pm
jshahan (8/16/2012)
Thanks, Craig. Actually, I wasn’t shooting for the highest value as much as expecting it because of the sequence in which I entered them.
Typically, entrings sequences are ruined...
August 16, 2012 at 5:15 pm
GilaMonster (8/16/2012)
The page was not marked as dirty, the update log record was not written when the update does not change the value of the row (as in the exact...
August 16, 2012 at 7:51 am
GilaMonster (8/16/2012)
They however are different binary values when stored in the data page.
Yep.
Exactly my point.
To find out the values are different SQL Server first needs to write a new...
August 16, 2012 at 7:45 am
GilaMonster (8/16/2012)
Paul showed that for a heap (the only case in discussion here), the page is not dirtied and the update log record not written
I just changed the table...
August 16, 2012 at 7:35 am
GilaMonster (8/16/2012)
I'm not going to be stupid enough to claim each and every case.
Yeah, but you're trying to play stupid by not understanding that we have only 2 cases in...
August 16, 2012 at 7:17 am
GilaMonster (8/16/2012)
Yes it does.
Every time?
The optimisation is going to be looking at the binary value of the column before after
Before and after WHAT?
While in case insensitive collation the...
August 16, 2012 at 6:03 am
2 indexes:
(id, company)
(id, district)
August 16, 2012 at 4:55 am
You miss the point.
Once again:
UPDATE test
SET name = 'Tom'
WHERE NAME = 'Tom'
Does this one writes into the page?
You say it does when the value in Name= 'TOM' and it...
August 16, 2012 at 4:29 am
vishnu 9013 (8/16/2012)
I have One table tbaleOneColumn1
-------------------------
AA,BB,CC
DD,EE,FF
GG,HH,II
I need out put
col1col2col2
---------------------------------------------------------
AABBCC
DDEEFF
GGHHII
You need such output where?
August 16, 2012 at 3:35 am
Viewing 15 posts - 2,206 through 2,220 (of 6,036 total)