Hi Everyone,
We have a database that has numbers and we want to CONVERT all the numbers
to 0. How would we go about writing a script that can do such a thing.
Thanks in advance for everyones help.
Jay :)If you actually want to change the values stored in the database, use an
UPDATE statement
Check it out in The Books OnLIne or in any SQL book...
"James Mueller" wrote:
> Hi Everyone,
> We have a database that has numbers and we want to CONVERT all the numbers
> to 0. How would we go about writing a script that can do such a thing.
> Thanks in advance for everyones help.
> Jay :)|||More info needed.
Do you want to change all numeric data type columns from all tables to 0?
If so:
See INFORMATION_SCHEMA.COLUMNS
which returns information about each column
including tableName, columnName and column type.
A cursor, some dynamic SQL and you're done.
"James Mueller" <JamesMueller@.discussions.microsoft.com> wrote in message
news:AD68E5C6-8CEC-4BAD-AD66-850E3C8DC1DD@.microsoft.com...
> Hi Everyone,
> We have a database that has numbers and we want to CONVERT all the numbers
> to 0. How would we go about writing a script that can do such a thing.
> Thanks in advance for everyones help.
> Jay :)|||Yes we had various values ranging from 1 - 65,000. We needed to setup each
one back to 0. We used CBretana's advice and used the UPDATE function. Thi
s
will work for us because we only need to change it one time and that is when
the database and tables are initially created.
Thanks for everyones help.
Newbie (Jay)
"Raymond D'Anjou" wrote:
> More info needed.
> Do you want to change all numeric data type columns from all tables to 0?
> If so:
> See INFORMATION_SCHEMA.COLUMNS
> which returns information about each column
> including tableName, columnName and column type.
> A cursor, some dynamic SQL and you're done.
> "James Mueller" <JamesMueller@.discussions.microsoft.com> wrote in message
> news:AD68E5C6-8CEC-4BAD-AD66-850E3C8DC1DD@.microsoft.com...
>
>
No comments:
Post a Comment