Tag Archives: SQL

Storing Incomplete (Partial) Dates in SQL Databases

Complete (full) dates and unknown dates can easily be stored in a database table via a nullable date column. What about storing incomplete (partial) dates—where the month, day and/or year is unknown? How do we record July 10 (unknown year) … Continue reading

Posted in Programming | Tagged | 2 Comments

SET FMTONLY ON Changes SQL Control-of-Flow Statement Processing

The other day, my friend Jonathan (of Camenisch Creative) surprised me by pointing out that SET FMTONLY ON changes the way Microsoft SQL Server processes control-of-flow statements (IF…ELSE…END, GOTO, RETURN, etc.) When SET FMTONLY is OFF (the default), SQL Server … Continue reading

Posted in Programming | Tagged | Leave a comment

SSRS: Dataset Field List Is Empty Even After Refresh Fields

Problem: Microsoft SQL Server Reporting Services won’t populate the data set’s field list. Clicking Refresh Fields does nothing—the field list remains empty. Is something wrong with the query? Is there a database permissions issue? Let’s check. Click the Query Designer … Continue reading

Posted in Programming | Tagged , | 5 Comments

SSRS Date/Time Parameter Disabled When Default Value Expression Is Used

After inserting a date/time parameter with an expression as its default value into a Microsoft SQL Server Reporting Services (SSRS) 2008 R2 report, I noticed that the date/time control would be disabled when I’d preview the report. Strange.

Posted in Programming | Tagged , | 2 Comments

SET_ANSI_NULLS Does Not Affect Column-to-Column Comparisons

I learned this fact the hard way the other day! A MERGE statement would not update null values in the destination table with the appropriate non-null data from the source table. My AND clause looked something like “Source.Name != Destination.Name”. … Continue reading

Posted in Programming | Tagged | 1 Comment