I need to convert a `VARCHAR` with a hex number to `INT`, I tried:

```
DECLARE @H VARCHAR(2);
SELECT @H = '9a'
SELECT CONVERT(INT, 0x + @H)

```

But it says `@H` has to be a `VARBINARY`, and if I cast I get a completely different number.

From `'9a'` I want to get `154`, how can I achieve it?