Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
herbau
Starting Member
3 Posts |
Posted - 2012-10-17 : 16:21:56
|
I’m trying to truncate a table on a linked server. I’ve given myself all possible permissions on the linked server.I can run: SELECT * FROM linkedServer.import.dbo.SafetyStockTimeBut when I run: TRUNCATE TABLE linkedServer.import.dbo.SafetyStockTimeI get the error: Cannot find the object "SafetyStockTime" because it does not exist or you do not have permissions.So I know it exists, and I’ve assigned myself all possible permissions. Any help as to what I'm missing?? Thanks |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2012-10-17 : 18:51:47
|
One option you can try is to create a stored procedure on the linked server that performs the TRUNCATE TABLE, then execute it via 4-part name:EXEC linkedServer.import.dbo.TruncateProcedureIn SQL Server 2008 (not sure about previous versions), you can use the AT clause of the EXECUTE command:EXEC ('TRUNCATE TABLE import.dbo.TruncateProcedure') AT linkedServerSee Books Online for more details under "EXECUTE". |
|
|
|
|
|