﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » .Net / SQL 2005 file/mdf join between tables on 2 databases question [offtopic?]</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 10:27:29 GMT</lastBuildDate><ttl>20</ttl><item><title>.Net / SQL 2005 file/mdf join between tables on 2 databases question [offtopic?]</title><link>http://forum.strataframe.net/FindPost11488.aspx</link><description>I'm using sql 2000 and I not known some stuff about sql 2005, one of that are if it´s possible using mdf/file connection strings on sql 2005 if I can open two files and make only 1 t-sql statment with a inner join.&lt;br&gt;
&lt;br&gt;
something like &lt;br&gt;
    DB1.MDF (Customers)&lt;br&gt;
    DB2.MDF (products)&lt;br&gt;
&lt;br&gt;
and make something like:&lt;br&gt;
   select * from [db1.dbo.customers] C inner join [db2.dbo.products] on...... where... &lt;br&gt;
&lt;br&gt;
It´s a crazy question but only I want to known if it´s posible :/&lt;br&gt;
&lt;br&gt;
thanks&lt;br&gt;
&lt;br&gt;</description><pubDate>Thu, 04 Oct 2007 13:13:17 GMT</pubDate><dc:creator>Fabian R Silva, -</dc:creator></item><item><title>RE: .Net / SQL 2005 file/mdf join between tables on 2 databases question [offtopic?]</title><link>http://forum.strataframe.net/FindPost11863.aspx</link><description>[quote][b]Ben Chase (09/18/2007)[/b][hr]Aha, are you using the SQL Anywhere (Everywhere) version? The version that uses an .mdf file directly and does not have a service that you connect to? In that case, I would think that, no you would not be able to join across multiple databases. With a full blown version of SQL Server 2005 or with SQL Server 2005 Express, you can join across multiple databases, because the service that processes the query has access to both databases, but, I don't think the versions of SQL Server that access the .mdf directly will be able to access more than one at a time. &lt;br&gt;
&lt;br&gt;
I'm not positive on that, but I wouldn't think so... :ermm:[/quote]&lt;br&gt;
&lt;br&gt;
sorry I lost this post :w00t:&lt;br&gt;
&lt;br&gt;
my question is about the connection string to a mdf file on ms sql 2005 express, and as you said it appears that be possible, if I not missunderstood, when I used the connection string like "Source=.\SQLEXPRESS;AttachDbFilename=somepath\somedb.mdf;Integrated Security=True;", the sql server attach the database and can be used from another source, I will test it and post here the result :) thanks!&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;</description><pubDate>Thu, 04 Oct 2007 13:13:17 GMT</pubDate><dc:creator>Fabian R Silva, -</dc:creator></item><item><title>RE: .Net / SQL 2005 file/mdf join between tables on 2 databases question [offtopic?]</title><link>http://forum.strataframe.net/FindPost11554.aspx</link><description>Aha, are you using the SQL Anywhere (Everywhere) version?&amp;nbsp; The version that uses an .mdf file directly and does not have a service that you connect to?&amp;nbsp; In that case, I would think that, no you would not be able to join across multiple databases.&amp;nbsp; With a full blown version of SQL Server 2005 or with SQL Server 2005 Express, you can join across multiple databases, because the service that processes the query has access to both databases, but, I don't think the versions of SQL Server that access the .mdf directly will be able to access more than one at a time.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I'm not positive on that, but I wouldn't think so... :ermm:</description><pubDate>Tue, 18 Sep 2007 15:03:53 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: .Net / SQL 2005 file/mdf join between tables on 2 databases question [offtopic?]</title><link>http://forum.strataframe.net/FindPost11538.aspx</link><description>thanks for the reply :)&lt;br&gt;
and how about the mdf files? if I have 2 databases, each of those on a mdf, it´s not posible to join both of them (the connection string only can reference to 1 mdf at time?)&lt;br&gt;
&lt;br&gt;
sorry, It´s a SQL question but I not sure where to question it :doze:</description><pubDate>Tue, 18 Sep 2007 11:47:07 GMT</pubDate><dc:creator>Fabian R Silva, -</dc:creator></item><item><title>RE: .Net / SQL 2005 file/mdf join between tables on 2 databases question [offtopic?]</title><link>http://forum.strataframe.net/FindPost11526.aspx</link><description>Yes, you can do exactly that.&amp;nbsp; Just remember to include the schema name when referencing it with full db.schema.table syntax, even when the schema is "dbo."&lt;/P&gt;&lt;P&gt;So, this works:&lt;/P&gt;&lt;P&gt;Database.dbo.TableName&lt;/P&gt;&lt;P&gt;but this doesn't work:&lt;/P&gt;&lt;P&gt;Database.TableName&lt;/P&gt;&lt;P&gt;As long as the currently logged in user has access to both databases, you can access both.&amp;nbsp; And as far as my tests have shown, you don't have to worry about what database the connection string is using; when you use the full database scope syntax, SQL Server will find the correct table, no matter what database it's in.</description><pubDate>Tue, 18 Sep 2007 09:09:33 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>