Outer Join Trouble
Writing outer joins can be more difficult than it appears at first glance. Steve Jones examines this less often used query technique and brings to light a few places where you can lose data.
2006-01-05
18,588 reads
Writing outer joins can be more difficult than it appears at first glance. Steve Jones examines this less often used query technique and brings to light a few places where you can lose data.
2006-01-05
18,588 reads
When programming in T-SQL, the impact of NULL values can be severe in many cases, especially aggregates. New Author Peter Ward brings us a great explanation on how NULLs can impact things like SUM operations.
2005-12-28
11,037 reads
SQL Server 2000 has table valued functions that are very useful in many ways. However when you try to limit results with the ROWCOUNT setting, you can end up with some strange results. Peter He brings us a comprehensive look at some of the unpredictable results that you can get and how to code around them.
2005-12-21
10,143 reads
SQL Server 2000 error handling isn't the most mature system for dealing with unexpected events. It has been much enhanced in SQL Server 2005, but many people will be using SQL Server 2000 for a long time. RAISERROR is one of those functions that can really aid in troubleshooting, but is often underutilized. David Poole brings us some hints on how this can help you out in your code.
2005-11-23
19,600 reads
Selecting a menu structure from a series of tables is pretty easy. If you bound the number of levels in the menu. However if you have potentially variable numbers of levels. Stephen Lasham brings us a new piece on using recursion to select the data.
2005-10-11
8,812 reads
Auditing is becoming more and more important in many SQL Server environments. DBAs are being tasked with setting up, maintaining, and reporting on audit data. Author Leo Peysakhovich brings us one of his solutions to automatically generate an audit trail for your data.
2005-10-10
23,030 reads
Transactions in SQL Server can be very complicated, and are often misunderstood. Don Peterson brings us part 2 of his series on transactions. This part deals with XACT_ABORT, compilation errors and error handling in transactions.
2004-11-24
19,704 reads
In T-SQL you should use the IS NULL keywords to test for a null value. But David Poole runs into a strange gotcha in one of his applications where he is testing for a null value. It's an interesting read following Sherlock Poole around on his hunt to find an error.
2004-07-14
11,703 reads
Two weeks ago Andy challenged the readers of SQLServerCentral.com to figure out a small puzzle. Come see the results for yourself and find out who won some cash!
2001-06-27
4,861 reads
In part one of a two part article, Andy Warren challenges the readers of SQLServerCentral.com to solve a problem involving ADO and SQL Server. Are you up to the challenge?
2001-06-01
4,234 reads
By Steve Jones
This value is something that I still hear today: our best work is done...
By gbargsley
Have you ever received the dreaded error from SQL Server that the TempDB log...
By Chris Yates
Artificial intelligence is no longer a distant concept. It is here, embedded in the...
Hi everyone I am writing an SP where there is logic inside the SP...
Comments posted to this topic are about the item Planning for tomorrow, today -...
We have a BI-application that connects to input tables on a SQL Server 2022...
I try to run this code on SQL Server 2022. All the objects exist in the database.
CREATE OR ALTER VIEW OrderShipping AS SELECT cl.CityNameID, cl.CityName, o.OrderID, o.Customer, o.OrderDate, o.CustomerID, o.cityId FROM dbo.CityList AS cl INNER JOIN dbo.[Order] AS o ON o.cityId = cl.CityNameID GO CREATE OR ALTER FUNCTION GetShipCityForOrder ( @OrderID INT ) RETURNS VARCHAR(50) WITH SCHEMABINDING AS BEGIN DECLARE @city VARCHAR(50); SELECT @city = os.CityName FROM dbo.OrderShipping AS os WHERE os.OrderID = @OrderID; RETURN @city; END; goWhat is the result? See possible answers