0

I create a stored procedure like this in ssms:

USE [UnitTest] GO /****** Object: StoredProcedure [dbo].[ProcedureName] Script Date: 2017-09-18 15:30:44 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[ProcedureName] @p1 INT=0, @p2 INT=0 AS BEGIN SET NOCOUNT ON; SELECT @p1, @p2; END GO 

but when I save the stored procedure and reopen it, automatically ssms changes the format like this:

USE [UnitTest] GO /****** Object: StoredProcedure [dbo].[ProcedureName] Script Date: 2017-09-18 15:29:28 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[ProcedureName] @p1 INT=0, @p2 INT=0 AS BEGIN SET NOCOUNT ON; SELECT @p1, @p2; END GO 

how can I disable this feature?

3
  • 2
    Unable to reproduce. Whether I choose "modify" or "script", SSMS preserves the format exactly. (Which is to be expected, because stored procedures are stored as-is in the system catalogs, unlike, say, tables.) How are you "reopening" it? How are you saving it? Are you sure this isn't something else reformatting the procedure? (Along with the usual silly stuff like "are you sure you're in the right database"?) Commented Sep 18, 2017 at 11:12
  • 1
    Could you have third-party scripts hidden somewhere. Do you have any database triggers? Have a look in Server Objects > Triggers. Commented Sep 18, 2017 at 11:24
  • 1
    thank you dear @JeroenMostert. i remove all the extensions. i just create a new stored procedure and execute it. then when i reopen it, code changes. just it. Commented Sep 18, 2017 at 11:41

1 Answer 1

1

in Sql Management Studio to disable SQL autoformat when typing brackets:

Go To menu Tools --> Options --> Text Editor --> Transact SQL --> General and disable the checkbox AutoList Members

Im this menu you can find similar action sthat may solve your specific question

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.