SQLTeam.com | Weblogs | Forums

Trying to see how view data in temp tables


#1

Hi,
I do not think this is possible, but my boss wants to see the data in a trigger. I know when you insert data it is kept in the cache as inserted. And I believe this kept in a temp table in tempDB. But I believe it is only kept while the session is alive. However, I see the tables in there and every time I do an insert it creates another one. If anyone knows how I can see the data if that is possible. Please elt me know.

Thank you


#2

i have no idea how SQL Server implement the inserted and deleted. But I don't think it is in the tempdb. If you want to view the value in inserted and deleted, you can create a table that is identical structure as your base table and in your TRIGGER, insert into this table from the inserted and/or deleted. Basically that is how we usually implement an audit trail on the table