Author |
Message |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
This is fixed in 5.1.10. Please give it a try.
|
|
Tue Aug 24, 2010 1:11 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
It seems to work.
|
|
Mon Sep 06, 2010 9:09 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Thank you for the status update
|
|
Thu Sep 09, 2010 6:41 am |
|
 |
judahr
Joined: 09 Mar 2007 Posts: 319 Country: United States |
|
Not Quite |
|
in 5.1.7 and 5.1.10 PRO
Assuming:
Select *
From dbo.Table t
Inner join
From here, if you select just the table, now it outputs the schema duplicated:
dbo.dbo.Table1
it should output:
dbo.Table1
if you select the columns, it operates correctly.
|
|
Thu Sep 09, 2010 3:45 pm |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
That's strange. I tried it your way but it still worked. No matter if I select the table from the section that offers join conditions or otherwise.
|
|
Fri Sep 10, 2010 2:10 am |
|
 |
judahr
Joined: 09 Mar 2007 Posts: 319 Country: United States |
|
|
|
On a whim, I reloaded the default DB Queries, and now it works fine.
|
|
Fri Sep 10, 2010 9:05 am |
|
 |
Olegon
Joined: 07 Sep 2009 Posts: 40
|
|
|
|
 |
 |
This is fixed in 5.1.10. Please give it a try. |
It's work. Thanks!
But:
 |
 |
use Northwind
go
select
*
from
dbo.Categories c
inner join |
selected foreign key:
 |
 |
select
*
from
dbo.Categories c
inner join Northwind.dbo.Products p
on
p.CategoryID = c.CategoryID |
should be:
 |
 |
select
*
from
dbo.Categories c
inner join dbo.Products p
on
p.CategoryID = c.CategoryID |
Because Northwind alredy current database.
Not so important, but specifically when you write SQL that will be used on databases with different names but having same structure.
|
|
Tue Oct 05, 2010 5:41 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Hi,
We are aware of this issue. We've an open case #SA-11505 describing random full qualification of object names in JOIN suggestions. Our development team is unable so far to reproduce this issue. If it happens to you consistently or you noticed a specific pattern for reproducing this issue, please describe the required steps.
Thank you
|
|
Tue Oct 05, 2010 8:54 am |
|
 |
Olegon
Joined: 07 Sep 2009 Posts: 40
|
|
|
|
I use:
MS SQL Server 2000, 2005, 2008
MS SQL Server Managment Studio 2008
SQL Assistant 5.1.10
Simple in MSSMS I opened new query, I selected Northwind database and wrote this query:
 |
 |
select
from
dbo.CntActions ca
inner join |
In SQL Assitant I selected foreign key:
In result I got this:
When it's should be like this:
Without specifying the database Northwind in join.
|
|
Thu Oct 07, 2010 7:01 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Please try reloading the default DB Queries in the settings. This might be a result of upgrades from previous SQL Assistant versions and maintenance releases. While db queries from the older versions can still be used, they may produce side effects like the one described here with full table name qualification. The newest versions have updated definitions for DB queries retrieving data for joins.
|
|
Thu Oct 07, 2010 9:07 am |
|
 |
Olegon
Joined: 07 Sep 2009 Posts: 40
|
|
|
|
 |
 |
Please try reloading the default DB Queries in the settings. |
Yes, now it's working. Thank you!
|
|
Fri Oct 08, 2010 12:56 am |
|
 |
Olegon
Joined: 07 Sep 2009 Posts: 40
|
|
|
|
Something wrong with this function :)
I loaded default settings.
I set "With database and schema names" in DB options.
 |
 |
use master
go
|
 |
 |
select
*
from
Northwind.dbo.Categories c
inner join
|
After I selected FK to dbo.Products.
Result is:
 |
 |
select
*
from
Northwind.dbo.Categories c
inner join Northwind.dbo.Products p on p.CategoryID = c.CategoryID
|
It's OK. SQL Assistant added "Northwind" and "dbo" before table name.
Set current database to Northwind.
 |
 |
use Northwind
go
|
 |
 |
select
*
from
dbo.Categories c
inner join
|
After I selected FK to dbo.Products.
Result is:
 |
 |
select
*
from
dbo.Categories c
inner join Northwind.dbo.Products p on p.CategoryID = c.CategoryID
|
SQL Assistant again added "Northwind" and "dbo" before table name. But not need to do it, because Northwind is current database.
When I tried with option "Only for objects in other schema or database" in DB options.
Result is:
 |
 |
use Northwind
go
|
 |
 |
select
*
from
dbo.Categories c
inner join Products p on p.CategoryID = c.CategoryID
|
Almost OK, but without shema name "dbo".
 |
 |
use master
go
|
 |
 |
select
*
from
Northwind.dbo.Categories c
inner join
|
Result is:
 |
 |
select
*
from
Northwind.dbo.Categories c
inner join Products p on p.CategoryID = c.CategoryID
|
Same result as above.
I think with option "Only for objects in other schema or database" it's should be:
 |
 |
use master
go
|
 |
 |
select
*
from
Northwind.dbo.Categories c
inner join Northwind.dbo.Products p on p.CategoryID = c.CategoryID
|
With database name and schema name.
 |
 |
use Northwind
go
|
 |
 |
select
*
from
dbo.Categories c
inner join dbo.Products p on p.CategoryID = c.CategoryID
|
Only with schema name.
|
|
Mon Oct 18, 2010 12:39 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
"With database and schema names" is for "Always fully qualify..." option. By definition this option does not care what the current database is. It should always add db and schema names. It is a bit different for "With schema name". If the table is not in the current database, it should be fully qualified in db.schema.table format. Similarly when you choose "Only for objects in other schema or database" and then pick a table in dbo schema, it doesn't need to be qualified with the schema name because it is in the current schema.
However, I totally agree with you that there is a problem in the last case
 |
 |
use master
go
SELECT *
FROM Northwind.dbo.Categories c
inner JOIN Products p ON p.CategoryID = c.CategoryID |
This is incorrect. The Product table reference is missing db and schema name qualification. I'm going to log a bug report for this issue.
|
|
Mon Oct 18, 2010 1:32 am |
|
 |
Olegon
Joined: 07 Sep 2009 Posts: 40
|
|
|
|
Your are right, I agree with you.
So with option "With schema name" will be work as:
- if table in the current database then dbo.table;
- if table not in the current database then db.dbo.table.
With option "Only for objects in other schema or database" will be work as:
- if table in the current database then only table name;
- if table not in the current database then db.dbo.table.
Do I understand correctly?
|
|
Mon Oct 18, 2010 1:55 am |
|
 |
|