tempdb

Why does my tempdb reset permissions when the server is rebooted?

我的梦境 提交于 2021-02-07 11:40:11
问题 The past two times we have rebooted our sql server, our website has gone down. The reason appears to be because the tempdb is getting recreated and the ASPState user is losing permission to read/write to the tempdb (it is an ASP site and session data is stored in the sql server) This was not a problem until about two weeks ago. Does anyone know how I can prevent the sql server from resetting tempdb permissions after a reboot? Or why this only started happening recently? We are using MS SQL

SQL Server 2005 Memory Pressure and tempdb writes problem

元气小坏坏 提交于 2020-01-31 03:31:47
问题 We are having some issues with our production SQL Server. Server: Dual Quad Core Xeon 8 GB RAM Single RAID 10 Array Windows 2003 Server 64-bit SQL Server 2005 Standard 64-Bit There is about 250MB of free RAM on the machine right now. SQL Server has around 6GB of RAM, and our monitoring software says that only half of the SQL Server allocated RAM is actually being used. Our main database is approximately 20GB, with about 12GB being used with any frequency. Our tempdb is at 700MB. Both are

Unallocate unused space in tempdb sql server

浪子不回头ぞ 提交于 2020-01-07 04:16:05
问题 any script in sql server to find space used by temporary tables + the database name where that temp table was created in tempdb? The size of my tempDb has grown up to 100 gb and i am not able to recover the space and am unsure what is occupying so much of space. Thanks for any help. 回答1: Temporary tables always gets created in TempDb. However, it is not necessary that size of TempDb is only due to temporary tables. TempDb is used in various ways Internal objects (Sort & spool, CTE, index

How tempDB works?

浪尽此生 提交于 2019-12-30 04:05:14
问题 I am trying to understand the tempDB and following are the doubts popping in my mind. What is the lifetime of data in tempDB ? Say a query is doing some Order By and uses tempDB for performing that. After this query finishes, someone else also executes a query which utilizes the tempDB . Will the second query find records written by first query in the tempDB or will they be deleted? Are there any visible tables created inside the tempDB by the Sql Engine? How can I know which temporary table

Failure SQL query insufficient disk space

白昼怎懂夜的黑 提交于 2019-12-21 03:49:39
问题 Msg 1101, Level 17, State 10, Line 12 Could not allocate a new page for database 'TEMPDB' because of insufficient disk space in filegroup 'DEFAULT'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup. What does this mean in plain English. 回答1: I've found that the normal cause of such explosive growth of TempDB is a query, either ad hoc or in a stored procedure, that has an

Temp Table collation conflict - Error : Cannot resolve the collation conflict between Latin1* and SQL_Latin1*

情到浓时终转凉″ 提交于 2019-12-20 10:24:02
问题 I can't update temp table. This is my query CREATE TABLE #temp_po(IndentID INT, OIndentDetailID INT, OD1 VARCHAR(50), OD2 VARCHAR(50), OD3 VARCHAR(50), ORD VARCHAR(50), NIndentDetailID INT, ND1 VARCHAR(50), ND2 VARCHAR(50), ND3 VARCHAR(50), NRD VARCHAR(50), Quantity DECIMAL(15,3)) INSERT INTO #temp_po(IndentID, OIndentDetailID, OD1, OD2, OD3, ORD) SELECT ID.IndentID, ID.IndentDetailID, ID.D1, ID.D2, ID.D3, ID.RandomDimension FROM STR_IndentDetail ID WHERE ID.IndentID = @IndentID UPDATE t SET

Local vs Global temp tables - When to use what?

末鹿安然 提交于 2019-12-13 17:27:21
问题 I have a report which on execution connects to the database with my_report_user username. There can be many end-users of the report. And in each execution a new connection to the database will be made with my_report_user (there is no connection pooling) I have a result set which I think can just be created once (may be on the first run of the report) and other report executions can just reuse that stuff. Basically each report execution should check whether this result set (stored as temp

Tempdb Full When Querying Distinct Count Of All Tables

浪尽此生 提交于 2019-12-12 03:38:53
问题 ORIGINAL PROBLEM I have created a custom script to retrieve data from a remote SQL server into our local copy in our office. I had some issues with the script where selected tables had some data inserted twice, thus creating duplicates. I know that for all the tables in all databases there should be no duplicates. This issue has made me paranoid that other tables may have had this problem historically, and therefore I'd like to verify this. SOLUTION I have created a SQL script to insert the

Do CTEs use any space in tempdb?

故事扮演 提交于 2019-12-10 02:21:38
问题 Do CTEs use any space in tempdb or does it use memory exclusively? I've tagged the question with both mssql 2005 and 2008 as I use both. 回答1: I'll try not to copy/paste MSDN It doesn't matter. A CTE is independent of query execution: it is only a language construct. Think of it as neat derived table or subquery. This means that except for recursive CTEs (see later), all CTEs can be coded inline. If you use the CTE code once, it is for readability . If you use the CTE twice or more, then it is

When a variable is declared in a T-SQL stored procedure, is it kept in memory or tempdb?

不羁的心 提交于 2019-12-06 23:55:44
问题 We're trying to optimize some of our T-SQL stored procedures to reduce tempdb contention, but I can't figure out how non-table variables are stored by SQL server: What about simple data types like INT and DATETIME? It feels like they'd live in memory. What about VARCHARs/VARCHAR(MAX)? A regular VARCHAR could live in memory, but a VARCHAR(MAX) might need to use tempdb for its storage. Table variables are stored in tempdb. These I'm not really interested in though. The MSDN article on tempdb