Forum Replies Created

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

  • 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...

  • RE: Asterix in Database Diagram

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

  • 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...

  • RE: SELECT Help

    OK if we're playing at guessing the query

    I got out my ouija board and got this

  • 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...

  • RE: Joins

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

    WOW! I surpassed even myself

  • 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

  • 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])...

  • 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...

  • RE: Joins

    quoteIn order to bring back one contact only, use a max() function on the highest value you want...
  • 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....

  • 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

    --...

  • 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...

  • 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.

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

    OK try this, may work better as no conversion to datetime required

    SELECT

    CAST(TS_TIME_ASSIGNED / 86400 as varchar) + ' days ' +

    CAST((TS_TIME_ASSIGNED % 86400) / 3600 as varchar) +...

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