I have to copy from SQL Server Management Studio often. Many of our ID column fields are filled with numbers but have the data type varchar. When copying output from SSMS to Excel MSOffice determines the column is a number and consequently strips the prepended zeroes from the number. If I convert the column back to "text" under "Format cells," the 0 is lost.
How can I keep the zeroes?
Answer
Use the Data tab and import directly from the SQL Server. This will maintain the field types as you import and refresh the data.

No comments:
Post a Comment