Archive for November, 2011

11/03/11
Fahad Zia
tags:  

List Stored Procedures by Modified Date


SQL Server 2005:

SELECT * FROM sys.objects WHERE type = 'P' ORDER BY modify_date  DESC

SQL Server 2000:

SELECT * FROM sysobjects WHERE type='P' ORDER BY crdate DESC; -- refdate supposedly should be the date modified column but both return the same date

If you notice in SQL 2000, crdate and refdate show the same date so there is no way to sort by date modified with the above query

11/01/11
Fahad Zia
tags:  

InfoPath Forms Services Hidden Field Validation


I was unable to to suppress validation on a hidden field so here is what came up with, which doesn’t look like the best approach but works.
Shown below is the form in which “Employee” text field is mandatory and “Officer” dropdown is only required if “Get Approval” checkbox is true.

The “Section” under “Get Approval” checkbox is an “Optional Section” control with “Default settings” set to “Include the section in the form by default”. And under “Display” tab the “Conditional Formatting” is set as follows:

Note that I did not set “Cannot be blank” for the officer dropdown since this will not let the form submit even if it’s not visible. Instead I created the rules and conditions on the “Submit” button as shown below:

The validation that is set reads:
Submit the form when any of the following is true:

  1. Approval is required and Officer field is not blank
  2. Approval is not required and Employee field is not blank

The screenshots below show the settings.