ID Path都加個[]看看
Set @Sql = 'select [ID] from SoftClass where [path] like '''+@path+'%'''
Execute(@Sql)

解决方案 »

  1.   

    因为你把引号打错了。Set @Sql = 'select ID from SoftClass where path like "'+@path+'%"'
    改成
    Set @Sql = 'select ID from SoftClass where path like '''+@path+'%'''
    是两个单引,不是一个双引.用双引将会把引号中的字串理解为字段名。
    比如 tb 
    id name
    1  a
    2  b
    select name from tb
    select 'name' from tb
    select "name" from tb
    自己看看区别就知道了。