sql server 2008 - Conversion failed when converting the varchar value ' SELECT ' to data type int - Stack Overflow

PHOTO EMBED

Thu Sep 15 2022 18:40:28 GMT+0000 (UTC)

Saved by @javicinhio #sql

DECLARE @selectsql nvarchar(4000),
DECLARE @cnt int

SELECT @selectsql = N' SELECT ' + CAST(@cnt AS NVARCHAR(10)) + N'= COUNT(*) FROM Vwbckup' 
content_copyCOPY

https://stackoverflow.com/questions/13607076/conversion-failed-when-converting-the-varchar-value-select-to-data-type-int