LoginSignup
0
0

More than 3 years have passed since last update.

Microsoft SQL Server Management Studio(SSMS)で同じサーバ、違うデータベースをINNER JOINする方法

Posted at

はじめに

Microsoft SQL Server Management Studio(以下SSMS)を使っている人、あまり見かけないような。。。本記事は、自分用のメモ拡張版ですので、見やすさはご愛嬌でお願いします。

問題点

私はこれがやりたくて苦労しました。
ネットの文献を見ていると、

INNER JOIN DB-B.table-B ON DB-A.table-A = DB-B.table-B

と書いているけど、どうも成功しない。

プレゼンテーション1.jpg

答えは .(ドット)の数にあり。

SSMSの場合
INNER JOIN DB-B..table-B ON DB-A..table-A = DB-B..table-B

データベース名とテーブル名の間の.(ドット)は2個!!

現場からは以上です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0