qualify object names and table variables
AlexSlater
Posts: 4
The `qualify object names` doesn't seem to work on SQL containing table variables.
Here's a little example. This code
declare @tabvar TABLE (cola INT, colb INT)
select * from @tabvar
where cola = 1 and colb = 2
runs satisfactorily.
But when you `qualify object names` on it, it becomes:
declare @tabvar TABLE ( cola INT, colb INT )
select *
from @tabvar
where [@tabvar].[cola] = 1
and [@tabvar].[colb] = 2
which doesn't work.
Msg 107, Level 16, State 2, Line 3
The column prefix '@tabvar' does not match with a table name or alias name used in the query.
Msg 107, Level 16, State 2, Line 3
The column prefix '@tabvar' does not match with a table name or alias name used in the query.
I'm using sql server 2005 management studio on a sql server 2000 database.
Here's a little example. This code
declare @tabvar TABLE (cola INT, colb INT)
select * from @tabvar
where cola = 1 and colb = 2
runs satisfactorily.
But when you `qualify object names` on it, it becomes:
declare @tabvar TABLE ( cola INT, colb INT )
select *
from @tabvar
where [@tabvar].[cola] = 1
and [@tabvar].[colb] = 2
which doesn't work.
Msg 107, Level 16, State 2, Line 3
The column prefix '@tabvar' does not match with a table name or alias name used in the query.
Msg 107, Level 16, State 2, Line 3
The column prefix '@tabvar' does not match with a table name or alias name used in the query.
I'm using sql server 2005 management studio on a sql server 2000 database.
Comments