小编Roh*_*ade的帖子

错误:未关闭的引号后

WHILE (@7DaysEarlierPartitionIntegerId <= @CurrentPartitionIntegerId)
    BEGIN
        Set @7DaysEarlierPartitionId 
            = CAST(@7DaysEarlierPartitionIntegerId AS char)
        set @sqlCommand 
            = 'Select * from ' 
              + quotename(@RequestUsage_Partition + @7DaysEarlierPartitionId)
              + 'where UserLogin like''r2\rohit.kharade'
        exec(@sqlCommand)
        set @7DaysEarlierPartitionIntegerId 
            = @7DaysEarlierPartitionIntegerId + 1
    END
Run Code Online (Sandbox Code Playgroud)

我收到错误:

字符串 'r2\rohit.kh' 后的非封闭引号。

如何执行 exec 命令 UserLogin =%r2\rohit.kharade%

sql-server t-sql

0
推荐指数
2
解决办法
916
查看次数

标签 统计

sql-server ×1

t-sql ×1