List sizes of tables in database
This script will list the spaceused by all tables in a database. You can order the output by changing one of the parameters.It also provides totals
2002-10-27
671 reads
This script will list the spaceused by all tables in a database. You can order the output by changing one of the parameters.It also provides totals
2002-10-27
671 reads
This script returns the latest package log for the DTS package specified in the @package_name variable. The interface for viewing DTS package logs through Enterprise Manager is limited in the fact that it doesn't provide textual descriptions of the values for the Step Execute Status and Step Execute Results. This makes it difficult to trace […]
2002-10-22
619 reads
Have seen existing scripts to work out number of days in month. They tend to work out the month, and then whether it's a leap year.Another approach is to take the date passed in, find the first day of the next month, and then use Datadd to take off one day, ie: last day of […]
2002-10-17
418 reads
This SP will only work on SQL Server 2000 and can be placed in your master database. sp_CreateAndExecTableScript is designed to script one table and create an identical table. I designed it to use with DTS packages so that I can create an identical table with a different name, pump data into the table and […]
2002-10-15
2,537 reads
What's this error:Arithmetic overflow error converting IDENTITY to data type int? It was a new one to me, but read on to find out what it means.
2002-10-14
6,977 reads
Ever needed to pause in a SQL script? Or wanted to simulate a long running process for testing? This stored procedure accepts an integer and pauses for that many seconds.
2002-10-04
1,211 reads
Quick and dirty script to generate the required SQL to reinstate permissions on each user object. This can be saved off for DR purposes.
2002-09-24
446 reads
I keep seeing people using CONVERT to convert a date to a varchar in order to do comparison or search queries. I haven't seen a situation yet where DATEDIFF can't be used.
2002-08-29
1,223 reads
Big transactions cause the Tlog to grow.When you do a clean of a large table, the delete statement can cause a very long transactionSometimes it's necessary to prevent this.So we divide one big delete into several little ones.A table with call centre data gets +/- 1-mlj records a day. Every day we run a script […]
2002-08-27
821 reads
Assuming we have the following table (that stores hierarchical data) :CREATE TABLE [staff] ( [employee] [int] NOT NULL , [employee_name] [varchar] (10) NULL , [supervisor] [int] NULL , PRIMARY KEY CLUSTERED ( [employee] ) ON [PRIMARY] , FOREIGN KEY ( [supervisor] ) REFERENCES [staff] ( [employee] ))I ‘ll built a […]
2002-08-23
832 reads
Low-code solutions often accelerate development and make tasks accessible to people who can’t or...
By Steve Jones
Often we find out about a problem reported by a customer after the incident...
Let’s face it, most of the time, you probably don’t want your SQL Server...
Please see the below. The dependencies of a table(the table depends on) shows Partition...
Many job schedulers (e.g., SQL Agent, Airflow, Azure Logic Apps) can report when a...
Comments posted to this topic are about the item The Table Backup
I run this code in SQL Server 2022. What happens?
BACKUP TABLE beercount TO DISK = 'beercount.bak'See possible answers