SQLCMD to export data in txt file
SQLCMD is one of many methods to export your database data to some text file
2016-10-12 (first published: 2016-09-27)
22,206 reads
SQLCMD is one of many methods to export your database data to some text file
2016-10-12 (first published: 2016-09-27)
22,206 reads
DBA many a times need to shrink the log files if that grows very large. Though I am not recommending to do it daily or often but if space is an issue and you want to release space to OS, you may use the script.
2016-10-11 (first published: 2016-09-22)
970 reads
If you have any requirement to extract next 100 sequential date from a present date, you can use the below script. You can change the @datetimeformat value and the output will appear in the same format.
2016-10-10 (first published: 2016-09-26)
539 reads
2016-10-07 (first published: 2016-09-20)
1,582 reads
If you have a requirement to enable email notification to all the SQL Jobs, then you may use my script.
2016-10-06 (first published: 2016-09-20)
1,093 reads
Checks currently running sessions and blocking queries with session information
2016-10-05 (first published: 2016-09-16)
820 reads
2016-10-04 (first published: 2016-09-19)
495 reads
Server principal 'xx\yy' has granted one or more permission(s). Revoke the permission(s) before dropping the server principal. (Microsoft SQL Server, Error: 15173). If you are gett
2016-10-03 (first published: 2016-09-16)
3,189 reads
One way to calculate how many minutes a person has worked considering holidays and shifts, being given starting and ending date / time
2016-09-29 (first published: 2016-09-08)
623 reads
This Simple script will help to do a Server wide search for an object name or usage of a String in Object Code like Function, Procedure, Views
2016-09-26 (first published: 2016-08-25)
479 reads
By Steve Jones
I caught this interesting item over on Pinal Dave’s blog: Eleven Interview Questions that...
By Hemantgiri
I use color-coded connections in SSMS to distinguish Production, Pre-Production, UAT, and Development. But...
WhatsApp CS 628218520154 Jl. Suryopranoto No.40, RT.12/RW.7, Petojo Utara, Kecamatan Gambir, Kota Jakarta Pusat,...
WhatsApp CS 628218520154 Jl. Pegangsaan Timur No.1, Cikini, Kec. Menteng, Kota Jakarta Pusat, Daerah...
WhatsApp CS 628218520154 Jl. Pintu Air Raya No.36 Q, RT.6/RW.1, Ps. Baru, Kecamatan Sawah...
I have some data in a SQL Server 2025 database. It looks like this for the dbo.Customer table:
CustomerID CustomerName PreferredName 1 Steve Steve 2 Andy Andy 3 Brian Brian 4 Allan Allan 5 Devin Devin 6 Steve Steve 7 Sally SallyI want to detect which names have a single trailing space. The CustomerName is a varchar() and the PreferredName is a CHAR(). Does this query detect the problem rows?
SELECT
CustomerID,
CustomerName,
PreferredName
FROM Customer
WHERE CustomerName <> RTRIM(CustomerName)
OR PreferredName <> RTRIM(PreferredName); See possible answers