• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 140
  • Last Modified:

SQL Server "USE" remote server

Is there a way in a stored procedure to connect to a remote server database with the USE statement?

Normally...

use database
go
select * from table

but if I wanted to write a script for that to a remote server?
0
lrbrister
Asked:
lrbrister
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
if the remote server is linked, you can do this:


select * from linked_server.remote_database.table_owner.table

Open in new window

0
 
lrbristerAuthor Commented:
<form name="cruiseForm" action="http://res.mydomain.com/travel/cruise/search.rvlx"
onsubmit="FormBuild('4');progress_update(); hideform(this)" method="get" style="margin: 0px">
<table width="450" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#f3eedd">
    -----SELECT / INPUT/OPTION Boxes-----
    <input type="hidden" name="TEN" value="">
    <input type="hidden" name="msiteid" value="">
    <input type="hidden" name="sitemail" value="">
    <input type="hidden" name="sitephone" value="">
    <input type="hidden" name="s[msiteid]" value="">
    <input type="hidden" name="s[TEN]" value="">
    <input type="hidden" name="s[sitemail]" value="">
    <input type="hidden" name="s[sitephone]" value="">
    <input type="hidden" name="s[sitename]" value="">
    <input type="hidden" name="s[accountid]" value="">
    <input type="hidden" name="s[CompanyName]" value="">
    ----MORE STUFF----
    <input type="submit" class="SearchButtonCruise" value="Search" width="40" name="submit2"
        onmouseover="this.style.cursor='hand';" />
</form>

bear in mind...it works when outside the content placeholder
0
 
lrbristerAuthor Commented:
AngelIII
Sorry...wrong post
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now