Qualify object names issue

jj14jj14 Posts: 7
edited April 19, 2007 4:25PM in SQL Refactor Previous Versions
Hi!
I'm using SQL Refractor 1.1.0.97 on XP Pro SP2 - SSMS connecting to SQL Server 2000.

I tried a query similar to

UPDATE dbo.tablename1
SET column1 = 5
FROM dbo.tablename1 tbl1
LEFT JOIN dbo.tablename2 tbl2 ON tbl1.column2 = tbl2.column2 WHERE tbl2.column3 IS NULL

When I tried to "qualify object names", refractor underlined column1 (in SET column1=5) stating "this column was not qualified because a column with this name exists in several tables: tbl1 and tablename1"

tbl1 & tablename1 are the same table (tbl1 is just the alias for tablename1)... ??

- Joseph

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi,

    I think I understand why this has happened; apparently Refactor thinks the column is ambiguous because it exists in two different tables, even though one is an alias. This is something we may be able to work around in a future version.
  • I have a suggestion to offer about the "Qualify table names" option. This is especially important for sql server 2005. While qualifying table names, sql refactor should check if the same table name is present in different schemas and offer a list of schemas for the user to choose which schema they want in their query. Currently it randomly chooses schemas for the tables which is wrong. In my case it choose one schema for one table and another schema for another table and this is certainly not what I wanted.
Sign In or Register to comment.