Tech Off Thread

1 post

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Bug: Microsoft SQL Server Management Studio

Back to Forum: Tech Off
  • User profile image
    MegaMan

    Hi everybody,

    While working on Microsoft SQL Server Management Studio, I have found a bug.

    how I got the bug:

       1. I created a stored procedure as follows:
          
             

    CREATE PROCEDURE [dbo].[usp_INS_tblName]

    @pkColumn VARCHAR(10) ,

    @AnotherColumn VARCHAR(500) = @pkColumn

    AS

    SET NOCOUNT ON;

    INSERT INTO tblName(pkColumn, AnotherColumn)

    VALUES(@pkColumn, @AnotherColumn)

    --Return Rows Affected

    RETURN @@ROWCOUNT


    ----------------------------------------------------

    in the line " @AnotherColumn VARCHAR(500) = @pkColumn ", I meant that if there is no data for the other column, then the data in the pkColumn is copied into this column.

        2. I right clicked on the stored procedure in Management Studio, then i clicked on Modify, then I got the following message:

          Syntax error in TextHeader of StoredProcedure 'usp_INS_tblName'. (Microsoft.SqlServer.Smo)


    I can still open this SP in visual studio and I can execute it from Management Studio.

    to get this message disappear, I had to change the line to: "  @AnotherColumn VARCHAR(500) = ''  "

    when I execute this SP, then it works properly and does what i exactly want, which means that there is no syntax error as the error message says.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.