将整数传递给sql server [英] passing integer to sql server

查看:74
本文介绍了将整数传递给sql server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

这是我在Querry中传递两个整数变量的地方

它没有执行,当我传递两个整数值时,它会执行

有什么问题

hi!

here is my querry where i am passing two integers variables

its not executing and when i pass two integers values the it execute

whats the problem

("SELECT [val1] FROM [asd].[dbo].[asede] where md_int = myInt1 AND rd_int = myInt2)


但是当我传递值时,它的工作正常


but when i pass values its workin properly

SELECT [val1] FROM [asd].[dbo].[asede] where md_int = 1 AND rd_int = 2)

推荐答案

如果要传递变量,则必须以这种方式传递.
If you are passing variables you have to pass it in this way.
("SELECT [val1] FROM [asd].[dbo].[asede] where md_int = " + myInt1+ " AND rd_int = " + myInt2)


这篇关于将整数传递给sql server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆