Wednesday, March 21, 2012

How to use Sql Servers Temp table in vb.net

There r two types of temporary tables in sql servers
1) Local temporary table (#tablename)
2) Global temporary table(##tablename)

but when i m creating any temp table & using it in .NET it doesn't store all the data..
i am storing data one by one but only last inserted row is visible in that table...

any solution on that...

pls help

Thanks in advance...

Mukund TambeMake sure that you use one connection only, and that you do not close the connection between the inserts. Local temporary tables (#) are deleted when the connection through which they were created are closed. Global temporary tables (##) are deleted when the last connection referencing them are closed.|||Make sure that you use one connection only, and that you do not close the connection between the inserts. Local temporary tables (#) are deleted when the connection through which they were created are closed. Global temporary tables (##) are deleted when the last connection referencing them are closed.
let me check..

thanks a lot roac..|||You may also be a victim of "connection pooling" if you are running in an environment like ASP where you can have many threads sharing access to the same database. Each call to the database needs to stand on its own in a connection pooling environment, you can't depend on what may or may not have happened in a previous call to the database when you use connection pooling.

-PatP|||You have to let us know what you're doing...because it sounds dicey to begin with

Can you write a stored procedure?sql

No comments:

Post a Comment