background: We recently upgraded to handle UTC. ie., went thru each sp and func and changed the t-sql code to handle utc. For eg., changed getdate() to getutcdate() etc. For new shipments we are good where the db is blank. For our older customers who want to keep their data we need to run a script that will update all the dates to utc. I am about to code in t-sql something like below and want to know if this is best way. Below is pseudo code. thanks
foreach (table in mydb.tables())
{
foreach (column col in table)
{
if (col.type == datetime)
{
update table set col = fn_convert_date_to_utc(col)
}
}
}