Forum Replies Created

Viewing 15 posts - 541 through 555 (of 1,229 total)

  • RE: Restart Counting with Row_Number()

    SQL Kiwi (1/26/2012)


    ChrisM@home (1/26/2012)


    Heh Paul that's too funny!

    I thought the same thing! We must have been working on the opposite solutions at the same time. I must confess...

  • RE: Restart Counting with Row_Number()

    Heh Paul that's too funny!

  • RE: Restart Counting with Row_Number()

    Much better sample set, thanks:

    ;WITH GroupedData AS (

    SELECT mid, datum, id_status,

    GroupID = ROW_NUMBER() OVER (PARTITION BY mid ORDER BY datum, id_status) -

    DENSE_RANK() OVER (PARTITION BY mid, id_status ORDER BY...

  • RE: Restart Counting with Row_Number()

    ;WITH phs_termine AS (

    SELECT mid = 47,datum = '2006-07-13',id_termine_status = 9 UNION ALL

    SELECT 47,'2006-07-19',1 UNION ALL

    SELECT 47,'2006-09-18',1 UNION ALL

    SELECT 47,'2006-09-19',1 UNION ALL

    SELECT 47,'2006-09-21',1 UNION ALL...

  • RE: cte delete operation

    kirkdm01 (1/24/2012)


    I have a cte that loops through the records creates a list and i pass a parameter of @ParamterID in a select statement ...

    Check that your rCTE works before...

  • RE: alternative to cte

    kirkdm01 (1/24/2012)


    how do you create an index on ParentPostID im new to SQL so im just learning. What do i do

    What's your working environment, Kirk? Are you on your own/do...

  • RE: need help with a script

    -- use a more appropriate value for the size of @log_file_path:

    SET @log_file_full_path [NVARCHAR(255)]

    = @log_file_path [VARCHAR(512)]

    + @database_name [VARCHAR(32)]

    + @cnv_extension [VARCHAR(4)]

    + @ldf_extension [VARCHAR(4)]

  • RE: Almost a Delimited Split kind of Join?

    Hi Lowell

    This seems to work - at least, the logic is correct according to my interpretation of your requirements. If you add a nonsense character to one of the user's...

  • RE: alternative to cte

    kirkdm01 (1/23/2012)


    I was wondering if someone here knew how to write another select statement that wasn't a cte. This displays a list of posts in their heirarchy. Does anyone else...

  • RE: Help me: Many Tables to join.

    DBA Rafi (1/23/2012)


    The Plan I posted is from my QA database.

    Hi Rafi

    This is the estimated plan, can you post the actual plan please?

    Cheers

    ChrisM

  • RE: Three table query problem in stored procedure

    See also 'SET QUOTED_IDENTIFIER (Transact-SQL)' in Books Online, the help system for SQL Server. Double quotes have a special meaning in SQL Server (by default).

  • RE: Comparing data row by row....

    Here's some results of testing the usual method against a rCTE

    Tests were performed against a million rows, consisting of a frame of 50 seed rows repeated with non-overlapping dates.

    With...

  • RE: Aggregate Query

    Mark-101232 (1/23/2012)


    DECLARE @t TABLE(DateValue datetime,Value int)

    INSERT INTO @t(DateValue,Value)

    SELECT '20120102',0 UNION ALL

    SELECT '20120103',1 UNION ALL

    SELECT '20120104',1 UNION ALL

    SELECT '20120105',1 UNION ALL

    SELECT '20120106',1 UNION ALL

    SELECT '20120107',1 UNION ALL

    SELECT '20120108',0 UNION ALL

    SELECT '20120109',1...

  • RE: Aggregate Query

    drop table #testvalue

    create table #testvalue (datevalue datetime,value int)

    insert into #testvalue (datevalue, value) VALUES

    ('2012-01-02', 0),

    ('2012-01-03', 1), -- MIN

    ('2012-01-04', 1),

    ('2012-01-05', 1),

    ('2012-01-06', 1),

    ('2012-01-07', 1), -- MAX

    ('2012-01-08', 0),

    ('2012-01-09', 1),

    ('2012-01-10', 1),

    ('2012-01-11', 0),

    ('2012-01-12', 1), -- MIN

    ('2012-01-13',...

  • RE: procedure cache hit ratio too high?

    ananda.murugesan (1/23/2012)


    ...7. procedure cache Hit ratio - 90% to 95%

    Procedure Cache Hit Ratio

    Percentage of time when SQL Server looks for an execution plan in the procedure cache and finds...

Viewing 15 posts - 541 through 555 (of 1,229 total)