Hi
I am importing data into a column and want to change all the values to read
in percentages i.e. 15 should become 0.15
How do I do this during an import? or how do I update the column afterwards?How are you performing the import? If you use DTS you should be able to
enter the expression in the source query of a Transform Data task.
The UPDATE is straightforward:
UPDATE YourTable SET col = col / 100
David Portas
SQL Server MVP
--|||Hi,
At the time of import data from table ,divide by that column with 100 and
then import the value,I think this will solve your problem.
for ex:
select price/100 as 'price' from titles
Regards
Arindam
"Jaco Wessels" wrote:
> Hi
> I am importing data into a column and want to change all the values to rea
d
> in percentages i.e. 15 should become 0.15
> How do I do this during an import? or how do I update the column afterward
s?
>
>|||use * .01 rather than /100 just in case you have a zero entry which may caus
e
a divide by zero error.
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Build, Comparison and Synchronization from Source Control = Database change
management for SQL Server
"Jaco Wessels" wrote:
> Hi
> I am importing data into a column and want to change all the values to rea
d
> in percentages i.e. 15 should become 0.15
> How do I do this during an import? or how do I update the column afterward
s?
>
>
No comments:
Post a Comment