You must Sign In to post a response.
  • Category: SQL Server

    Increment the Column values dynamically

    Hi
    I have certain records in the table.In which i have to create one dynamic column by checking with row2 values of a particular column with row1 value of the same column,So if matched writes 1 otherwise 2...
    Ex:
    Identifier Name Serivice
    1 GPRS Imobile
    1 GPRS Mobile
    1 GPRS Application
    2 Internet Speed Connection


    In above example Identifier is dynamically created column,it will start with 1,then it compare the 2 column NAME GPRS=GPRS,so return 1,next is also same it returns 1,Next is also same,it returns same.But in 4 th row of the column differs Internet=GPRS,So mismatch occured,then identifier should be 2 like that we compare and increment the identifier column..Ho it is possible

    Regards
    Subash
  • #651935
    You can achieve this by writing stored procedures in sql server and with the help of that procedure you can add new column dynamically and fill the data based on your condition. And for writing the procedures in sql server you can need to do googling.


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.