Forum Replies Created

Viewing 15 posts - 2,311 through 2,325 (of 3,543 total)

  • RE: Counting a consecutive condition

    or this

    SELECT DISTINCT a.empId

    FROM [yourtable] a

    LEFT OUTER JOIN [yourtable] b ON b.empId = a.empId AND b.[date] = a.[date]+1 AND b.met =1

    LEFT OUTER JOIN [yourtable] c ON c.empId...

  • RE: Update Trigger

    Yes, the inserted table contains all the columns of the updated row, you can join to it like a normal table.

  • RE: HELP How can load a Dts saved like VB?

    You have to create a VB program (eg using Visual Studio), remove the default form created, add the vb file as a module, change some lines (can't remember which) to...

  • RE: Update Trigger

    The inserted table contains the rows updated, so

    CREATE TRIGGER tableA_update ON [server1].[dbo].[tableA]

    FOR UPDATE

    AS

    IF UPDATE(systemowner) OR UPDATE([systemuser])

        BEGIN

        BEGIN DISTRIBUTED TRANSACTION

        UPDATE [server2].dbo.tableB

        SET systemowner = inserted.systemowner

            [systemuser] = inserted.[systemuser]

       ...

  • RE: Need to append a character onto end of data in a column

    Also bear in mind that LEN ignores trailing spaces and if the column was padded with spaces then the concatenation may not work. This is probably not the case here...

  • RE: Identity function

    A possibility (if you have permission to run DBCC

    DECLARE @StartPoint bigint

    SET @StartPoint = 1001

    CREATE TABLE #Table (rowid bigint IDENTITY(1,1),field1 varchar(10))

    DBCC CHECKIDENT('#Table',RESEED,@StartPoint)

    INSERT INTO #Table (field1) VALUES ('Line...

  • RE: Setting date format

    Check the language setting of the login, it affects the way dates are converted.

  • RE: Update query

    UPDATE TableX

    SET ColumnB = SUBSTRING('EU',(ColumnA % 2)+1,1)

  • RE: easy syntax question

    SET IDENTITY_INSERT orig_table ON

    insert into orig_table

    (col1,col2,col3....)

    Select col1,col2,col3....

    from temp_table where VCRNMBR= '12345678'

    SET IDENTITY_INSERT orig_table OFF

  • RE: easy syntax question

    Try

    insert into orig_table Select * from temp_table where VCRNMBR= '12345678'

     

  • RE: SQL Server

    If you are transferring data then you probably use DTS (Data Transformation Services). DTS has an import/export data wizard and if you point it at the source table, it will...

  • RE: SQL Server

    quoteI was hoping I could pull off the data periodically but didn't think it could be done

    I...

  • RE: Congratulations Frank

    Well!! I would like to add my congrats as well Frank

    It definately could not happen to a nicer guy

  • RE: Parsing Data

    Try this

    if len(trim(right(sHold,2))) = 1 then

        'trim leading and trailing spaces form values

        sFirst = trim(mid(sHold,1,len(sHold)-2))

        sMiddleInit = trim(right(sHold,2))

    else

        iLoc = instr(1,sHold," ",0)

        if iLoc > 0 then

            'middle...

Viewing 15 posts - 2,311 through 2,325 (of 3,543 total)