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
281 reads
This little query gives the table name and rowcount for each table in the database that its run.
2003-01-30
281 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
276 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
487 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,894 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
600 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
314 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
298 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
421 reads
2003-01-14
105 reads
This UDF returns the Service Pack versionprint dbo.ServicePackversion()
2003-01-14
125 reads
By Steve Jones
Next week I’m at VS Live in San Diego (register and join me) and...
Ten years ago today, I filmed a Pluralsight Play by Play on open source...
By Steve Jones
It’s time for T-SQL Tuesday again and this is a great prompt to start...
Comments posted to this topic are about the item Stored Procedures for Server-Level Object...
Comments posted to this topic are about the item Databricks Genie Spaces for SQL...
Comments posted to this topic are about the item The Costs of Multiple Platforms
I have this data in a table in a SQL Server 2025 database:
EmailAddressID EmailAddress 7 dylan0@ADVENTURE-WORKS.COM 8 Diane1@ADVENTURE-WORKS.COMIf I run this query, which row(s) are returned?
SELECT top 10 * FROM person.EmailAddress WHERE REGEXP_LIKE(EmailAddress, '^d') AND BusinessEntityID IN (7,8)See possible answers