Incorrect syntax near ']'.?

后端 未结 3 569
误落风尘
误落风尘 2021-01-16 04:58

I have done some debugging on my sql and I cant figure out the maddening error I am getting I have narrowed it down to a couple of lines which I cant see what the problem is

3条回答
  •  一生所求
    2021-01-16 05:00

    You are missing about 3 opening brackets as far as i can tell at

    select @cols2 = (Select Stuff((Select '],[ 
    

    and

     (' + @cols2 + ']' // -> either [' + @cols2 + ']' or (' + @cols2 + ')'
    

    and

     + ') SELECT ' + @cols2 + ']'  -- -> either ') SELECT [' + @cols2 + ']'  or ') SELECT (' + @cols2 + ')' 
    

提交回复
热议问题