• boobalanmca07 (11/27/2012)


    without remove alter statement , how to solve the problem.

    because two sql statement in one stored procedure,

    It's a very bad idea of making such stored procedure!

    You should not mix one-off schema alteration with common data maintenance.

    Schema alterations should be performed as a separate database change exercise!

    No DBA (in any serious organisation) would allow your proc to exist.

    To "fix" this you need to completely remove ALTER TABLE out of this proc and execute it once in a controlled change-release manner.

    Technically speaking, it is possible to leave both statements in, however I'm refusing to show you how it can be done, as it would constitute really very bad design and code.

    You may find some less perfectionists around who will not refuse to help you with this...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]