Solved

Linked Server - Drop Table

Posted on 2006-10-21
5
331 Views
Last Modified: 2012-05-05

I get the error "The object name 'txtsrv...test#txt' contains more than the maximum number of prefixes. The maximum is 2" when i run the following:-

DECLARE @table nvarchar(1000)
DECLARE @SQL nvarchar (1000)
SELECT @SQL = ' txtsrv...[test#txt]'
SELECT @table = 'DROP TABLE' + @SQL
EXEC sp_executeSQL @table

What do I need to change in order to delete the file?

Thanks!
0
Comment
Question by:doolinn
  • 2
5 Comments
 
LVL 29

Expert Comment

by:Nightman
ID: 17779358
try [servername].[databasename].[dbo].[tablename]
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 17779482
you cannot drop a table on a remote (linked) server.
0
 
LVL 29

Assisted Solution

by:Nightman
Nightman earned 250 total points
ID: 17779510
True:

use
EXEC  [servername].[databasename].[dbo].[sp_executesql] N'drop table tableName'
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question