简单问题,asp中sql语句的写法,求教
set rs=conn.execute( "select top 1 * from type2 where zds= "&zds& " and class=0 order by id desc ")
"zds "原来类型是int的,这段语句可以正常运行,后来改成了nvarchar,一运行就cpu占用100%。知道大概是SQL语句的问题,但不知怎么修改,向大家求教。
另外, "zds "这个字段的数据都是类似A(BB)100-0000这样的,用nvarchar是否合适?谢谢!
------解决方案--------------------set rs=conn.execute( "select top 1 * from type2 where zds= ' "&zds& " ' and class=0 order by id desc ")
字符型应该这样写吧