How to check in a sproc if a datetime2 value is the minimum value?

I have a SQL Server 2008 stored procedure that takes a datetime2 parameter. If the user passes in the minimum value I don't want to run part of the sproc. My question is, what is the best way to check if the value passed in is the c# DateTime.MinValue ?

Answers


If you insert the sample DateTime.MinValue value in Database in DateTime2 type. The result will be 0001-01-01 00:00:00.0000000

Validation Part
if @Param != '0001-01-01 00:00:00.0000000'
begin
  -- Your code
end

Need Your Help

Android failed to mkdir() on SD card

java android file storage android-file

I have some code to create/get a folder on SD card:

Convert a UTC time to epoch

python date datetime

I am looking to analyze traffic flow with relation to weather data. The traffic data has a UNIX timestamp (aka epoch), but I am running into trouble with converting the timestamp (in the weather da...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.