Accessing sql server temporary table from asp.net
What I am missing to get data from temporary table. This is showing error like Invalid object name #emp. Please help me I am using Asp.net.
Dim sqlcmd = New SqlCommand("select * into #emp from employees", conn) sqlcmd.ExecuteNonQuery() sqlcmd = New SqlCommand("select * from #emp", conn) Dim dr As SqlDataReader = sqlcmd.ExecuteReader
See Above query is working fine and data is going into temporary table. but it is not selecting again through second one query.
Try to use Global Temporary table instead of Local Temporary tabel like.. ##emp
you can Just use StoreProcedure which has all the Sql statement you want to execute and return your desired Recordset.