Questions tagged [tempdb]

138 questions
3
votes
4 answers

Using a SQL #tempdb to databind() to ListBox

I am creating a webpage in which I have a series of pairs ListBoxes. In each pair there is a source (containing many options) in which you can then select an option (or multiple) and add it to the second listbox. I have some permanent tables…
Hub3rt
  • 113
  • 1
  • 10
3
votes
4 answers

Why are temporary tables not removed from tempdb in SQL Server?

I have created one stored procedure with 7 temporary tables and each temp table is dropped at the end of their own work. I am calling the SP from one web service and same web service we are used for different instance. I have dropped every temp…
Brijesh Patel
  • 2,901
  • 15
  • 50
  • 73
3
votes
1 answer

Temp DB full in SQL Server

The issue is this: I have a wrapper stored procedure that contains a bunch of other stored procedures. It looks something like this: Wrapper: exec procedure1 exec procedure2 exec procedure3 Each of the procedures creates a temp table that…
Deep grewal
  • 99
  • 2
  • 5
3
votes
2 answers

A very big size of tempdb

I have a spring project, when I start the server a named file 'tempdb' is created in the sql server directory, the size of this file is too big (reaches 8G) I like to know why this file is created? is there a way to reduce its size? Thanks in…
Akino
  • 303
  • 1
  • 4
  • 16
3
votes
2 answers

How to select temporary tables in Temporary Tables

Currently, I have some temp tables as this format "#A0089D2C", "#A0232241" How could I select them to see what are its data? I tried these queries as below: Select * from #A0089D2C Select * from tempdb.dbo.#A0089D2C But I got the error: Database…
user3011414
  • 119
  • 1
  • 2
  • 10
3
votes
1 answer

TempDB usage SQL Server 2012

We have a 60 GB production database in my new organization. We run closely 500 reports overnight from this DB. I notice that all the report scripts create tables in TempDB and then populate the final report. TempDB size is 6 GB. There is no…
3
votes
1 answer

Entity Framework and SQL Server temp tables

We have a legacy application which we are moving to C#, and I would like to use Entity Framework (EF) for data access. SQL Server 2012 is the database, and currently I am using EF 5.0. The original application did a lot of data intensive processing.…
Clinemi
  • 906
  • 6
  • 20
  • 33
3
votes
2 answers

SQL Server: Recovery model effect on TempDB

Does the recovery model of a database effect the size of the tempdb.mdf? We have a database which involves a lot of processing and bulk inserts. We are having problems with the tempdb file growing to extremely large sizes (over 70 gb). The database…
ctrlShiftBryan
  • 27,092
  • 26
  • 73
  • 78
3
votes
2 answers

Large query increases TempDB

I have huge query on my SQL 2005 Server. This have to be run once everyday but when this query runs temp db grows from 2GB to 48GB. What is the best way top optimize or find the reason why tempdb is growing when this query adds/updates on 80K…
THEn
  • 1,920
  • 3
  • 28
  • 35
2
votes
4 answers

SQL Server tempdb permanent tables use cases

Are there any use cases for permanent tables in tempdb database ? By permanent I mean not using # or ## but creating a real table in tempdb. I know that restarting the sql service will wipe the tempdb, but would this practice be bad for any other…
Denis Biondic
  • 7,943
  • 5
  • 48
  • 79
2
votes
1 answer

Large SQL query filling tempdb needs optimising

I have a rather large SQL query which the majority of which has come from a Business Objects SQL export which must be replicated on SQL Server for reporting purposes. The view is now complete and runs however due to the mass amount of clauses is…
JsonStatham
  • 9,770
  • 27
  • 100
  • 181
2
votes
4 answers

SQL Concatenation filling up tempDB

We are attempting to concatenate possibly thousands of rows of text in SQL with a single query. The query that we currently have looks like this: DECLARE @concatText NVARCHAR(MAX) SET @concatText = '' UPDATE TOP (SELECT MAX(PageNumber) + 1 FROM…
Nate Noonen
  • 1,371
  • 9
  • 19
2
votes
3 answers

Physical tables in TempDB getting deleted automatically

In our solution we are creating some physical tables in "tempDB" for an activity. But recently we are facing an issue where these physical tables are getting deleted automatically. We would like to know the possible reasons/scenario behind this…
Prakazz
  • 421
  • 1
  • 8
  • 21
2
votes
2 answers

Facing Could not allocate a new page for database 'TEMPDB' because of insufficient disk space in filegroup 'DEFAULT'

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…
Navin
  • 53
  • 1
  • 1
  • 11
2
votes
1 answer

Why does ALTER TABLE ... ALTER COLUMN ... fill the version store in TempDB

I had to change a BIGINT column in a large table from nullable to non-nullable. ALTER TABLE my.Table ALTER COLUMN myColumn BIGINT NOT NULL Running this in our UAT and RC environments took around 3 hours with low levels of concurrent activity. Both…
Rhys Jones
  • 5,348
  • 1
  • 23
  • 44
1
2
3
9 10