Basic Stored Procedure doubt

  • Hi,

    I was creating a stored procedure. Inside my stored procedure, I have statements like Truncate, Update, Update etc. the sequence is as follows

    create procedure temp as

    truncate table temp1

    GO

    insert into temp1.....

    GO

    update temp1....

    GO

    if I write the above code inside stored procedure, it is checking the first go statement and creating the stored procedure until that statement. How could I make a stored procedure do

    first truncate table

    then insert

    then update

    Thanks,

    Sridhar!!

  • Just take the go statements out.

    Tom

  • If i take out the go statements will they be executed serially or parallely. I mean first I need to truncate the table and after it is done, i need to insert into it.

    Thanks,

    Sridhar!!

  • They will be nicely executed one after the other.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Thanks for the reply.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply