【问题标题】:System.Data.SqlClient.SqlException: Incorrect syntax near 'in'System.Data.SqlClient.SqlException:“in”附近的语法不正确
【发布时间】:2016-01-23 23:35:29
【问题描述】:

这是我的存储过程,我不知道它在哪里导致错误?请帮助我....在此先感谢。

这些是我嵌入到存储过程中的代码行,这些语句包含“IN”关键字

Declare @SQLQuery Nvarchar(1000)



         set  @SQLQuery = ' select distinct program from tblProgNotes where Program in ' + @Program

         --print @SQLQuery
         create TABLE #T1 ( Program int)
        insert  into #T1 execute sp_executesql @SQLQuery

and (@Program is null or (P.Program in (select program from #T1))) 最后一行嵌入在给定存储过程中的三个位置##

and (@Program is null or (P.Program in (select program from #T1))) 此行在给定的存储过程中嵌入了三次:我不知道它在哪里导致错误。

            @StartDate DateTime,
            @EndDate DateTime,
            @ShowDollars bit = 0,
            @LateEntryOnly bit = 0, -- new
            @Status int = null, -- value of dropdown be locationid
            @Program nvarchar = null, -- value of dropdown be lookup codeID
            @Clinician int = null, -- value of tblProviders UserID
            @Billable int = 0

        As

        Declare @SQLQuery Nvarchar(1000)



         set  @SQLQuery = ' select distinct program from tblProgNotes where Program in ' + @Program

         --print @SQLQuery
         create TABLE #T1 ( Program int)
        insert  into #T1 execute sp_executesql @SQLQuery



        select B.ID as BillingCodeID, Code, B.MOD1, B.MOD2, RateAmount, StartDate, EndDate, POS, LicenseGroupID, Billable,ProviderID
        into #tmpRates
        from tblRates R 
        left join tblBillingCodes B on B.ID = R.BillingCodeID
        where PayorID = 1


        if @ShowDollars = 1
        Begin
        select distinct
        Isnull(U.LastName,'') + ', ' + IsNull(U.Firstname,'') as Clinician,
        p.DateOfService,
        P.PaceID,
        Dem.LastName + ', ' + Dem.FirstName as ClientName,
        P.ID as ProgressNoteID,
        PC.BillingCodeID,
        PC.ProgressNoteType,
        BC.Code, 
        PC.POS,
        BC.MOD1,
        BC.MOD2,
        Isnull(BC.Code,'') + ' ' + ISnull(PC.POS,'') + ' ' + ISNULL(BC.MOD1,'') + ' ' + ISNULL(BC.MOD2,'') as FullHCPC,
        PC.Units,
        PC.TimeIn,
        PC.TimeOut,
        DateDiff(mi,PC.TimeIn, PC.TimeOut) as Minutes,
        Case when Datediff(mi,PC.TimeIn,PC.TimeOut)/60 > 0 
        then Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut)/60) + 'h ' + Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut) % 60) + 'm' else Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut) % 60) + 'm' end as TimeDesc,
        I.BehavioralHealthCategory,
        case when p.DateOfService > '8/1/13' and PC.BillingCodeID in (3,4) and PC.DOCID is null then 'Log Missing' else convert(varchar(20),PC.DocID) end as TransportationLog,
        L3.Description as Program,
        P.LateEntry,
        case when PC.Billable = 0 then 'Non Billable' else '' end as NonBillable,
        (Convert(float,IsNull(R.RateAmount,0)) * case when PC.Units ='' then 0 else Convert(float,PC.Units) end) as 'Service Value',
        a.currentlocation as Status
        from tblProgNotes P
        left join tblProgressNoteCodes PC on PC.ProgressNoteID = P.ID and PC.ProgressNoteType = 1
        left join tblLicensure L on L.ProviderID = P.ClinicianID and L.[Primary] = 1 and P.DateOfService >= L.StartDate and (L.EndDate is null or L.EndDate >= P.DateOfService)
        left join tblLookups L2 on L2.Code = L.LicenseTypeID and L2.CategoryID = 48
        left join tblLookups L3 on L3.Code = P.Program and L3.CategoryID = 104
        left join #tmpRates R on R.BillingCodeID = PC.BillingCodeID and R.POS = PC.POS and R.LicenseGroupID = L2.Type and R.Billable = PC.Billable and R.ProviderID = P.Site
             and R.StartDate <= p.DateOfService and R.EndDate >= p.DateOfService
        left join tblBillingCodes BC on BC.ID = PC.BillingCodeID
        left join tblDemographics Dem on Dem.PaceID = P.PaceID
        left join tblIntakes I on I.ID = P.IntakeID
        left join tblReferrals CR on CR.ID = I.ReferralID
        left join tblProviders PP on PP.ID = P.ClinicianID
        left join vwUsers U on U.ID = PP.UserID
        left join tblactivities A on A.extid1 = P.paceid and A.extid2 = P.ID and A.completedDate is null and A.currentlocationid in (select locationid from tbllocations where workflowid = 4) and A.visible = 1 and A.extid4 = 1
        where DateOfService >= @StartDate and DateOfService <= @EndDate
        and P.Deleted = 0
        and PC.Void = 0
        and (@Status is null or (a.currentlocationID = @Status))
        and (@Program is null or (P.Program in (select program from #T1)))
        and (@Clinician is null or (P.ClinicianUserID = @Clinician))
        and (@LateEntryOnly = 0 or (P.LateEntry = @LateEntryOnly))
        and ((@Billable =0) or (@Billable = 1 and PC.Billable = 1) or (@Billable = 2 and PC.Billable = 0))

        Union All
        select distinct
        Isnull(U.LastName,'') + ', ' + IsNull(U.Firstname,'') as Clinician,
        convert(varchar(15),P.DateOfService,101) as DateOfService,
        P.PaceID,
        Dem.LastName + ', ' + Dem.FirstName as ClientName,
        P.ID as ProgressNoteID,
        PC.BillingCodeID,
        PC.ProgressNoteType,
        BC.Code, 
        PC.POS,
        BC.MOD1,
        BC.MOD2,
        Isnull(BC.Code,'') + ' ' + ISnull(PC.POS,'') + ' ' + ISNULL(BC.MOD1,'') + ' ' + ISNULL(BC.MOD2,'') as FullHCPC,
        PC.Units,
        PC.TimeIn,
        PC.TimeOut,
        DateDiff(mi,pc.TimeIn,pc.TimeOut) as Minutes,
        Case when Datediff(mi,PC.TimeIn,PC.TimeOut)/60 > 0 
        then Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut)/60) + 'h ' + Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut) % 60) + 'm' else Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut) % 60) + 'm' end as TimeDesc,
        I.BehavioralHealthCategory,
        case when p.DateOfService > '8/1/13' and PC.BillingCodeID in (3,4) and PC.DOCID is null then 'Log Missing' else convert(varchar(20),PC.DocID) end as TransportationLog,
        L3.Description as Program,
        P.LateEntry,
        case when PC.Billable = 0 then 'Non Billable' else '' end as NonBillable,
        (Convert(float,IsNull(R.RateAmount,0)) * case when PC.Units ='' then 0 else Convert(float,PC.Units) end) as 'Service Value',
        a.currentlocation as Status

        from tblCrisisProgressNotes P
        left join tblProgressNoteCodes PC on PC.ProgressNoteID = P.ID and PC.ProgressNoteType = 2
        left join tblLicensure L on L.ProviderID = P.ClinicianID and L.[Primary] = 1 and P.DateOfService >= L.StartDate and (L.EndDate is null or L.EndDate >= P.DateOfService)
        left join tblLookups L2 on L2.Code = L.LicenseTypeID and L2.CategoryID = 48
        left join tblLookups L3 on L3.Code = P.Program and L3.CategoryID = 104
        left join #tmpRates R on R.BillingCodeID = PC.BillingCodeID and R.POS = PC.POS and R.LicenseGroupID = L2.Type and R.Billable = PC.Billable and R.ProviderID = P.Site
             and R.StartDate <= p.DateOfService and R.EndDate >= p.DateOfService
        left join tblBillingCodes BC on BC.ID = PC.BillingCodeID
        left join tblDemographics Dem on Dem.PaceID = P.PaceID
        left join tblIntakes I on I.ID = P.IntakeID
        left join tblReferrals CR on CR.ID = I.ReferralID
        left join tblProviders PP on PP.ID = P.ClinicianID
        left join vwUsers U on U.ID = PP.UserID
        left join tblactivities A on A.extid1 = P.paceid and A.extid2 = P.ID and A.completedDate is null and A.currentlocationid in (select locationid from tbllocations where workflowid = 4) and A.visible = 1 and A.extid4 = 2
        where P.DateOfService >= @StartDate and P.DateOfService <= @EndDate
        and P.Deleted = 0
        and PC.Void = 0
        and (@Status is null or (a.currentlocationID = @Status))
        and (@Program is null or (P.Program in (select program from #T1)))
        and (@Clinician is null or (P.ClinicianUserID = @Clinician))
        and (@LateEntryOnly = 0 or (P.LateEntry = @LateEntryOnly))
        and ((@Billable =0) or (@Billable = 1 and PC.Billable = 1) or (@Billable = 2 and PC.Billable = 0))

        Union All
        select distinct
        Isnull(U.LastName,'') + ', ' + IsNull(U.Firstname,'') as Clinician,
        convert(varchar(15),p.DateOfService,101) as DateOfService,
        P.PaceID,
        Dem.LastName + ', ' + Dem.FirstName as ClientName,
        P.ID as ProgressNoteID, 
        PC.BillingCodeID,
        PC.ProgressNoteType,
        BC.Code, 
        PC.POS,
        BC.MOD1,
        BC.MOD2,
        Isnull(BC.Code,'') + ' ' + ISnull(PC.POS,'') + ' ' + ISNULL(BC.MOD1,'') + ' ' + ISNULL(BC.MOD2,'') as FullHCPC,
        PC.Units,
        PC.TimeIn,
        PC.TimeOut,
        DateDiff(mi,pc.TimeIn,pc.TimeOut) as Minutes,
        Case when Datediff(mi,PC.TimeIn,PC.TimeOut)/60 > 0 
        then Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut)/60) + 'h ' + Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut) % 60) + 'm' else Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut) % 60) + 'm' end as TimeDesc,
        I.BehavioralHealthCategory,
        case when p.DateOfService > '8/1/13' and PC.BillingCodeID in (3,4) and PC.DOCID is null then 'Log Missing' else convert(varchar(20),PC.DocID) end as TransportationLog,
        L3.Description as Program,
        P.LateEntry,
        case when PC.Billable = 0 then 'Non Billable' else '' end as NonBillable,
        (Convert(float,IsNull(R.RateAmount,0)) * Convert(float,PC.Units)) as 'Service Value',
        a.currentlocation as Status
        from tblPersonalProgressNotes P
        left join tblProgressNoteCodes PC on PC.ProgressNoteID = P.ID and PC.ProgressNoteType = 3
        left join tblLicensure L on L.ProviderID = P.ClinicianID and L.[Primary] = 1 and P.DateOfService >= L.StartDate and (L.EndDate is null or L.EndDate >= P.DateOfService)
        left join tblLookups L2 on L2.Code = L.LicenseTypeID and L2.CategoryID = 48
        left join tblLookups L3 on L3.Code = P.Program and L3.CategoryID = 104
        left join #tmpRates R on R.BillingCodeID = PC.BillingCodeID and R.POS = PC.POS and R.LicenseGroupID = L2.Type and R.Billable = PC.Billable and R.ProviderID = P.Site
             and R.StartDate <= p.DateOfService and R.EndDate >= p.DateOfService
        left join tblBillingCodes BC on BC.ID = PC.BillingCodeID
        left join tblDemographics Dem on Dem.PaceID = P.PaceID
        left join tblIntakes I on I.ID = P.IntakeID
        left join tblReferrals CR on CR.ID = I.ReferralID
        left join tblProviders PP on PP.ID = P.ClinicianID
        left join vwUsers U on U.ID = PP.UserID
        left join tblactivities A on A.extid1 = P.paceid and A.extid2 = P.ID and A.completedDate is null and A.currentlocationid in (select locationid from tbllocations where workflowid = 4) and A.visible = 1 and A.extid4 = 3
        where P.DateOfService >= @StartDate and P.DateOfService <= @EndDate
        and P.Deleted = 0
        and PC.Void = 0
        and (@Status is null or (a.currentlocationID = @Status))
        and (@Program is null or (P.Program in (select Program from #T1)))
        and (@Clinician is null or (P.ClinicianUserID = @Clinician))
        and (@LateEntryOnly = 0 or (P.LateEntry = @LateEntryOnly))
        and ((@Billable =0) or (@Billable = 1 and PC.Billable = 1) or (@Billable = 2 and PC.Billable = 0))
        order by Clinician, DateOfService,Code, POS, MOD1, MOD2 ,ClientName, TimeIn

        END
        Else
        BEGIN

        select distinct
        Isnull(U.LastName,'') + ', ' + IsNull(U.Firstname,'') as Clinician,
        convert(varchar(15),p.DateOfService,101) as DateOfService,
        P.PaceID,
        Dem.LastName + ', ' + Dem.FirstName as ClientName,
        P.ID as ProgressNoteID,
        PC.BillingCodeID,
        PC.ProgressNoteType,
        BC.Code, 
        PC.POS,
        BC.MOD1,
        BC.MOD2,
        Isnull(BC.Code,'') + ' ' + ISnull(PC.POS,'') + ' ' + ISNULL(BC.MOD1,'') + ' ' + ISNULL(BC.MOD2,'') as FullHCPC,
        PC.Units,
        PC.TimeIn,
        PC.TimeOut,
        DateDiff(mi,PC.TimeIn, PC.TimeOut) as Minutes,
        Case when Datediff(mi,PC.TimeIn,PC.TimeOut)/60 > 0 
        then Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut)/60) + 'h ' + Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut) % 60) + 'm' else Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut) % 60) + 'm' end as TimeDesc,
        I.BehavioralHealthCategory,
        case when p.DateOfService > '8/1/13' and PC.BillingCodeID in (3,4) and PC.DOCID is null then 'Log Missing' else convert(varchar(20),PC.DocID) end as TransportationLog,
        L3.Description as Program,
        P.LateEntry,
        a.currentlocation as Status
        from tblProgNotes P
        left join tblProgressNoteCodes PC on PC.ProgressNoteID = P.ID and PC.ProgressNoteType = 1
        left join tblLicensure L on L.ProviderID = P.ClinicianID and L.[Primary] = 1 and P.DateOfService >= L.StartDate and (L.EndDate is null or L.EndDate >= P.DateOfService)
        left join tblLookups L2 on L2.Code = L.LicenseTypeID and L2.CategoryID = 48
        left join tblLookups L3 on L3.Code = P.Program and L3.CategoryID = 104
        left join #tmpRates R on R.BillingCodeID = PC.BillingCodeID and R.POS = PC.POS and R.LicenseGroupID = L2.Type and R.Billable = PC.Billable and R.ProviderID = P.Site
             and R.StartDate <= p.DateOfService and R.EndDate >= p.DateOfService
        left join tblBillingCodes BC on BC.ID = PC.BillingCodeID
        left join tblDemographics Dem on Dem.PaceID = P.PaceID
        left join tblIntakes I on I.ID = P.IntakeID
        left join tblReferrals CR on CR.ID = I.ReferralID
        left join tblProviders PP on PP.ID = P.ClinicianID
        left join vwUsers U on U.ID = PP.UserID
        left join tblactivities A on A.extid1 = P.paceid and A.extid2 = P.ID and A.completedDate is null and A.currentlocationid in (select locationid from tbllocations where workflowid = 4) and A.visible = 1 and A.extid4 = 1
        where DateOfService >= @StartDate and DateOfService <= @EndDate
        and P.Deleted = 0
        and PC.Void = 0
        and (@Status is null or (a.currentlocationID = @Status))
        and (@Program is null or (P.Program in (select program from #T1)))
        and (@Clinician is null or (P.ClinicianUserID = @Clinician))
        and (@LateEntryOnly = 0 or (P.LateEntry = @LateEntryOnly))
        and ((@Billable =0) or (@Billable = 1 and PC.Billable = 1) or (@Billable = 2 and PC.Billable = 0))

        Union All
        select distinct
        Isnull(U.LastName,'') + ', ' + IsNull(U.Firstname,'') as Clinician,
        convert(varchar(15),P.DateOfService,101) as DateOfService,
        P.PaceID,
        Dem.LastName + ', ' + Dem.FirstName as ClientName,
        P.ID as ProgressNoteID,
        PC.BillingCodeID,
        PC.ProgressNoteType,
        BC.Code, 
        PC.POS,
        BC.MOD1,
        BC.MOD2,
        Isnull(BC.Code,'') + ' ' + ISnull(PC.POS,'') + ' ' + ISNULL(BC.MOD1,'') + ' ' + ISNULL(BC.MOD2,'') as FullHCPC,
        PC.Units,
        PC.TimeIn,
        PC.TimeOut,
        DateDiff(mi,pc.TimeIn,pc.TimeOut) as Minutes,
        Case when Datediff(mi,PC.TimeIn,PC.TimeOut)/60 > 0 
        then Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut)/60) + 'h ' + Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut) % 60) + 'm' else Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut) % 60) + 'm' end as TimeDesc,
        I.BehavioralHealthCategory,
        L3.Description as Program,
        case when p.DateOfService > '8/1/13' and PC.BillingCodeID in (3,4) and PC.DOCID is null then 'Log Missing' else convert(varchar(20),PC.DocID) end as TransportationLog,
        P.LateEntry,
        a.currentlocation as Status
        from tblCrisisProgressNotes P
        left join tblProgressNoteCodes PC on PC.ProgressNoteID = P.ID and PC.ProgressNoteType = 2
        left join tblLicensure L on L.ProviderID = P.ClinicianID and L.[Primary] = 1 and P.DateOfService >= L.StartDate and (L.EndDate is null or L.EndDate >= P.DateOfService)
        left join tblLookups L2 on L2.Code = L.LicenseTypeID and L2.CategoryID = 48
        left join tblLookups L3 on L3.Code = P.Program and L3.CategoryID = 104
        left join #tmpRates R on R.BillingCodeID = PC.BillingCodeID and R.POS = PC.POS and R.LicenseGroupID = L2.Type and R.Billable = PC.Billable and R.ProviderID = P.Site
             and R.StartDate <= p.DateOfService and R.EndDate >= p.DateOfService
        left join tblBillingCodes BC on BC.ID = PC.BillingCodeID
        left join tblDemographics Dem on Dem.PaceID = P.PaceID
        left join tblIntakes I on I.ID = P.IntakeID
        left join tblReferrals CR on CR.ID = I.ReferralID
        left join tblProviders PP on PP.ID = P.ClinicianID
        left join vwUsers U on U.ID = PP.UserID
        left join tblactivities A on A.extid1 = P.paceid and A.extid2 = P.ID and A.completedDate is null and A.currentlocationid in (select locationid from tbllocations where workflowid = 4) and A.visible = 1 and A.extid4 = 2
        where P.DateOfService >= @StartDate and P.DateOfService <= @EndDate
        and P.Deleted = 0
        and PC.Void = 0
        and (@Status is null or (a.currentlocationID = @Status))
        and (@Program is null or (P.Program in (select program from #T1)))
        and (@Clinician is null or (P.ClinicianUserID = @Clinician))
        and (@LateEntryOnly = 0 or (P.LateEntry = @LateEntryOnly))
        and ((@Billable = 0) or (@Billable = 1 and PC.Billable = 1) or (@Billable = 2 and PC.Billable = 0))

        Union All
        select distinct
        Isnull(U.LastName,'') + ', ' + IsNull(U.Firstname,'') as Clinician,
        convert(varchar(15),p.DateOfService,101) as DateOfService,
        P.PaceID,
        Dem.LastName + ', ' + Dem.FirstName as ClientName,
        P.ID as ProgressNoteID, 
        PC.BillingCodeID,
        PC.ProgressNoteType,
        BC.Code, 
        PC.POS,
        BC.MOD1,
        BC.MOD2,
        Isnull(BC.Code,'') + ' ' + ISnull(PC.POS,'') + ' ' + ISNULL(BC.MOD1,'') + ' ' + ISNULL(BC.MOD2,'') as FullHCPC,
        PC.Units,
        PC.TimeIn,
        PC.TimeOut,
        DateDiff(mi,pc.TimeIn,pc.TimeOut) as Minutes,
        Case when Datediff(mi,PC.TimeIn,PC.TimeOut)/60 > 0 
        then Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut)/60) + 'h ' + Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut) % 60) + 'm' else Convert(varchar(2),Datediff(mi,PC.TimeIn,PC.TimeOut) % 60) + 'm' end as TimeDesc,
        I.BehavioralHealthCategory,
        case when p.DateOfService > '8/1/13' and PC.BillingCodeID in (3,4) and PC.DOCID is null then 'Log Missing' else convert(varchar(20),PC.DocID) end as TransportationLog,
        L3.Description as Program,
        P.LateEntry,
        a.currentlocation as Status
        from tblPersonalProgressNotes P
        left join tblProgressNoteCodes PC on PC.ProgressNoteID = P.ID and PC.ProgressNoteType = 3
        left join tblLicensure L on L.ProviderID = P.ClinicianID and L.[Primary] = 1 and P.DateOfService >= L.StartDate and (L.EndDate is null or L.EndDate >= P.DateOfService)
        left join tblLookups L2 on L2.Code = L.LicenseTypeID and L2.CategoryID = 48
        left join tblLookups L3 on L3.Code = P.Program and L3.CategoryID = 104
        left join #tmpRates R on R.BillingCodeID = PC.BillingCodeID and R.POS = PC.POS and R.LicenseGroupID = L2.Type and R.Billable = PC.Billable and R.ProviderID = P.Site
             and R.StartDate <= p.DateOfService and R.EndDate >= p.DateOfService
        left join tblBillingCodes BC on BC.ID = PC.BillingCodeID
        left join tblDemographics Dem on Dem.PaceID = P.PaceID
        left join tblIntakes I on I.ID = P.IntakeID
        left join tblReferrals CR on CR.ID = I.ReferralID
        left join tblProviders PP on PP.ID = P.ClinicianID
        left join vwUsers U on U.ID = PP.UserID
        left join tblactivities A on A.extid1 = P.paceid and A.extid2 = P.ID and A.completedDate is null and A.currentlocationid in (select locationid from tbllocations where workflowid = 4) and A.visible = 1 and A.extid4 = 3
        where P.DateOfService >= @StartDate and P.DateOfService <= @EndDate
        and P.Deleted = 0
        and PC.Void = 0
        and (@Status is null or (a.currentlocationID = @Status))
        and (@Program is null or (P.Program in (select program from #T1)))
        and (@Clinician is null or (P.ClinicianUserID = @Clinician))
        and (@LateEntryOnly = 0 or (P.LateEntry = @LateEntryOnly))
        and ((@Billable = 0) or (@Billable = 1 and PC.Billable = 1) or (@Billable = 2 and PC.Billable = 0))
        order by Clinician, DateOfService,Code, POS, MOD1, MOD2 ,ClientName, TimeIn
        END

        drop table #tmpRates
        drop table #T1

【问题讨论】:

  • in 替换为= 然后检查。

标签: sql stored-procedures


【解决方案1】:

将您的查询替换为以下内容:

    set  @SQLQuery = ' select distinct program from tblProgNotes where Program in (' + @Program + ')'

https://msdn.microsoft.com/en-us/library/ms177682.aspx

【讨论】:

  • 现在这个错误导致运行:System.Data.SqlClient.SqlException: Incorrect syntax near ')'。
  • 请提供您传递的输入(@program)
  • set @SQLQuery = 'select distinct DeviceIntID from Rms.Devices where DeviceIntID in (' + CAST(@Program AS VARCHAR(10)) + ')'
  • 另外你不需要创建查询来执行插入临时表
  • string items = " ( "; if (RadComboBox1.CheckedItems.Count > 0) { foreach (RadComboBox1.CheckedItems 中的RadComboBoxItem item) items += item.Value + ","; } items = items .Remove(items.Length - 1); items = items + ")";
猜你喜欢
  • 2021-03-31
  • 2019-07-17
  • 2017-12-08
  • 2014-05-09
  • 2018-05-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多