Jump to content

Ciclo


JavaLL
 Share

Recommended Posts

Bom dia,

Tenho a seguinte query que me converte os dados do campo Extensão no "codigo" bigint

ex:

DECLARE @extensaoX VARCHAR(50)
SELECT  @extensaoX = right(Extensão,3) FROM [bD_Teste2].[dbo].[users] where Extensão <>'' and ISNUMERIC([Extensão]) = 1
SELECT CONVERT(VARBINARY(128), cast(@extensaoX as bigint))

Resultado:

(No column name)

0x000000014BBF0767

O meu problema (dificuldade), é que pretendia fazer a conversão de todos os campos. Algum ciclo para correr a tabela e converter os dados?

Extensão (No column name)

123 0x000000014BBF0767

213 ?????????????

345 ?????????????

Obrigado.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.