当前位置:网站首页>SQLServer 存储过程传递数组参数
SQLServer 存储过程传递数组参数
2022-07-05 04:45:00 【水杯不满】
问题描述
Create PROCEDURE [dbo].[Ly_Kc_GetKcInfoById]
@strKcId varchar(500)--需传递进来的值为‘1,2,3,4,5’
select * from Table where Id in (@strKcId )
说明Id为Int型
将参数‘1,2,3,4,5’传递进来,执行存储过程会报错.
解决办法:
select * from Table where CHARINDEX(','+cast(Id as varchar(20))+',' , ','[email protected]+',')>0
边栏推荐
- 775 Div.1 C. Tyler and strings combinatorial mathematics
- JVM 原理和流程简介
- WeNet:面向工业落地的E2E语音识别工具
- 2021 electrician cup (the 12th "China Society of electrical engineering Cup" National Undergraduate electrician mathematical modeling) detailed ideas + codes + references
- 【acwing】837. Number of connected block points
- 托管式服务网络:云原生时代的应用体系架构进化
- Sword finger offer 07 Rebuild binary tree
- 函数(易错)
- Neural networks and deep learning Chapter 4: feedforward neural networks reading questions
- English topic assignment (27)
猜你喜欢
[popular science] basic knowledge of thermal design: heat dissipation analysis of 5g optical devices
XSS injection
[groovy] closure (closure parameter list rule | default parameter list | do not receive parameters | receive custom parameters)
Is $20billion a little less? Cisco is interested in Splunk?
函數(易錯)
Special information | finance, accounting, audit - 22.1.23
Setting up redis cluster cluster under Windows
49 pictures and 26 questions explain in detail what is WiFi?
Observable time series data downsampling practice in Prometheus
[groovy] closure (closure call | closure default parameter it | code example)
随机推荐
jmeter -- 分布式压测
Matplotlib draws three-dimensional scatter and surface graphs
Managed service network: application architecture evolution in the cloud native Era
Here comes the Lantern Festival red envelope!
[crampon programming] lintcode decoding Encyclopedia - 1100 strange printer
The 22nd Spring Festival Gala, an immersive stage for the yuan universe to shine into reality
質量體系建設之路的分分合合
Variable category (automatic, static, register, external)
CSDN body auto generate directory
计组笔记(1)——校验码、原补码乘除计算、浮点数计算
Leetcode 222 number of nodes of complete binary tree
Invalid bound statement (not found) in idea -- problem solving
Interface joint commissioning test script optimization V5.0 (end)
[popular science] basic knowledge of thermal design: heat dissipation analysis of 5g optical devices
C26451: arithmetic overflow: use the operator * on a 4-byte value, and then convert the result to an 8-byte value. To avoid overflow, cast the value to wide type before calling the operator * (io.2)
Leetcode hot topic Hot 100 day 33: "subset"
Introduction to RT thread kernel (5) -- memory management
取余操作是一个哈希函数
Hypothesis testing -- learning notes of Chapter 8 of probability theory and mathematical statistics
Manually implement heap sorting -838 Heap sort