1DECLARE @OPENQUERY nvarchar(4000), @TSQL nvarchar(4000), @LinkedServer nvarchar(4000);
2DECLARE @name nvarchar(10) = 'Y4081';
3SET @LinkedServer = 'linkedserver'
4SET @OPENQUERY = 'DELETE FROM OPENQUERY('+ @LinkedServer +', '''
5SET @TSQL = 'SELECT * FROM [MyDataBase].[dbo].[MyTable]
6WHERE Name = '+@name+' '')'
7EXEC(@OPENQUERY+@TSQL)
8