Forum Replies Created

Viewing 15 posts - 1,636 through 1,650 (of 2,007 total)

  • RE: Need help on SQL statement

    miss.delinda (5/23/2011)


    My mistake. My table as following,

    declare @tMenuCollection table(idx int,parentID int,menuNme varchar(50),navigateUrl varchar(50));

    insert into @tMenuCollection values(1,0,'Bayar Zakat','void(0)');

    insert into @tMenuCollection values(2,0,'Amil','void(0)');

    insert into @tMenuCollection values(3,0,'Kira Zakat & Simpan','void(0)');

    insert into @tMenuCollection values(4,3,'Tambah','void(0)');

    insert into...

  • RE: Need help on SQL statement

    WayneS (5/23/2011)


    How does this work out? Check out this BOL link for how it this recursive common-table-expression works.

    I can't get your solution to work Wayne (which is irritating because mine...

  • RE: Using count and group by with multiple fields

    Please read this link[/url] for how to best get answers to your questions.

    If you set-up and post create table scripts plus sample data and expected results then you'll get back...

  • RE: Goruping records with 1 to many relationship

    Plenty of different ways to do that. Here's two: -

    --CTE Option

    ;WITH CTE AS (

    SELECT CartesisRU, CartesisBU, HFMEntity, WBU,

    ROW_NUMBER() OVER(partition by CartesisRU, CartesisBU ORDER BY CartesisRU, CartesisBU) AS rn

    FROM #Cartesis_to_hfm)

    SELECT b.CartesisRU,...

  • RE: Transaction Log Woes

    Ninja's_RGR'us (5/19/2011)


    Time to track the guilty party! 😉

    Not too difficult - there are two of us that work on the database servers and it wasn't me. . . 😀

  • RE: Transaction Log Woes

    We've solved our issue, it was a D'OH moment 😉

    Basically, the code I posted above is an older version of what had been deployed to the server (must've been changed...

  • RE: Transaction Log Woes

    Ninja's_RGR'us (5/19/2011)


    When the backup is taken, the space is marked available for reuse. so the log doesn't need to grow.

    You can schedule it more than once... maybe every...

  • RE: Transaction Log Woes

    Ninja's_RGR'us (5/19/2011)


    Run the log backups every 10 minutes (maybe even less).

    I'm not sure that would solve the issue I'm having (I'm not saying it won't, just that I'm confused as...

  • RE: How to find max value in which column

    ;WITH highest_attendance AS (

    SELECT subject, attendance,

    ROW_NUMBER() OVER (ORDER BY attendance DESC) AS rn

    FROM (SELECT 'math' AS subject, COUNT(math) AS attendance

    FROM results

    ...

  • RE: How to find max value in which column

    What sort of result are you after?

    SELECT attendedMath, attendedPhysics, attendedChemistry

    FROM (SELECT COUNT(math) AS attendedMath

    FROM results

    WHERE math <> 0)...

  • RE: Join a table to itself for update - help please!

    Ninja's_RGR'us (5/18/2011)


    Still don't need the nolock there. The update is done and you'll be able to read from the table.

    Had you written that the first time I wouldn't have...

  • RE: Join a table to itself for update - help please!

    Ninja's_RGR'us (5/18/2011)


    Just the heads up. NEVER EVER use nolock unless you're prepared to get crap data (not enough or too much of the valid data). Nolock is not...

  • RE: T SQL Problem

    ashok.faridabad1984 (5/18/2011)


    🙁 Hi, my problem is simple, if you go through my replies, i hope you got the problem and now..

    logic to obtain the result is if the attrib is...

  • RE: Conditional SQL Version check

    I think I'd go for two stored-procedure.

    In your roll-out script, create the 2000 code in a stored-procedure if 2000 is detected. Then execute the 2000 stored-procedure that does your index...

  • RE: T SQL Problem

    --Sample data--

    DECLARE @TABLE AS TABLE(id INT, attrib INT, begda VARCHAR(10), endda VARCHAR(10))

    INSERT INTO @TABLE

    SELECT 1, 100, '3/10/2010', '3/31/2010'

    UNION ALL SELECT 1, 100, '4/1/2010', '4/10/2010'

    UNION ALL SELECT 1, 2, '4/11/2010', '5/15/2010'

    UNION...

Viewing 15 posts - 1,636 through 1,650 (of 2,007 total)