Hi,
I recently had to reinstall my Visual Studio 2017 & SQL 2019 onto a new laptop, since then I have not been able to get a SQL Statement to work. When I run the Statement in a Query on the SQL Server it produces the result that I would expect. But when I try to use the same Statement in Visual Studio Build Query I am getting the error "The Declare SQL construct or Statement is not supported.
I have reviewed answers to similar questions posted here in this forum, but none seem to apply to my issue.
I am wondering if I have missed something when installing Visual Studio?
Here is an image of the Statement I am trying to use in VS.

Appreciate and thoughts or ideas on what I need to do to get this functioning?
Thanks
PaulG67