Jack spent two days manually checking his database upgrade script for mistakes. Then his boss sent him the license key to their newly purchased SQL Compare. “It’s so fast” he sobbed as tears of joy quietly plopped into his beer at 6, hours before he thought he’d be able to leave the office that night. Read more about SQL Compare.
There times when you need to write T-SQL code that creates specific T-SQL Code and executes it. When you do this you are creating dynamic T-SQL code. When writing dynamic T-SQL you need to understand how dynamic code opens the possibilities for a SQL injection attack. More »
Dynamic Management Views (DMVs) are a significant and valuable addition to the DBA's troubleshooting armory, laying bare previously unavailable information regarding the under-the-covers activity of your database sessions and transactions. More »
A lot of numbers that we use everyday such as Bank Card numbers, Identification numbers, and ISBN codes, have check digits. As part of the routine data cleansing of such codes we must check that the code is valid- but do we? Dwain Camps shows how it can be done in SQL in such a way that it could even be used in a constraint, and keep bad data out of the database. More »
Regardless of the type of development (application or reporting) that you are performing on SQL Server. There are 5 items... More »
Question of the Day
Today's Question (by Sean Pearce):
What will the following query return? (the number of rows, or the error)
COUNT(*) AS Result
ON UNICODE(CAST(d1.name AS VARCHAR(255)) COLLATE Latin1_General_CS_AS) = UNICODE(CAST(d2.name AS NVARCHAR(255)) COLLATE SQL_Latin1_General_CP850_BIN)
d1.database_id <= 4
AND d2.database_id <= 4;
Think you know the answer? Click here, and find out if you are right.
We keep track of your score to give you bragging rights against your peers.
This question is worth
2 points in this category: TSQL.
We'd love to give you credit for your own question and answer.
To submit a QOTD, simply log in to the
When a SQL Server database is operating smoothly and performing well, there is no need to be particularly aware of the transaction log, beyond ensuring that every database has an appropriate backup regime and restore plan in place. When things go wrong, however, a DBA's reputation depends on a deeper understanding of the transaction log, both what it does, and how it works. An effective response to a crisis requires rapid decisions based on understanding its role in ensuring data integrity.
Comparing records to previous records in query
Here is a sample table:
I'm looking to write a query that will only return the invoices for each customer that...
This newsletter was sent to you because you signed up at SQLServerCentral.com.
Feel free to forward this to any colleagues that you think might be interested.
If you have received this email from a colleague, you can register to receive it here.