Home Forums SQL Server 2008 SQL Server Newbies Linked Server issue- query is inserting nulls but inserts text values RE: Linked Server issue- query is inserting nulls but inserts text values

  • Hello,

    Thanks you for the replies. I managed to get this sorted with some hardcore googling! Hopefully someone with a similar issue with stubble upon this thread.

    http://stackoverflow.com/questions/4381625/first-column-of-insert-into-over-linked-server-ms-sql-mysql-always-empty-stri

    This user was having the same issue, I thought My issue was always with text but when I added a new column in both tables the query worked fine!

    Insert into openquery ( GODADDY , 'SELECT `account2` , `account3` , `YTD` , `LY` , `VARIANCE`

    FROM `turnovertest`' )

    Select cast([customer] as NVARCHAR(MAX))

    ,[customer2]

    ,YTD

    ,LY

    ,cast(YTD-LY as NVARCHAR(MAX))

    FROM [TestDB].[dbo].[TurnoverAll]