ANNOYED: SSMS messes with formatted scripts

  • I don't know if I am missing a setting or what the deal is but it is getting annoying.

    Example...I take a script that has some defined formatting with embedded TAB's

    CREATE TABLE DB_UTILS.dbo.tb_FileListOnly_MetaData

    (

    DBName NVARCHAR(128),

    LogicalName NVARCHAR(128) NULL, -- Logical name of the file

    PhysicalName NVARCHAR(260) NULL, -- Physical or operating-system name of the file

    Type CHAR(1) NULL, -- Data file (D) or a log file (L)

    FileGroupName NVARCHAR(128) NULL, -- Name of the filegroup that contains the file

    Size NUMERIC(20,0) NULL, -- Current size in bytes /** 1 mb = bytes 1048576 **/

    MaxSize NUMERIC(20,0) NULL -- Maximum allowed size in bytes

    )

    And when you cut and paste that into the query window of SSMS 2005 you get this

    CREATE TABLE DB_UTILS.dbo.tb_FileListOnly_MetaData

    (

    DBNameNVARCHAR(128),

    LogicalName NVARCHAR(128) NULL, -- Logical name of the file

    PhysicalName NVARCHAR(260) NULL, -- Physical or operating-system name of the file

    Type CHAR(1) NULL, -- Data file (D) or a log file (L)

    FileGroupName NVARCHAR(128) NULL, -- Name of the filegroup that contains the file

    Size NUMERIC(20,0)NULL, -- Current size in bytes /** 1 mb = bytes 1048576 **/

    MaxSize NUMERIC(20,0) NULL -- Maximum allowed size in bytes

    )

    Am I missing something obvious to get SSMS 2005 to keep the default formatting of text and not mess it all up?

    Thanks in advance,

    Lee

  • Different people may use different settings for tabs. I set up SSMS to replace tabs with spaces which eliminates this as an issue with my formatted scripts.

  • Lynn Pettis (11/21/2008)


    Different people may use different settings for tabs. I set up SSMS to replace tabs with spaces which eliminates this as an issue with my formatted scripts.

    SO I took notice to this in Q.A. in 2000 which is where I had originally created most of my scripts...which were formatted with the default settings regarding tabs / spaces...

    I use Textpad to edit most of the scripts...so I made sure that all the settings were the same across SSMS2005, Q.A. and Textpad and after I "re-saved" my scripts in textpad with the correct format settings the scripts displayed correctly in SSMS and kept the default formatting.

    Thanks a million for the hints!

    Lee

  • Here is a tool that I like to use to help with formatting. It seems to copy and paste ok into SSMS. I don't always like the output, but it does pretty good.

    http://www.sqlinform.com/

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

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