question

duffyg08 avatar image
duffyg08 asked

#temp tables not working in CMD/C#

Hi guys, Does anyone know if using CMD C# works for temp tables? Is # an escape characters? {Basic example of a bigger query} This doesn't work: instance.vars.query = "IF OBJECT_ID('tempdb..#temp1') IS NOT NULL DROP TABLE #temp1; SELECT distinct dc.customer_usp into #temp1 FROM db.pk_online.dim_customer dc WHERE dc.resident = 'Y' AND dc.customer_status = 'Active' select * from #temp1" This does: SELECT distinct dc.customer_usp FROM db.pk_online.dim_customer dc WHERE dc.resident = 'Y' AND dc.customer_status = 'Active' Thanks!
sql-server-2012c#working-days
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.