Forum Replies Created

Viewing 15 posts - 2,071 through 2,085 (of 3,957 total)

  • RE: unique combination of concatenated columns

    A recursive CTE approach does appear to be the way to go for this. Perhaps this one is a little simpler to understand.

    DECLARE @table1 TABLE(component VARCHAR(10), bin INT, prd...

  • RE: unique combination of concatenated columns

    Sorry! Strike that. The solution I posted didn't work quite as advertised.

  • RE: Help on how to count guests in hotel every day

    CapnHector (1/28/2013)


    dwain.c (1/27/2013)


    I think you need a calendar table to do this:

    CREATE TABLE #Guests (checkin date, checkout date, FullName varchar(50))

    INSERT INTO #Guests

    SELECT '10/12/2012', '10/16/2012', 'Corky Doe' UNION ALL

    SELECT '12/12/2012', '12/17/2012',...

  • RE: Create string using input values

    Jeff Moden (1/28/2013)


    Just say "NO" to the mind drug known as "loops" in T-SQL. 😉

    I do!! 😀

  • RE: Nested replaces ?

    ChrisM@Work (1/28/2013)


    - however, I suspect that one of the posters on this thread may be intending to publish a few more performance comparisons. It wouldn't do you any harm to...

  • RE: Conversion

    Mvs2k11 (1/28/2013)


    How do i convert the below date from

    Mon Jan 28 11:03:06 EST 2013

    To

    2013-01-28 11:03:06

    Thanks for your help in advance

    If the string contains EST, does that mean other strings might...

  • RE: Join Values from 2 columns

    Hers's another way.

    declare @transactions as table (Receivers char(1), Payers char(1))

    insert into @transactions(Receivers, Payers)

    values('A' , 'A')

    ,('B' , 'A')

    ,('A' , 'B')

    ,('A' , 'D')

    ,('B' , 'D')

    ,('C' , 'A')

    ,('B' , 'E')

    ,('A' , 'E')

    SELECT RecPyr

    FROM...

  • RE: Create string using input values

    Steven,

    Not sure why you used all of those yukky loops (reference my mantra):

    IF OBJECT_ID('tempdb..#Years') IS NOT NULL

    DROP TABLE #Years

    --a table to hold the sample data

    CREATE TABLE #Years (

    ...

  • RE: Help on how to count guests in hotel every day

    I think you need a calendar table to do this:

    CREATE TABLE #Guests (checkin date, checkout date, FullName varchar(50))

    INSERT INTO #Guests

    SELECT '10/12/2012', '10/16/2012', 'Corky Doe' UNION ALL

    SELECT '12/12/2012', '12/17/2012', 'Janice Doe'...

  • RE: sql trigger problem

    wendy elizabeth (1/27/2013)


    The sql you gave me works correctly. I just submitted the query in a general query window. My problem is I do not know where the database trigger...

  • RE: Clock-In/ Clock-Out

    vinu512 (1/25/2013)


    I tried the query on random sample data consisting of 1164000 rows.

    Dwain, your query is the clear winner. Here are the results for all the three queries :...

  • RE: Table with month and year not sorted

    Eugene Elutin (1/24/2013)


    leesider (1/24/2013)


    Actually it's OK. The records go into the table in the proper order so when I do a simple select without an "order by" clause, they come...

  • RE: SQL Insert Trigger

    mike 57299 (1/24/2013)


    The plan is for a website to put in requests in the Queue table and SQL to handle the requests. The called SP would be something like...

  • RE: SQL Insert Trigger

    Since a trigger is just a special kind of SP, I believe you could.

    Better though if you kept the code in the trigger rather than reaching out to another one,...

  • RE: Combining query results from transaction table into blended results

    I am no oenophile but...

    Perhaps something like this will get you on track?

    ;WITH InBBLS AS (

    SELECT *

    ...

Viewing 15 posts - 2,071 through 2,085 (of 3,957 total)