开发者

nvarchar to SQL

can I convert nvarchar(max) to sql ?

like here

SELECT [RecTime], [Name],
   CAST(CASE WHEN 
    -- <logics>
    EXEC([SQL]) -- Or NvarcharToSql ...
    -- </logics>
   THEN 1 ELSE 0 END AS bit) AS [Value]
FROM EventInc开发者_如何学JAVAidentsStates
GROUP BY [RecTime], [Name], [SQL]

and sql contains sql logics ...


No. You can't embed a stored proc call or EXEC in a SELECT

You can use a scalar udf is you don't care about performance, but not if it is dynamic SQL

You'd have to loop or some such: but it isn't clear what you're trying to do. You asked how to do your chosen solution, rather than stating your problem/requirement

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜