I get the following error. Syntax error converting the varchar value 'N' to a column of data type int.What I am trying to do is create a temporary table and insert values from a query. And also create another query, then merge the two tables together. CREATE TABLE #Temp_OFFICE ( [Code] varchar(255) COLLATE SQL_Latin1_General_CP1251_CS_AS NULL, [Key] varchar(255) COLLATE SQL_Latin1_General_CP1251_CS_AS NULL) INSERT INTO #Temp_OFFICE (Code, Key) SELECT office.office_id AS Code, office.office_work_key AS Key FROM OFFICE SELECT office.office_id AS Code, office.office_home_key AS Key FROM OFFICE UNION ALL SELECT * FROM #Temp_OFFICE -- DROP TEMPORARY TABLE DROP TABLE #Temp_OFFICE
I have no idea where this error is coming from and how to debug or fix it!Any help would be greatly appreciated.thank you