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
精彩评论