troubleshooting Question

SQL Syntax

Avatar of mounty95
mounty95Flag for United States of America asked on
Microsoft SQL ServerMicrosoft SQL Server 2008
11 Comments1 Solution223 ViewsLast Modified:
I have an insert statement that inserts values from an Excel spreadsheet:

insert into table (number)
values ("$Excel Column(1)$")

I would like to format the data from the spreadsheet to have leading zeros and following zeros (if that is the correct term) so that a value in the spreadsheet that appears as 2.02 would be stored in the number field as 02.020.  The data field is specified as nvarchar so that it can hold the numbers and the period.  I tried to format the column of cells in Excel but the formatting did not hold on the insert.  The format (number,00.000) does not work in the SQL code.

Not sure what to do.
Sr. System Analyst

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros