Forum Replies Created

Viewing 15 posts - 661 through 675 (of 2,007 total)

  • RE: How to check if a comma seperated column contains the desired word

    Are you attempting to join your two tables based on the comma deliminated list in "component" and the "process" ?

    If so, something like this might help: -

    SELECT *

    FROM #dailytable daily

    INNER...

  • RE: difference between last(max) and penultimate(max-1) for each group

    dwain.c (5/21/2012)


    Lot's of JOINs and APPLYs in the house.

    I'd do it with a subquery because it looks easier on the eyes.

    DECLARE @t TABLE (Col1 char(1), Col2 int )

    Insert Into...

  • RE: difference between last(max) and penultimate(max-1) for each group

    vinu512 (5/21/2012)


    Sorry, I was a little busy the other day. I tried this the first thing I came to work today. Its a little complex, still didn't have much time....

  • RE: QUERY

    Based on your sample data (listed below for other people's convenience), what is your expected outcome?

    SELECT Entry_id, Eventy_type_id, Event_value, Event_datetime, username

    INTO #yourSampleData1

    FROM (VALUES(1,6,'pending','05/17/2012 23:30','ABC'),

    ...

  • RE: Use your own optimizer to tune your queries

    I wish you'd posted this this in the scripts area so it could be voted upon. . .

  • RE: SQL Query help

    vickys (5/16/2012)


    Hi Cadavre

    Thanks for this, it seems like I am going somewhere now with this way.. and yes it is not simple to use pivot with this.. btw I think...

  • RE: SQL Query help

    Hmmm, it's not quite as simple as a pivot I think.

    Try this: -

    SELECT [PatientID], [PatientName], [Time1] AS [Time], [Measurementtype=1Value], [Time2] AS [Time],

    [Measurementtype=2Value], [Time3] AS [Time], [Measurementtype=3Value], [Time4] AS [Time],

    [Measurementtype=4Value]

    FROM...

  • RE: Converting first letter of every word to uppercase

    --edit-- Fixed a bug 😛


    Here's my shot at a non-CLR version: -

    DECLARE @Table TABLE (iD INT, AttrVal1 VARCHAR(100));

    INSERT INTO @Table

    SELECT...

  • RE: RegEx for DBAs

    Thanks for the explanation Solomon, I haven't forgotten but I'm quite busy at the moment. I intend to attempt to convert your more complicated RegEx into T-SQL, but I...

  • RE: inserting rows into table using stored procedure

    mmurawski (5/15/2012)


    Hi Cadavre,

    The following select statement returns over 3000 rows:

    SELECT EMPL_UNO, MONTH, PERIOD, BILLABLE_HRS, NONBILL_HRS, ACCOUNTABLE_HRS,

    BILLABLE_AMT, NONBILL_AMT, ACCOUNTABLE_AMT, RECEIPT_AMT, LAST_MODIFIED

    FROM _TBM_Persnl_Bud_Update

    I'm really not certain why they used a Cursor...

  • RE: SQL Pivot Tables

    Without seeing at the very least DDL for the structure of the tables (and if you want to be given a coded example then sample data and expected results) it's...

  • RE: inserting rows into table using stored procedure

    First things first, how many rows does this return?

    SELECT EMPL_UNO, MONTH, PERIOD, BILLABLE_HRS, NONBILL_HRS, ACCOUNTABLE_HRS,

    BILLABLE_AMT, NONBILL_AMT, ACCOUNTABLE_AMT, RECEIPT_AMT, LAST_MODIFIED

    FROM _TBM_Persnl_Bud_Update;

    If it's 0, then that's your problem as it is...

  • RE: Table that has all the dates from 2000 till today

    Eugene Elutin (5/10/2012)


    Sorry Cadavre, I need to correct the comments for my code.

    What have I changed? :

    1. I do place comma into start of line - it helps when...

  • RE: Table that has all the dates from 2000 till today

    patelronaks1983 (5/9/2012)


    hi SSCommitted.

    I am new in SQL server. i am not much familiar with code. can u explain me the code please ?

    Thanks,

    Ronak

    "SSCommitted" is a title, not a username....

  • RE: RegEx for DBAs

    Solomon Rutzky (5/9/2012)


    Thank you for doing that test (really). I simply don't have the time these days and it is good to see solid numbers. For this particular example I...

Viewing 15 posts - 661 through 675 (of 2,007 total)