Forum Replies Created

Viewing 15 posts - 2,206 through 2,220 (of 6,036 total)

  • RE: Cannot get Left JOIN to work correctly

    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

  • RE: Convert Text to Date DataType

    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...

  • RE: Convert Text to Date DataType

    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...

  • RE: Varchar Exceeding 8000 characters

    pawan.boyina (8/18/2012)


    If we take a subset of dates then the same is working

    If we need all the dates of a Year to be taken in that query, is it possible...

  • RE: Why doesn’t the last record win?

    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...

  • RE: Why doesn’t the last record win?

    .........

    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...

  • RE: Why doesn’t the last record win?

    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...

  • RE: UPDATE when the values are the same

    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...

  • RE: UPDATE when the values are the same

    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...

  • RE: UPDATE when the values are the same

    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...

  • RE: UPDATE when the values are the same

    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...

  • RE: UPDATE when the values are the same

    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...

  • RE: any ideas on how to spead up this query?

    2 indexes:

    (id, company)

    (id, district)

  • RE: UPDATE when the values are the same

    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...

  • RE: comma separate value show as table

    vishnu 9013 (8/16/2012)


    I have One table tbaleOne

    Column1

    -------------------------

    AA,BB,CC

    DD,EE,FF

    GG,HH,II

    I need out put

    col1col2col2

    ---------------------------------------------------------

    AABBCC

    DDEEFF

    GGHHII

    You need such output where?

Viewing 15 posts - 2,206 through 2,220 (of 6,036 total)