Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Varchar Loosing Leading Zeros

Author  Topic 

Callaway
Starting Member

16 Posts

Posted - 2006-07-01 : 16:25:17
I'm using varchar as a datatype and my leading zeros are chopped-off once ther data reaches my Stored Proc. The table will allow me to store the values with leading zeros if I enter them manually, but I cannot insert them via ASP/StoredProc.

Any ideas would be awesome.

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2006-07-01 : 16:56:40
>>but I cannot insert them via ASP/StoredProc.

What datatype is the parameter in your stored procedure? Should be varchar() if that's what the column's datatype is.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-07-02 : 07:13:59
Make sure that your ASP is presenting it as a string, and that the string is quoted (if you are using dynamic SQL)

... otherwise it will not be arriving at the SProc as a string!

Kristen
Go to Top of Page
   

- Advertisement -