ASP.NET (35) SQL (25) JAVASCRIPT (24) HTML (14) STYLE SHEET (6) ASP (4) SCRIPT (1)

Search me out HERE!!

List out last modified procedures and functions in SQL

Use below query to find out last modified stored procedures, functions, views and tables from Sql Server.

SELECT name, create_date, modify_date,type
FROM sys.objects
WHERE type IN ('FN','V','P','U','TF')
AND DATEDIFF(D,modify_date, GETDATE()) < 6
ORDER BY modify_date


Here are different types used in IN clause in WHERE condition:

  • FN – Scalar valued function
  • V – View
  • P – Stored Procedure
  • U – Table
  • TF – Table valued function
DATEDIFF(D,modify_date, GETDATE()) < 6 – It will show the objects modified in last 6 days

Find and Replace in Visual Studio using regular expression

One of the nice feature in all version of visual studio that I would love to use is Find and Replace using regular expression. This feature is very useful while you need to perform any repeating pattern based task. and offcourse it saves a lot time.
Lets take a simple example to understand it. We have list of countries and its code in a excel file or table. We want to create a dropdownlist from it so text field contains Country name and Value field contains Code in it.

The step by step procedure:


Step 1: Select the both columns from excel file an copy it in text file in visual studio. Don’t forget to put cursor at the start.


Step 2: Now click Ctrl+h to open the find replace dialog.  Checkmark the last checkbox 'Use' and select ‘Regular Expression’ from the dropdown. Now we will need to define the regular expression in ‘Find What:’ and ‘Replace with:’ textboxes. You can see them in following screenshot (again i will explain how to define it? and how does it work? in my next post)



Step 3: Click on ‘Replace All’ button on the dialog. and Here is the result we need.

This feature reduces your manual work.