Forum Replies Created

Viewing 15 posts - 3,196 through 3,210 (of 3,957 total)

  • RE: Find employee with overlapping shifts using cte recursive

    Curiosity got the best of me, so I decided to build a 1.2M row test harness to compare the 2:

    DECLARE @Shifts TABLE

    (emp_id varchar(7), start datetime, [end]...

  • RE: Find employee with overlapping shifts using cte recursive

    This may also work:

    DECLARE @Shifts TABLE

    (emp_id varchar(7), start datetime, [end] datetime)

    INSERT INTO @Shifts

    SELECT 'Dwain', '2012-07-08 08:00', '2012-07-08 17:00'

    UNION ALL SELECT 'Dwain', '2012-07-09 08:00', '2012-07-09 17:00'

    UNION ALL...

  • RE: Loop within a Loop

    SGT_squeequal (7/11/2012)


    at the moment i dont want to do anything after z27 however, i may then want to re loop it through a second loop to start at AA1 through...

  • RE: Assign Claims Sequencial Number

    I don't know much about SSIS but if you're inserting into a table, use an IDENTITY column to generate a unique number.

  • RE: Validation methods?

    Let me take your questions one at a time.

    1. In your experiences, when you get the results of a query, how and who determines if the results are correct?

    This will...

  • RE: Aggregate Query question

    Les Cardwell (7/11/2012)


    Ha! I'm glad I could send you on such an adventure 🙂

    I'll run both for time comparisons this weekend when there's not much activity on this server (this...

  • RE: Aggregate Query question

    How does generating all possible optimal solutions in under 6 minutes grab ya?

    Attached is a write up on the solution including everything you need to run it yourself. I...

  • RE: Aggregate Query question

    Les Cardwell (7/10/2012)


    I haven't had a chance to come up for air to review the latest, but only 8 unique triplets? I get 162...

    I did try to use the CTE...

  • RE: T SQL Unpivot with Financial Period Calculation

    Hey Garry! Sorry for my late reply but I thought I'd suggest an arguably more readable and succinct approach that works in SQL 2008 (using CROSS APPLY VALUES instead...

  • RE: Displaying '-' when value does not exist

    You'll find a lot more people willing to help you if you post some DDL and sample data in readily consumable format (many regular posters have links in their signatures...

  • RE: Aggregate Query question

    Eureka! I have just hit upon a method that generates "hundreds" of triplet combinations that can be combined 11 at a time to cover all the districts included in...

  • RE: Is INTERSECTS the best method to accomplish this?

    Try it with a million invoices (3M detail rows):

    CREATE TABLE #OrdLine([OrdNo] [int] NULL,[ItemNo] [varchar](50) NULL) ON [PRIMARY]

    ;WITH Tally (n) AS (

    SELECT TOP 1000000 ROW_NUMBER() OVER (ORDER BY (SELECT NULL))

    FROM...

  • RE: Is INTERSECTS the best method to accomplish this?

    Without some DDL and sample data I can't post a tested solution but something like this may work (INTERSECT the way you've written it should except you misspelled the keyword):

    Select...

  • RE: Get List of week numbers between the given date range

    ramsai1973 (7/8/2012)


    I've finally sorted it out by writing the stored procedure as given below:

    BEGIN

    -- SET NOCOUNT ON added to prevent extra result sets from

    -- interfering with SELECT statements.

    SET NOCOUNT ON;

    DECLARE...

  • RE: Aggregate Query question

    OK. It's time for a checkpoint, if for no other reason that to get straight in my head what I've been doing.

    First, I needed to convince myself of something...

Viewing 15 posts - 3,196 through 3,210 (of 3,957 total)