0
votes
1answer
80 views

Why TRUNCATE TABLE cannot use four-part name?

I was trying to truncate a table as the following: TRUNCATE TABLE [servername].[dbname].[schema].[table] I got error: object doesn't exist or you don't have permissions. However, if I remove ...
0
votes
1answer
337 views

VarChar to NVarChar causing truncate error

I am importing some data from a temporary table which has a column defined as VARCHAR(150). The destination tables column is defined as NVARCHAR(200). I'm using an INSERT INTO statement, but when I ...
0
votes
1answer
560 views

Does TRUNCATE TABLE affects isolation level in Sql Server?

As I am working on the project which has SQL SERVER as a database....I'm maintaining isolation level in my project where I enabled snapshot isolation level for my project.... As I have to make some ...
4
votes
1answer
2k views

Safe way to truncate SQL Server Error Log

We are running out of space. What is the safe way to clear the error log?
14
votes
2answers
1k views

Why does DELETE leave a lingering effect on performance?

At the end is a test script for comparing the performance between a @table variable and a #temp table. I think I've set it up correctly - the performance timings are taken outside of the ...
4
votes
1answer
215 views

What factors prevent and delay TRUNCATE command?

I had a quite large table, perhaps a 50M rows and I had to truncate it. Usually truncate is really fast but in this case it took hours to complete. What are the factors that can prevent truncate ...
53
votes
3answers
6k views

Why use both TRUNCATE and DROP?

In the system I work on there are a lot of stored procedures and SQL scripts that make use of temporary tables. After using these tables it's good practice to drop them. Many of my colleagues (almost ...