I have two databases/catalogs on the same SQL server and an SQL-user with access to both of them.
Collation on Database01 is Danish_Norwegian_CI_AS
Collation on Database02 is SQL_Latin1_General_CP1_CI_AS
I need to query two views on "Database02". The queries are basically
SELECT * FROM View01 -- (resulting in 43 rows) SELECT * FROM View02 -- (resulting in 2000 rows)
The two views are rather complex (to say the least) and I do not have access to change them.
If I log onto the SQL server and specify "Database02" as "default catalog", the queries respond in "0.001" and 30 seconds, respectively.
However if I log onto the SQL Server and specify "Database01" as "default catalog" the first query executes in 30 seconds whereas the second query times out after 600 seconds.
The queries executed on Database01 will be something like
SELECT * FROM Database02.View01 SELECT * FROM Database02.View02
Can anyone please explain this behavior? I am not trying to do any joins between the databases, so I would not expect the diffent collations to be an issue.
PARAMETERIZATION is "Simple" on both databases.