0

Scenario: In production we have the same functional DB at different physical sites. The column order on a table don't match each other so I am writing a script to amend this (a 3rd party application requirement).

Action: To do this I copied the table to a test server, made the changes required in the GUI and then used the save to script functionality. The generated script essentially creates a new table with the proper order, copies the data into there, deletes the original table and then renames the new table to the old/proper name.

Query: The generated table definition includes in part column definitions such as:

STAGE3 float(53) NULL

Using the more common Script Table as> Create to new query window the same column is generated as:

[STAGE3] [float] NULL

1) Why is there a difference?

2) Does it matter?

Environment:
Server SQL2000
SSMS 2008, Script for server version set to SQL Server 2000
Production destinations SQL2000, SQL2008, SQL2008R2

4

1. Why is there a difference?

Simply because different code within SSMS generates the script differently. The SSMS GUI is well-known for being inconsistent (and broken in places). It's quite likely the features were just implemented by different developers or teams.

A more definitive answer would involve call to Microsoft Support.

2. Does it matter?

No, it doesn't matter.

SSMS added square brackets around the column and table names, so the script will work in cases where users named tables or columns using, for example, reserved keywords or spaces.

The result is semantically identical albeit inconsistent. SQL Server Books Online states the default float precision is 53:

float and real (Transact-SQL)

From that link:

float [ ( n ) ]

Where n is the number of bits that are used to store the mantissa of the float number in scientific notation and, therefore, dictates the precision and storage size. If n is specified, it must be a value between 1 and 53. The default value of n is 53.

| improve this answer | |
  • Thank you Paul for the edit and making the answer look like best – TheGameiswar Mar 14 '16 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.