Forum Replies Created

Viewing 15 posts - 1 through 15 (of 130 total)

  • RE: scripting in table

    ok

    i tried this one

    CREATE TABLE [dbo].[emp_new](

    [empid] [int] NULL,

    [primary1] [varchar](20) NULL,

    [primaryinten1] [int] NULL,

    [secondary2] [varchar](20) NULL,

    [secondaryinten2] [int] NULL,

    [secondary3] [varchar](20) NULL,

    [secondaryinten3] [int] NULL,

    [secondary4] [varchar](20) NULL,

    [secondaryinten4] [int] NULL)

    empidprimary1primaryinten1secondary2secondaryinten2secondary3secondaryinten3secondary4secondaryinten4

    1HF1NULLNULLNULLNULLNULLNULLNULLNULL

    1NULLNULLCAD1NULLNULLNULLNULLNULLNULL

    1NULLNULLCADO1NULLNULLNULLNULLNULLNULL

    1NULLNULLMAN1NULLNULLNULLNULLNULLNULL

    1NULLNULLMANt1NULLNULLNULLNULLNULLNULL

    now i tried

    --select * from emp_new

    ----drop...

  • RE: scripting in table

    i am not finding a solution,please help me hwo to do it

  • RE: scripting in table

    the thing is i cannot use aggregate function in PIVOT , as i need to place character in the column

  • RE: while loop

    here @min-2 + @interval should not be > @end

    how will i make sure that

  • RE: update records based on condition

    no there is no more rule, but if you execute is second time it moves everything to scondition

    and also there may be duplicate values

  • RE: update records based on condition

    IF YOU EXECUTING IT SECOND TIME it moves all the values to scondition

    also if there is duplicate example

    id pcondition scondition

    1 sa ...

  • RE: update records based on condition

    this code is not working

    it snot necessary that all 5 condition will exists for that particular ID, there can be 3 or 4 ,not all 5

    in that case it has...

  • RE: update records based on condition

    u r updating cte i need to update customecode table

  • RE: update records based on condition

    but i dont need select ,i just need update statement, the store proc should not have select

  • RE: update records based on condition

    HERE YOU GO

    CREATE TABLE CustomCode

    (ID int,

    pcondition varchar(50),

    Pinten int,

    scondition varchar(50),

    sinten int)

    INSERT into CustomCode

    SELECT 1,'HF',1,NULL,NULL

    UNION

    SELECT 1,'CA',1,NULL,NULL

    UNION

    SELECT 1,'AF',1,NULL,NULL

    UNION

    SELECT 2,'CAD',2,null,NULL

    UNION

    SELECT 2,'AST',2,null,null

    UNION

    SELECT 3,'CA',1,NULL,NULL

    UNION

    SELECT 4,NULL,NULL,'HF',1

    Order to Update :

    If ID has more than...

  • RE: update records based on condition

    i am trying to explain it here

    example:

    ID pcondition scondition

    1 HF ...

  • RE: update records based on condition

    i used row_number ,but how to get multiple condition in update

    for example if condition = 'HF'

    then update

    else if condition ='AST'

    then update

  • RE: update records based on condition

    but i need loop or condtion hwo to do it

    example if primarycondition = 'HF'

    then update table a

    set secondary condtion = null

    if there is no primary condition = 'HF'

    then

    if primarycondition =...

  • RE: update records based on condition

    thisis not the result that i want

    i have five PRIMARY condition ,

    hf,

    COPD,

    CAD,

    dia,

    ast

    primary intensity could be 1,2, 3

    now i want to check suppose if i have all 5 condition...

  • RE: update records based on condition

    my desire out put will be

    Member primarycondition primaryintensity secondarycondition secondaryIntensity

    M2345 hf ...

Viewing 15 posts - 1 through 15 (of 130 total)