Forum Replies Created

Viewing 15 posts - 2,026 through 2,040 (of 3,544 total)

  • RE: Select & Sort - Stumped

    SELECT Employee, [DateTime], Status

    FROM @table a

    WHERE NOT EXISTS(SELECT * FROM @table b

    WHERE b.Employee = a.Employee

    AND b.[DateTime] = a.[DateTime]-1

    AND b.Status = a.Status)

    ORDER BY Employee, [DateTime]...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: UPDATETEXT error

    First insert_offset is zero based

    Second your patindex will only find occurrance if the column ends with 123456789123456789

    Try this

    WHILE 1=1

    BEGIN

      SELECT @ptrval_s = TEXTPTR(Text_Column),

        @patptr=PATINDEX('%123456789123456789%',Text_Column)-1

        FROM #MyTable  where...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Asterix in Database Diagram

    It means the table has been altered in the diagram but the diagram has not been saved.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: how to update a column with various numeric records

    If the 'column' may or may not contain spaces then this should work

    SET column = LEFT(REPLACE(column,' ',''),9)

    When you state this would 'violate the primary key constraint' then any modification of...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SELECT Help

    OK if we're playing at guessing the query

    I got out my ouija board and got this

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Need help with Workweek Day setup to THursday midnight of each week.

    Not sure what you are asking for but

    WHERE trandate < @ENDDATE

    seems right as long as @ENDDATE is set correctly

    So, today is Thursday 22 Dec, midnight tonight would be

    '2005-12-23 00:00:00.000'

    Therefore this...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Joins

    quoteYou are actually using T2.firstname+T2.surname+T2.email as a unique id

    WOW! I surpassed even myself

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Problem selecting records of a type in a group using a max()

    quoteI enjoyed the "urn" joke!

    and what's a "grecian" "urn"

    a damn sight more than me

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Joins

    OK first off the top of my head and providing there are no duplicate contacts!

    SELECT T1.*,T2.*

    FROM T1

    INNER JOIN (SELECT a.[id],MIN(a.firstname+a.surname+a.email) AS FROM T2 a GROUP BY a.[id])...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Insert into table variable with a select with variables

    As stated in the link you will not be able to replace your temp table with a table variable and even if you could I doubt there would be any...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Joins

    quoteIn order to bring back one contact only, use a max() function on the highest value you want...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: display row number of import file in error message

    Yep, if you put a valid path to a filename in the 'Output File' field then all the output of the DTSrun will be in that file including any errors....

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Seconds to dd:hh:mm:ss

    Don't need to use a cursor

    CREATE FUNCTION fn_GetDays(@Secs As int)

    RETURNS varchar(36) AS

    BEGIN

    DECLARE @GetDays varchar(36)

    -- Get the Days, Hours, Minutes, Seconds returned with input in Seconds

    --...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Creating update query

    I think this is what you mean

    UPDATE h

    SET h.codsuc = 'AT'

    FROM ventven h

    INNER JOIN (SELECT l.nofact

    FROM vligven l

    WHERE l.codart IN ('TOT PPO01Z', 'TOT PPO000Z')

    GROUP...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Return Values and Stored Procedures

    Also remember that non fatal errors will not stop/abort a proc unless you set XACT_ABORT otherwise you will have to trap non fatal errors after each statement.

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 2,026 through 2,040 (of 3,544 total)