Miscellaneous

Technical Article

Scheduler SP with Sample Log Creation/Exec Scripts

  • Script

I created this SP for use with our morning DW builds. I use it to manage the execution of multiple jobs. It first starts up to a configureable number of jobs, monitors these jobs until one (or more) complete, and then starts additional jobs as needed. If any jobs fail, it will run the "transaction […]

You rated this post out of 5. Change rating

2002-01-06

234 reads

Technical Article

Shrink DBs - Job Script

  • Script

I'm posting this job script because it gets used by my scheduler script. It simply enumerates through each database on the server, and then executes a DBCC SHRINKDATABASE. The only wrinkle here is that I have it do a quick check to make sure that certain jobs are not already running.

You rated this post out of 5. Change rating

2002-01-04

1,180 reads

Technical Article

Transaction Logs - Job Script

  • Script

I've included this job script, because it is used by the scheduler scripts that I've also posted. This job is a little more involved than most may need... It first checks to see if certain jobs are running. Is so, it waits for a while, and then checks again. After that it drops the existing […]

You rated this post out of 5. Change rating

2002-01-04

1,142 reads

Technical Article

Check Jobs Current State

  • Script

I created this script in an attempt to better automate many different jobs that run each morning, as part of a datawarehouse build. I use it to not only tell me what jobs are currently running (so that I can manage how many I would like to run at a time), but what happened to […]

(2)

You rated this post out of 5. Change rating

2002-01-03

1,281 reads

Technical Article

Port from Oracle's TRANSLATE Function

  • Script

Here is a port from the Oracle's TRANSLATE function to T-SQL. It gets three arguments: a string to be searched, a string with a set of characters to be found and replaced, and another set of characters as the replacements. Example: SELECT dbo.TRANSLATE('ABCDE', 'BD', 'CE') It will return 'ACCEE'.

(2)

You rated this post out of 5. Change rating

2002-01-03

480 reads

Blogs

Finding the Last Last Name in SQL: #SQLNewBlogger

By

I wrote a piece on the new SUBSTRING in SQL Server 2025 and got...

SQL Server 2025 GAs Today

By

If you aren’t watching the Ignite keynotes today, then you might have missed the...

Run SQL Server 2025 and SQL Server Management Studio on macOS Tahoe

By

Short version You want to get this running as fast as possible. Do these...

Read the latest Blogs

Forums

Email change does not work

By rjkoala1

I changed my email address in Edit Profile page, but it has no effect...

The case for "Understanding our business" training

By David.Poole

Comments posted to this topic are about the item The case for "Understanding our...

Specifying the Collation

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Specifying the Collation

Visit the forum

Question of the Day

Specifying the Collation

I am dealing with issues on my SQL Server 2022 instance related to collation. I have an instance collation of Latin1_General_CS_AS_KS_WS, but a database collation of Latin1_General_CI_AS. I want to force a few queries to run with a specified collation by using code like this:

DECLARE @c VARCHAR(20) = 'Latin1_General_CI_AS'

SELECT  p.PersonType,
        p.Title,
        p.LastName,
        c.CustomerID,
        c.AccountNumber
 FROM Person.Person AS p
 INNER JOIN Sales.Customer AS c
 ON c.PersonID = p.BusinessEntityID
 COLLATE @c
Will this solve my problem?

See possible answers