Hello,
I am trying to truncate data from one server to the other (remote server)
it works from query analyzer like this:
exec RemoteServerName.DatabaseName.DBO.sp_executesql "truncate table DBO.tablename"
it does NOT work from query analyzer like this:
Declare @cmd varchar(2000)
set @cmd = @servername + '.' + @databasename + '_Archive'+ '.' + @schema + '.' + 'sp_executesql' + ' ' + '"' +'truncate table' + ' ' + @schema + '.' + @tablename + '"'
exec xp_cmdshell @cmd
Produced this error:
'RemoteServerName.DatabaseName.DBO.sp_executesql' is not recognized as an internal or external command,
operable program or batch file.
Please Help !
I am trying to truncate data from one server to the other (remote server)
it works from query analyzer like this:
exec RemoteServerName.DatabaseName.DBO.sp_executesql "truncate table DBO.tablename"
it does NOT work from query analyzer like this:
Declare @cmd varchar(2000)
set @cmd = @servername + '.' + @databasename + '_Archive'+ '.' + @schema + '.' + 'sp_executesql' + ' ' + '"' +'truncate table' + ' ' + @schema + '.' + @tablename + '"'
exec xp_cmdshell @cmd
Produced this error:
'RemoteServerName.DatabaseName.DBO.sp_executesql' is not recognized as an internal or external command,
operable program or batch file.
Please Help !