Answers for "linked server delete openquery"

SQL
0

linked server delete openquery

DECLARE @OPENQUERY nvarchar(4000), @TSQL nvarchar(4000), @LinkedServer nvarchar(4000);
DECLARE @name nvarchar(10) = 'Y4081';
SET @LinkedServer = 'linkedserver'
SET @OPENQUERY = 'DELETE FROM OPENQUERY('+ @LinkedServer +', '''
SET @TSQL = 'SELECT * FROM [MyDataBase].[dbo].[MyTable] 
WHERE Name = '+@name+' '')'
EXEC(@OPENQUERY+@TSQL)
Posted by: Guest on August-02-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language