Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How do i access different databases

How do i access different databases

Scheduled Pinned Locked Moved Database
databasequestiontutorialannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Venkatraman
    wrote on last edited by
    #1

    Hey How can i run a query which can be an insert/update query from one database referring another database. For example i need to insert a row in my database1.table1 from database2 thanks Cheers, Venkatraman Kalyanam Bangalore - India "Being Excellent is not a skill, it is an attitude" Reality is an illusion caused by caffeine deficiency(one Microsoft Research scholor)

    M 1 Reply Last reply
    0
    • V Venkatraman

      Hey How can i run a query which can be an insert/update query from one database referring another database. For example i need to insert a row in my database1.table1 from database2 thanks Cheers, Venkatraman Kalyanam Bangalore - India "Being Excellent is not a skill, it is an attitude" Reality is an illusion caused by caffeine deficiency(one Microsoft Research scholor)

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      Is this

      1. Two SQL Server databases on the same server instance
      2. Two SQL Server databases on two different server instances
      3. Not SQL Server at all?

      If the first or second: You can reference any object in SQL Server (table, view, function) by a full name: _server_._database_._owner_._object_. The first three can be omitted when referencing an object in the same database as you're currently accessing; owner is typically only used to disambiguate where two users have an object with the same name, although functions require the owner part. The simplest syntax for referring to an object in another database on the same server - say you wanted to access the titles table in the pubs database is pubs..titles (note the two dots, signifying that the owner of titles has been omitted). If you want to refer to an object on another server, you need to set up a linked server, which you can do in Enterprise Manager, under Security > Linked Servers. I believe Access has the concept of foreign tables.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups