Forum Replies Created

Viewing 15 posts - 31 through 45 (of 122 total)

  • RE: How to update column value

    I would like to change this code little more.

    Can we write a select query there to fetch value replacing @const1 ?

    something like this ..

    INSERT INTO PRIOR_DIST (_ID, COSTS_DST, IS_ACTIVE)

    SELECT

    ...

  • RE: How to update column value

    thats an impressive code !

    You are the SQL God.

    Thanks for the quick post.

  • RE: How to update column value

    Thank you.

    I wish to add one condition in my code i.e a zero value checking .

    like this ...

    if(@const1!=0)

    INSERT INTO PRIOR_DIST (_ID, COSTS_DST, IS_ACTIVE)

    SELECT

    @_id,

    COSTS_DST*@const1/@const2,

    'Y'

    FROM PRIOR_DIST

    WHERE _ID = @id_prev;

    else

    INSERT INTO PRIOR_DIST...

  • RE: How to update column value

    DesNorton (1/5/2017)


    INSERT INTO PRIOR_DIST (_ID, COSTS_DST, IS_ACTIVE)

    SELECT

    @_id,

    COSTS_DST*@const1/@const2,

    'Y'

    FROM PRIOR_DIST

    WHERE _ID = @id_prev;

    Thanks for the code. I have understood this part.

    Is it possible to round the result upto 10 decimal...

  • RE: Data update

    ChrisM@Work (12/13/2016)


    spectra (12/13/2016)


    I would like to upgrade this query a bit ...

    CREATE TABLE #John (j datetime)

    INSERT INTO #John VALUES ('2016-11-10 12:12:42.100')

    SELECT j FROM #John

    WHERE j BETWEEN '20161201' and '20161213'...

  • RE: Data update

    I would like to upgrade this query a bit ...

    CREATE TABLE #John (j datetime)

    INSERT INTO #John VALUES ('2016-11-10 12:12:42.100')

    SELECT j FROM #John

    WHERE j BETWEEN '20161201' and '20161213'

    If I...

  • RE: Data update

    my mistake.... its working..

  • RE: Data update

    <scrapped>

  • RE: Data update

    John Mitchell-245523 (12/13/2016)


    CREATE TABLE #John (j datetime)

    INSERT INTO #John VALUES ('2016-11-10 12:12:42.100')

    SELECT j FROM #John

    WHERE j BETWEEN '20161201' and '20161213'

    [font="Courier New"](0 row(s) affected)[/font]

    John

    Tested .... but its not working...

  • RE: Data update

    John Mitchell-245523 (12/13/2016)


    WHERE UPDATED_DATE BETWEEN '20161201' and '20161213'

    Bear in mind that this won't capture anything that happened on 13th, unless it happened at midnight (20161213 00:00:00). If you...

  • RE: Data update

    John Mitchell-245523 (12/13/2016)


    What data type is the UPDATED_DATE column?

    John

    datetime

  • RE: Print file names

    Thank you guys

  • RE: I'm scared to delete log file

    I have run that query ...and I checked those files are not present in the returned physical path result.

    seems ...I can safely delete those files.

  • RE: How do I initialise a sql variable to 0 in stored-procedure ?

    Thanks for the post

  • RE: SQL Server 2008 Task generate script

    >>>you could write your own query to return an INSERT statement for whatever table name you choose.

    Could not get it. are you saying not to use generate script

Viewing 15 posts - 31 through 45 (of 122 total)