Adding tempdb items on startup in SQL Server
问题 How could I add some items to the tempdb anytime SQL Server starts up? I'm no expert at this, but our ASP SessionState is stored in the DB and for some reason the tempdb items used for the session state get dropped anytime the server restarts. Not only do I need to recreate the items, but I also have to recreate the User mappings to tempdb. I have a script that does it, but I can't figure out how to run it on SQL startup -- Use TempDB use tempdb go -- Create Temp tables if they don't exist IF