Re: bug with TABLE variable???

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Aaron [SQL Server MVP] (ten.xoc_at_dnartreb.noraa)
Date: 12/13/04


Date: Mon, 13 Dec 2004 10:55:47 -0500


> DELETE
> @grpIds
> FROM
> @grpIds
> INNER JOIN tab_rub_deny
> ON tab_rub_deny.grp_id = @grpIds.grp_id

Please see http://www.aspfaq.com/2475

Of particular interest:
"Table variables must be referenced by an alias, except in the FROM clause.
Consider the following two scripts: " [...]

-- 
http://www.aspfaq.com/
(Reverse address to reply.)
>
> Error:
> @grpIds must be declared
>
> If I replace the table variable by a normal table, there's no error any
> more.
> It seems to be a bug.
> Should I use a temporary table then?
>
> Thanks
>
> Henri
>
>
>


Relevant Pages

  • Re: Aliases and the WHERE clause
    ... The one hope we could hold is that future releases of engines will build on ... To me, SQL also feels just like a set of principles, or if you wish, mental ... I was thinking about the ORDER BY clause. ... alias in the WHERE clause. ...
    (microsoft.public.access.queries)
  • Re: Can not get updates
    ... Hello Alias ... I regularly clean up my computer before updating. ... A bug is something that does not work ... that should work for hundreds of different installations is quite a challenge ...
    (microsoft.public.windowsupdate)
  • Re: maximum driver handles per process?
    ... Please do not send e-mail directly to this alias. ... but there is a good chance that it lies with synchronization). ... the problem may lie with some bug in IRP_MJ_CREATE ... I'm using Win2k, WinXP, Win03. ...
    (microsoft.public.development.device.drivers)
  • Trying to find a maximum value amongst 3 columns in a dB row
    ... The column prefix 'a1' does not match with a table name or alias name ... used in the query. ... Either the table is not specified in the FROM clause ...
    (comp.databases.sybase)
  • Re: How does UPDATE statement work?
    ... It cannot have an alias because an alias ... You go to the WHERE clause. ... disaster in the ANSI model and in implementation, ... Trying to UPDATE the temporary result of a JOIN syntax would be ...
    (comp.databases.ms-sqlserver)