SQL Server Performance

problem with comments using sql server studio 2005

Discussion in 'SQL Server 2005 General Developer Questions' started by Wendy elizabeth, Aug 5, 2007.

  1. Wendy elizabeth New Member

    > Is it possible that
    > the WHERE Clause
    > ''where customer_number is null''
    > is not satisfied,,, and the id was not updated ,,,, and the id Happened
    to
    > be 12345????
    >
    >
    > On 8/4/07, wendyelizabeth via sql-server-l wrote:
    > >
    > >
    > >
    > > Andrew J. Kelly:
    > >
    > > I do not get an error message, the lines that are commented out are
    > > executed.
    > >
    > > For example I have the following code:
    > >
    > > Update trans
    > > set id = 1
    > > where
    > > customer_number is null
    > >
    > > -- Update trans
    > > -- set id = 12345
    > > -- where
    > > -- customer_number is null
    > >
    > > After the sql statements are executed, the value for id = 12345.
    > > Thus the lines of commented code are executed. They should not be.
    > > The T-SQL experienced people at my company, noticed this problem on my
    > > workstation before I did. They said the did not know what to do.
    > >
    > >
    > > I can do the following: /* and */ and this area is commented out.
    > >
    > > Can you explain why the commented out code is executed?
  2. satya Moderator

    Even I have tried and commented code is not executed, what edition of SQL you are running?

Share This Page