Get fast-rowcount for all tables in a database
This little query gives the table name and rowcount for each table in the database that its run.
2003-01-30
247 reads
This little query gives the table name and rowcount for each table in the database that its run.
2003-01-30
247 reads
Lets you search all db objects for a string.EXECUTE spFindTextInObjects 'UNION ALL', 1 GOEXECUTE spFindTextInObjects 'XML EXPLICIT'GOEXECUTE spFindTextInObjects 'DECLARE%CURSOR', 1GOEXECUTE spFindTextInObjects '@@IDENTITY', 1GO
2003-01-29
256 reads
I had recent request for a script to list all the views for a database along with the associated tables the columns depend on. It is a rather simple script but as I have not seen a similar one, I thought I would share it with my fellow dbas. It returns information about views specific […]
2003-01-23
455 reads
It is easy enough to detach and reattach databases in SQL 2000 providing you have less than 16 files to attach.I manage some very large databases and these sometimes need to be detached and reattached (i.e. for moving a database file from one volume to another).I have more than 16 files to contend with on […]
2003-01-22
2,868 reads
Something I really hate is typing something repetitive. To prepare for our Disaster Recovery plan, I wrote this script.It is a bit strange in that it requires 2 run iterations to generate the desired result.I use a naming standard for backup files of the form:D_DBName.Bakand a naming standard for database files of the form:DBName_Dx.Mdf for […]
2003-01-22
582 reads
You may be a tidy person who likes to keep naming standards for everything in SQL Server. It is a good practice since it makes generating scripts for everyday DBA tasks a lot simpler. I make all database files follow the following standard:DBName_D1.mdf for primary filegroup dataDBName_I1.ndf for index filegroupDBName_L1.ldf for transaction […]
2003-01-22
288 reads
This isn't a "script" per se - but rather an observation about a common issue in writing scripts.I want to alert SQL programmers to the issues surrounding the use of single-line comments. I try to avoid these whenever possible, and use block comments instead (except, of course, when commenting out the keyword GO).The reason is […]
2003-01-21
276 reads
Unlike shrinking transaction log, shrinking a data file seems to be tough. A lot of people complained about the "shrink database" option in EM not working, or DBCC SHRINKDATABASE not working, or DBCC SHRINKFILE not working. I have found that a data file will eventually shrink given enough try, time and patience. I've put everything […]
2003-01-14
407 reads
2003-01-14
83 reads
This UDF returns the Service Pack versionprint dbo.ServicePackversion()
2003-01-14
102 reads
No Scooby-Doo story is complete without footprints leading to a hidden passage. In SQL...
By James Serra
A bunch of new features for Microsoft Fabric were announced at the Microsoft Fabric Community...
By Steve Jones
I saw an article recently about implicit transactions and coincidentally, I had a friend...
We’re running SQL Server 2019 with database compatibility level 150, and after recent tuning...
Comments posted to this topic are about the item Changing the Recovery Time
Comments posted to this topic are about the item Getting More Time from AI
I want to change the recovery time for a database running on SQL Server 2022. What are my options for setting the value in my ALTER DATABASE statement. If I run this code, what can I use in place of the xxx to define what 12 means?
ALTER DATABASE Finance SET TARGET_RECOVERY_TIME = 12 xxx;See possible answers