locked
Are alter sql server stored procedure implement it or not ? RRS feed

  • Question

  • suppose I work on SQL server and alter stored procedure insert from 1 to 0000 on table 

    every time executed it delete table then create new table and insert into table from 1 to 10000

    so are alter procedure by modify something on procedure will implement it

    meaning it will insert from 1 to 0000 or not ?

    Thursday, August 13, 2020 12:36 AM

Answers

  • Hi engahmedbarbary,

    A stored procedure is a set of SQL statements to complete a specific function. It is stored in the database and is permanently valid after a compilation. Like other ordinary queries, there will be corresponding results unless the code is executed. If the code is not executed, nothing will change.

    If this doesn't answer your question,please share us  your table structure (CREATE TABLE …) and some sample data(INSERT INTO …)along with your expected result? So that we’ll get a right direction and make some test.


    Best Regards
    Echo



    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.


    • Edited by Echo Liuz Thursday, August 13, 2020 3:37 AM
    • Marked as answer by engahmedbarbary Thursday, August 13, 2020 7:43 AM
    Thursday, August 13, 2020 3:33 AM

All replies

  • Sorry, I can not understand what you're asking. If you alter a stored procedure, a new code is saved in the database. Unless you execute this SP, nothing is going to happen. When you execute the stored procedure, the code in it executes statement by statement depending on what do you have in it.

    Looking for new opportunities

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog


    My TechNet articles

    Thursday, August 13, 2020 12:53 AM
  • Hi engahmedbarbary,

    A stored procedure is a set of SQL statements to complete a specific function. It is stored in the database and is permanently valid after a compilation. Like other ordinary queries, there will be corresponding results unless the code is executed. If the code is not executed, nothing will change.

    If this doesn't answer your question,please share us  your table structure (CREATE TABLE …) and some sample data(INSERT INTO …)along with your expected result? So that we’ll get a right direction and make some test.


    Best Regards
    Echo



    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.


    • Edited by Echo Liuz Thursday, August 13, 2020 3:37 AM
    • Marked as answer by engahmedbarbary Thursday, August 13, 2020 7:43 AM
    Thursday, August 13, 2020 3:33 AM