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.
| Author |
Topic |
|
adeola
Starting Member
3 Posts |
Posted - 2005-09-17 : 19:06:41
|
| hi all, i have a vb script that writes from a ms access database file into my sql database.there is a particular number field that is critical to the whole download.the first number starts from zero(0).during this transfer sql server removes the first zero leaving the remaining numbers.i need to write a batch file or anything to update this record in sql so that the zeros (0) are put back where they belong.could someone help out. |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-09-18 : 02:39:50
|
| "there is a particular number field"What is the datatype of this field in SQL Server?Provided the datatype is a VARCHAR, and not an INT or NUMERIC of some sort, SQL Server will leave it alone.If its is already a varchar then I expect that something else [in VB or between VB and SQL Server] is stripping the leading zerosKristen |
 |
|
|
adeola
Starting Member
3 Posts |
Posted - 2005-09-23 : 00:57:55
|
| how can i make the entry in the column to be updated automatically by running a script to update this.presently i do it manually by going to query analyser to update using the set . |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-23 : 01:03:14
|
| Do you want to set 0 in front of that number?If so, why?MadhivananFailing to plan is Planning to fail |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-09-23 : 01:16:28
|
what do you mean? can you clarify?quote: Originally posted by adeola how can i make the entry in the column to be updated automatically by running a script to update this.presently i do it manually by going to query analyser to update using the set .
--------------------keeping it simple... |
 |
|
|
adeola
Starting Member
3 Posts |
Posted - 2005-09-30 : 07:11:16
|
| I have a report that checks the custcode column .if the value of the custcode column does not correspond to what it ought to be, there would not be any report to be generated.i have an access datafile that sends this information into the sql server and whenever it does this the leading zeros are out of the data send into the custcode.it means i have to manually put the zero's back myself so that the report can be generated.This manual entry is what i dont enjoy .i am looking for a batch file that i can schedule to run automatically at least once a day to do this act of manually updating the field in the custcode column. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-30 : 07:16:03
|
| If the custcode column is of varchar datatype then use thisUpdate yourTable set custcode ='0'+custcodeMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|