Hi, I have the following sql query for transforming data but is it possible to save the value of the int in some variable to avoid casting multiple times?
update prospekts set sni_kod = case
when
cast(sni_kod as int) >= 1000 and cast(sni_kod as int) <= 1499
or cast(sni_kod as int) >= 1600 and cast(sni_kod as int) <= 2439
then '1'
when
cast(sni_kod as int) >= 7000 and cast(sni_kod as int) <= 7499
then 'W'
else
sni_kod
end
There are a lot more when-cases in the script, just showing the first one. I cannot use anything other than a simple text-script.
Update Using SQL Server 2000
Thanks
Anders