我有一个如下的SQL查询:
Declare @DivisionNo INT
SET @DivisionNo = 5117
SELECT distinct CASE WHEN ISNULL([DivisionNo],'') <> @DivisionNo
THEN @DivisionNo ELSE [DivisionNo] END as DivisionNo
--,[RecordID]
,[AcctCat]
,[AcctCatDesc]
,[CostCode]
,[CostCodeDesc]
FROM [dbo].[vw_eSchdl_AcctCat_CostCode]
WHERE DivisionNo = @DivisionNo
UNION
SELECT distinct CASE WHEN ISNULL([DivisionNo],'') <> @DivisionNo
THEN @DivisionNo ELSE [DivisionNo] END as DivisionNo
--,[RecordID]
,[AcctCat]
,[AcctCatDesc]
,[CostCode]
,[CostCodeDesc]
FROM [dbo].[vw_eSchdl_AcctCat_CostCode]
WHERE AcctCat not in (
SELECT [AcctCat]
FROM [dbo].[vw_eSchdl_AcctCat_CostCode]
WHERE DivisionNo = @DivisionNo
)
我该如何使用linq to sql进行复制呢?
谢谢。