当前位置:网站首页>sql 引用变量时第一位的0被去除掉如何处理
sql 引用变量时第一位的0被去除掉如何处理
2022-07-30 06:35:00 【CSDN问答】
sql server 2008 r2
代码:
declare @userid varchar(100)
declare @sql varchar(1000)
set @userid = 01541815191726247754
set @sql = ' select * from test where userid = '''+@userid+ ''''
select @sql
结果:
select * from test where userid = '1541815191726247754'
引用变量@userid 时第一位0被去除掉了,导致查不到数据,这个要怎么处理?
看了网上都是以知道位数为前提的处理方法,但是userid没有固定的位数,无法那样处理
边栏推荐
- mysql设置会话超时时间
- IDEA search plug-in has no results and the solution has been spinning in circles
- 树状数组的基本用法
- selenium模块
- [GO语言基础] 一.为什么我要学习Golang以及GO语言入门普及
- C# uses RestSharp to implement Get, Post requests (2)
- Electron日常学习笔记
- What are the access modifiers, declaration modifiers, and keywords in C#?Literacy articles
- mysql8的my.conf配置文件参考指引
- LeetCode:204. 计数质数
猜你喜欢
随机推荐
Common configuration
C# uses RestSharp to implement Get, Post requests (2)
[GO语言基础] 一.为什么我要学习Golang以及GO语言入门普及
ETL为什么经常变成ELT甚至LET?
How does Redis prevent oversold and inventory deduction operations?
assert
Limit injection record of mysql injection in No. 5 dark area shooting range
Vue2进阶篇-编程式路由导航、缓存路由组件、路由的激活与失活
防止资源导出失败
包含min函数的栈(js)
Derivative Operations on Vectors and Derivative Operations on Vector Cross and Dot Products
interface
Go 使用 freecache 缓存
WinForm(一):开始一个WinForm程序
golang: Gorm configures Mysql multiple data sources
动态规划专栏
理解和熟悉递归中的尝试
redis的内存淘汰策略
What are the access modifiers, declaration modifiers, and keywords in C#?Literacy articles
IDEA搜索插件无结果一直转圈圈的解决办法









