Forum Replies Created

Viewing 11 posts - 91 through 101 (of 101 total)

  • RE: Insert data in rows after a select

    hi!

    to any other noobs around here...the solution.:-D :

    update dbo.analisis

    set idegrupoana = '10'

    where (matid = 'am') and (tipaid = 'mt')and(idegrupoana is NULL)and

    (anadesc like '%disuelto%')

    it worked like a...

  • RE: Insert data in rows after a select

    benyos (9/9/2009)


    i want to insert new records that correspond to specific criteria.

    That means:

    1. You are inserting new records

    2. You specify values for the new records so they match certain...

  • RE: Insert data in rows after a select

    benyos (9/9/2009)


    Not sure what you're trying to do here...

    You have an "insert...values..." command and then "select...where..."

    What are you trying to achieve? Do you mean to update records that correspond...

  • RE: Insert data in rows after a select

    benyos (9/9/2009)


    Assuming your target table is called TargetTable, your code should look something like this:

    INSERT TargetTable (anadesc,idenvaseana,idegrupoana,matid,tipaid)

    select anadesc,idenvaseana,idegrupoana,matid,tipaid

    from dbo.analisis

    where (anadesc like '%disuelto%') and (matid = 'am') and (tipaid =...

  • RE: distinct use

    Dave Ballantyne (9/7/2009)


    This link discusses your options

    http://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/

    Feel free to post again with any further questions

    thanks.

    i will read it.

  • RE: distinct use

    Dave Ballantyne (9/7/2009)


    OK....

    Take For instance

    1 2 3

    -----------------

    15 5280 96828810

    16 5280 96828810

    What output are you expecting

    96828810 15,16

    96828810 15

    96828810 ...

  • RE: distinct use

    Dave Ballantyne (9/7/2009)


    Here's a simple distinct example..

    create table x

    (

    x1 integer,

    x2 integer

    )

    go

    insert into x

    select 1,0

    union all

    select 1,0

    go

    select * from x

    go

    select distinct x1,x2 from x

    Im not sure im clear on your requirements...

  • RE: Another trigger problem!

    thanks for the help guys.

    Now another thing...

    the triggers does what is supposed to...but one of the rows is PK, so the trigger cant insert the data from inserted in...

  • RE: Another trigger problem!

    thanks!! i corrected it, it didnt work also...it i´m gonna do it all over again.

  • RE: Another trigger problem!

    it says syntax error.

    create trigger one on dbo.pedidos

    after insert as

    begin

    set nocount on;

    INSERT INTO dbo.pedidos(PedNum,ESTID)

    select(inserted.PedNum,'2')

    from inserted

    end

    dont know what i´m missing.

  • RE: help with after update Trigger

    GSquared (8/31/2009)


    If I understand you correctly, you want to check if there are two rows in the inserted table that have a specific value in one column. Is that...

Viewing 11 posts - 91 through 101 (of 101 total)