Forum Replies Created

Viewing 15 posts - 8,776 through 8,790 (of 10,144 total)

  • RE: how can i update multiple columns in one statement

    You can only update one table in an UPDATE statement, but the answer to your question is yes -

    EXEC my_stored_procedure_which_updates_800_tables

  • RE: Are the posted questions getting worse?

    Lynn Pettis (2/19/2009)


    First, I don't claim to know everything about SQL, but I do feel that I know a little about most of it (Jack of all trades, master of...

  • RE: Distinct going slower than *

    1. What happens when you compare like with like?

    -- Keeping dupes:

    SELECT t.EMP_ID, t.EMPLOYEE_NAME

    FROM dbo.IREP_V_DAILY_COUNTS_TERRITORY t

    WHERE t.EMP_ID IS NOT NULL

    AND t.WORK_DATE BETWEEN '01/01/2009' AND '01/31/2009'

    ORDER BY t.EMPLOYEE_NAME

    --...

  • RE: To find max length of datatype

    Looks like Ramesh has this sussed, but what do you get for this, as a matter of interest (I don't have 2k5 to play with right now)...

    DECLARE @MyEnormousBelly VARCHAR(max)

    SET @MyEnormousBelly...

  • RE: Writing out a one column result set as a concatenated string

    Sure...read this[/url] and this[/url].

    These two articles will show you exactly how it's done and you will almost certainly learn other useful tricks along the way.

  • RE: NOT EXISTS vs NOT IN

    If you post the sproc, Karthik, there's a chance that someone might figure out why it takes so long to run...

  • RE: NOT EXISTS vs NOT IN

    karthikeyan (2/17/2009)


    Thanks Chris and sqlmaster!

    I am facing a starnge problem while executing the below query. if i execute it seperate it took just 1 second to complete the execution. If...

  • RE: Removing all charachters after the last '.'

    -- If the number of dots is never greater than 3, then this will work:

    DECLARE @String varchar(20)

    SET @String = '123.45.678.90'

    SELECT REPLACE(@String+'~', PARSENAME(@String+'~',1), '')

    Result:

    123.45.678.

  • RE: Help creating SQL query

    DROP TABLE #TableA

    CREATE TABLE #TableA (Item INT, Value VARCHAR(1))

    INSERT INTO #TableA (Item, Value)

    SELECT 1, 'A' UNION ALL

    SELECT 1, 'A' UNION ALL

    SELECT 1, 'B' UNION ALL

    SELECT 2, 'A' UNION ALL

    SELECT 2,...

  • RE: Correlated Sub Query (RBAR WTF?)

    What's the result of running the highlighted part?

    select A.fldA, A.fldB from tableA A where A.fldKey IN

    (

    select AA.fldKey from tableA AA inner join tableB B ON

    AA.fldKey =...

  • RE: Correlated Sub Query (RBAR WTF?)

    You don't need tableA bulking up the two subselects:

    select A.fldA, A.fldB

    from tableA A

    where A.fldKey IN

    (

    select B.fldKey

    from tableB B

    inner join tableC C ON B.fldChild =...

  • RE: Best way to calculate duration from 1 table?

    Here's the old-fashioned way:

    DROP TABLE #Table

    CREATE TABLE #Table (ObjectID INT, ObjectStateID INT, [DateTime] DATETIME)

    INSERT INTO #Table (ObjectID, ObjectStateID, [DateTime])

    SELECT 1, 1, '2009-02-17 12:10:47.000' UNION ALL -- waiting

    SELECT 1, 2, '2009-02-17...

  • RE: query to get results from 4 tables

    shiva (2/17/2009)


    i want shiftcode's of 100 to 103 users between give dates

    how to get

    plzz help me....

    The shiftcode of user 100 is s1, and of user 103 is s2.

    Without knowing what...

  • RE: NOT EXISTS vs NOT IN

    LEFT JOIN:

    SELECT f.sec_id, f.symbol

    FROM fund f

    LEFT JOIN exception e ON e.symbol = f.symbol AND err_cd IN (20,30)

    WHERE e.symbol IS NULL

  • RE: NOT EXISTS vs NOT IN

    Karthik, please can you post your queries for

    NOT IN & NOT EXISTS to do this,but it leads to performance isssue.

    Cheers

    ChrisM

Viewing 15 posts - 8,776 through 8,790 (of 10,144 total)