Forum Replies Created

Viewing 15 posts - 10,096 through 10,110 (of 15,381 total)

  • RE: Top 20 count

    Wow that table needs some help. If at all possible you should consider changing that table. You should be storing datetime data in datetime instead of breaking apart all the...

  • RE: SQL 2008 Query Help

    The problem you are facing is known as "gaps and islands". In your case you are specifically looking for gaps. If you search this site you will find several articles...

  • RE: substring

    Luis Cazares (11/8/2012)


    A simple improvement on Sean solution.

    ;with SampleData (val) as

    (

    select '51079-216-20' union all

    select '3456-435623-45-34'

    )

    SELECT REPLACE( LEFT( val, LEN( val) - 2), '-', '')

    FROM SampleData

    Luis that will work with two...

  • RE: trigger

    I will assume you didn't actually run these inserts. It is chock full of syntax errors. The dates don't have quotes around them and there appear to be lots of...

  • RE: Call a URL and pass a parameter in the URL (http post)

    LOL Lowell you really pulled out all the stops with your T-SQL hammer on this one!!! Talk about brute force. I don't remember the link to the hammer on your...

  • RE: substring

    Like this?

    ;with SampleData (val) as

    (

    select '51079-216-20' union all

    select '3456-435623-45-34'

    )

    select left(replace(val, '-', ''), LEN(replace(val, '-', '')) - 2)

    from SampleData

    Please take note of how I posted sample data to make it easy...

  • RE: speed up deleting million of records from a table with one filter

    If you want to prevent locking your table for an extended period of time you can do this in batches.

    --This will ensure that the value of @@ROWCOUNT for the...

  • RE: How to write Update query for this scenario

    kak.mca (11/8/2012)


    RowIdENameProjectTime partHours

    Worked[14 Jan][15 Jan][16 Jan]

    1Emp 1Project 114/1/20107.0

    2Emp 2Project 215/1/20108.0

    3Emp 1Project 116/1/20108.0

    From the above table:

    The above table is showing like

    Emp 1 has worked for 7.0 hours on Project 1 on...

  • RE: Call a URL and pass a parameter in the URL (http post)

    I would not do this in sql. This sounds like you need a simple program to do this. If I had this assignment I would generate a .net windows service...

  • RE: Nanoseconds

    (Bob Brown) (11/8/2012)


    This is absolutely the worse question I have encountered on QotD. Think I will pass on future Tom questions.

    If this is the worst QotD you...

  • RE: Need to search an array list through a text column with wildcards.

    huestetwins (11/7/2012)


    Sean,

    Thank you so so much, after tweaking it a bit, it works perfectly in our procedure. My developer is over the moon happy.

    And the function is...

  • RE: Need to search an array list through a text column with wildcards.

    OK I used your #mytable as the basis for this. I removed the identity from ID so the inserts would work. 😉

    CREATE TABLE #mytable

    (

    ID INT PRIMARY KEY CLUSTERED,

    summarytext varchar(max),

    billid int,

    );

    INSERT...

  • RE: Need to search an array list through a text column with wildcards.

    huestetwins (11/7/2012)


    Thank you so much.

    I'm reading the article and realize this is something that can help in our environment. I created the function and ran the query...

  • RE: Generating percentage for each month in SP

    sa06rdy (11/7/2012)


    Hi,

    EDD script gives the Distinct Admission numbers from the admissions table from apr2012 to current which are satisfying the conditions given.

    TEP gives the total Patients from apr2012 to...

  • RE: Need converting a table to XML

    Thanks for the ddl. Can you post at least a couple of rows of sample data, it does not need to be real data assuming it might be sensitive. Just...

Viewing 15 posts - 10,096 through 10,110 (of 15,381 total)