﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / Scema Issue / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 19:47:01 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Scema Issue</title><link>http://www.sqlservercentral.com/Forums/Topic1373926-391-1.aspx</link><description>Thanks for the reply. I was a bit confused about this. I will give you my exact query.I have created a connection through my application on SQL SERVER (sql server authentication) which is for AdventureWorks Database. This is for user1. User1 have access on AdventureWorksDW database also. The query which i have written isSELECT t1.Name , t2.ModelName FROM AdventureWorks .Production.Product t1 LEFT JOIN AdventureWorksDW.dbo.DimProduct t2 ON (t1.ProductID=t2.ProductKey)This query is work fine,  this is working fine even in this case also.SELECT t1.Name , t2.ModelName FROM Production.Product t1 LEFT JOIN AdventureWorksDW.dbo.DimProduct t2 ON (t1.ProductID=t2.ProductKey)Now my question is will this query work if i write a query like SELECT t1.Name , t2.ModelName FROM Production.Product t1 LEFT JOIN dbo.DimProduct t2 ON (t1.ProductID=t2.ProductKey)Help me out with this.</description><pubDate>Thu, 18 Oct 2012 05:23:35 GMT</pubDate><dc:creator>kunal_ghosh84</dc:creator></item><item><title>RE: Scema Issue</title><link>http://www.sqlservercentral.com/Forums/Topic1373926-391-1.aspx</link><description>In the database you are working in, you can create a synonym for each table you want to access outside of the account's database you are working in.  I don't know if this will meet your criteria, as you would specify the database, schema, and table name in the synonym, but the query could then be written using the synonyms with the accounts default database and schema.</description><pubDate>Wed, 17 Oct 2012 10:56:45 GMT</pubDate><dc:creator>sestell1</dc:creator></item><item><title>RE: Scema Issue</title><link>http://www.sqlservercentral.com/Forums/Topic1373926-391-1.aspx</link><description>Your sample query [quote]QUERYSelect Empid, Deptname From Employee E INNER JOIN Department D ON (E.Dept_id=D.Dept_id) Will this work??-----Insted if i write Select Empid, Deptname From AdventureWork .Employee E INNER JOIN AdventureWorkDW .Department D ON (E.Dept_id=D.Dept_id)--- This is working fine.But our requiremnt is we dont want to mention the schema name. Is tis possible?? [/quote]This is not describing a schema, AdventureWorkDW, and AdventureWork are database names.If you want to eliminate the database name from your query then you must be connected to that database.For Example[code="sql"]Use [AdventureWorks]SELECT *FROM [Production].[Product][/code]Works.If your purposly connected to AdventureWorks, and you need data from the AdventureWorkDW database then you need to fully qualify the AdventureWorksDW table in your query by using the [DatabaseName].[Schema].[Table Name] in your Join.Like I mentioned I'm confused by what your asking because you seem to be calling database names Schemas, and they are different. and the examples you posted do not work as you mention.</description><pubDate>Wed, 17 Oct 2012 10:55:43 GMT</pubDate><dc:creator>Ray M</dc:creator></item><item><title>Scema Issue</title><link>http://www.sqlservercentral.com/Forums/Topic1373926-391-1.aspx</link><description>I have a user on which i have acess over 2 databases say AdventreWork and AdventureWorkDW. Now i have to write a query in which i dont have to mention a db name but still it will give me the result.example :AdventureWork : Employee (Table Name)AdventureWorkDW : Department (Table Name)QUERYSelect Empid, Deptname From Employee E INNER JOIN Department D ON (E.Dept_id=D.Dept_id) Will this work??-----Insted if i write Select Empid, Deptname From AdventureWork .Employee E INNER JOIN AdventureWorkDW .Department D ON (E.Dept_id=D.Dept_id)--- This is working fine.But our requiremnt is we dont want to mention the schema name. Is tis possible??</description><pubDate>Wed, 17 Oct 2012 10:08:21 GMT</pubDate><dc:creator>kunal_ghosh84</dc:creator></item></channel></rss>