Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Not able to set the value for @sql

$
0
0

declare @ sql varchar(150),

set @sql = select To_x,Subject,DATEADD(SECOND, Create_Date-14400, ' Jan 1, 1970') from AR_System_Email_Messages where Subject like '%not acknowledged from past%' and Create_Date > DATEDIFF(s, '1970-01-01 00:00:00', dateadd(d,-10,GETDATE()))

The query mentioned is working fine, but while assigning the output value to the @sql, its throwing error. Please helm me to modify the query so that i can assign the output to  the @sql.


Do let me know if you need any further clarification on my request.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>