Finding The Last Date of a Month
Select dateadd(month, 1 ,getdate()) gives the exact date of next month , then find the day of that date. Now back to that days i.e exactly last date of the given month.
2001-10-14
556 reads
Select dateadd(month, 1 ,getdate()) gives the exact date of next month , then find the day of that date. Now back to that days i.e exactly last date of the given month.
2001-10-14
556 reads
2001-10-11
8,578 reads
Ever forget to commit a transaction and then find out hours later that there is deadlocked transactions all over your database server? Worse yet has one of your coworkers done this to your database server? Never again, this stored procedure will net send the machine that has an open transaction, and send you (The DBA) […]
2001-10-08
9,192 reads
Really simple... it returns a list of stored procedure names that contain the passed in string. Useful for finding all stored procedures that call another specified stored procedure. Call with the following command: exec usp_functions_findinUSP @str='sp_lastmodified'
2001-10-08
2,220 reads
Ever wanted to get rid of users who are sitting idle for long periods of time? Here's a script that removes spids idle for a variable period of time.
2001-10-03
4,523 reads
The SQL Server 7.0 Data Transformation Services (DTS) Object Transfer feature transfers logins and users between two servers, but it does not transfer the passwords for SQL Server authenticated logins. (DTS in Microsoft SQL Server 2000 does transfer passwords.)
2001-10-01
1,669 reads
A fast way to get a quick look at all the log sizes and space used in a real time fashion.
2001-09-25
2,570 reads
Copies mdf files located in a directory on a client and attaches them to the connected server. This is the winning solution to the contest that was presented in an article posted at http://www.sqlservercentral.com/columnists/awarren/reattachingdatabases-somecodeandacontest!.asp. That article shows how to do the same thing using DMO. Wynn Muse is the author of this stored procedure.
2001-09-23
3,616 reads
Here are two stored procedures for enabling and disabling all keys (primary and foreign) for a specified database. It makes sure the database specified is not the system databases and the users session is at the DB to have its keys enables/disabled.
2001-09-19
857 reads
This script runs within a DTS package. It searches the backup directory stored as a global variable in the script and trims all backup files older than some number of days. the script includes logging to the C: drive so you can trace the effects of the script. You need to create the global variables […]
2001-09-12
1,522 reads
By Brian Kelley
Here is a short emotional intelligence (EI) post for today, courtesy of Seth Godin....
By Steve Jones
I was recently trying to handle a simple task with a few AI tools...
A nightly load into sales_fact fails. Ask an orchestrating agent to break down the...
I have a really stupid question... Is there an easy way to search for...
Comments posted to this topic are about the item How to Work with On-Premises...
Comments posted to this topic are about the item Escaping Strings
The STRING_ESCAPE() function requires 2 parameters in SQL Server 2025. The first is a string of text and the second is the type of escape rules being used. What are the options for the second parameter?
See possible answers