Forum Replies Created

Viewing 15 posts - 6,751 through 6,765 (of 10,144 total)

  • RE: nothing returning for date

    spin (8/16/2011)


    wow. a little more complicated than i'd expected. trying to get my head around this now. i'll let you know if it works out. thanks.

    It doesn't need to be...

  • RE: Using Identity Field as my main relation in joins

    sammuts (8/16/2011)


    Hi,

    In all my tables my first field is an Identity field which is set as my primary key. Is it a good practice to use this fied...

  • RE: Inserting summarized data

    troe_atl (8/15/2011)


    Hi everyone.

    I have a store procedure that has a summary query that return 4 rows but only inserts 2 rows into my table. Please take a look at the...

  • RE: how to find the difference between current column and previous column

    Here's another method which is 3x faster than OVER()

    SELECT a.PlayerId, a.PlayerName, a.overs, a.PlayerScore - ISNULL(b.PlayerScore, 0) AS Score

    FROM #score a

    CROSS APPLY(SELECT [LastRow] = MAX(overs) FROM #score WHERE PlayerName = a.PlayerName...

  • RE: how to find the difference between current column and previous column

    Prasanthi Reddy (8/16/2011)


    This gives complete score in 1st over also in 2nd over. I want the score only in 2nd over.

    i.e., difference between 2nd over and 1st over's score.

    Also i...

  • RE: how to find the difference between current column and previous column

    SELECT a.*, b.*

    FROM score a

    INNER JOIN score b ON b.PlayerName = a.PlayerName AND b.overs = 2

    WHERE a.overs = 1

  • RE: problem on @@ROWCOUNT

    @@ROWCOUNT will be the number of rows updated. Bear in mind that a row may be updated only once. Your findings indicate that for some rows of your target table,...

  • RE: problem on @@ROWCOUNT

    peleg (8/15/2011)


    first one

    Is your rowcount equal to the result of this query?

    SELECT COUNT(*)

    FROM TargetTable_Staging tts

    WHERE EXISTS (SELECT 1

    FROM TargetTable t1

    INNER JOIN Dyn_Company t2

    ON t1.Company=t2.Name COLLATE SQL_Latin1_General_CP1_CI_AS...

  • RE: Today's Random Word!

    crookj (8/12/2011)


    SQLRNNR (8/12/2011)


    Revenant (8/12/2011)


    SQLRNNR (8/12/2011)


    Strengthed

    Conan

    Barbarian

    Red Sonja

    Coincidence (Red Sonja was on UK terrestrial tv last night - I'd forgotton how cr@p it was - even more so after 300)

  • RE: problem on @@ROWCOUNT

    -- run this

    SELECT COUNT(*)

    from TargetTable_Staging tts

    inner join (

    select t1.id as PKid,t2.id as IndexId

    FROM TargetTable t1 inner join Dyn_Company t2 (NOLOCK)

    ON t1.Company=t2.Name COLLATE SQL_Latin1_General_CP1_CI_AS )t3 on tts.id=t3.PKid

    -- and this

    select...

  • RE: Count across multiple tables with left outer join

    Kiara (8/15/2011)


    ...Now I'm curious, though, so once I get back to the actual problem this is related to, I'll post a version of what actually works best in the environment...

  • RE: nothing returning for date

    SELECT

    [DAY number 1] = 01/01/2004, -- result is integer 0

    [DAY number 2] = 31/12/2004, -- result is integer 0

    [Date 1] = CAST(01/01/2004 AS DATETIME), --...

  • RE: Count across multiple tables with left outer join

    Kiara (8/15/2011)


    ...Caveat: I haven't played with this approach against my actual data, so I don't know what the performance will look like yet...

    Have a look at the actual execution plans...

  • RE: To improve the performance of the query.

    LutzM (8/11/2011)


    Wouldn't the WHERE clause be equal to

    WHERE

    fbt.cust_no != '0306A'

    OR channel_cd in ('Correspond','Correspondent','Retail','Wholesale','IGNORE CHANNEL') ? :unsure:

    Yes, and if there's an index on channel_cd, then your version would of...

  • RE: SQL Agent - TSQL Step Text Size

    Put the TSQL into a stored procedure and call the sproc from the job.

Viewing 15 posts - 6,751 through 6,765 (of 10,144 total)