Posts

Freebooks sites

You can find really helpful Microsoft .net (ASP.Net, VB.Net, c#.net and AJAX) books pdf at the following link... http://books-pdf.blogspot.com/search/label/ASP.Net http://books-pdf.blogspot.com http://microsoft-java-ebooks.blogspot.com http://freebooksandmagazines.blogspot.com http://www.ebooksboard.com/ http://muralikrishna542.blogspot.com

how to find a text in the Stored Procedure

ALTER PROCEDURE [dbo].[snproc_find_text_in_sp] @StringToSearch varchar(MAX) AS BEGIN SET @StringToSearch = '%' +@StringToSearch + '%' SELECT Distinct SO.Name FROM sysobjects SO (NOLOCK) INNER JOIN syscomments SC (NOLOCK) on SO.Id = SC.ID AND SO.Type = 'P' AND SC.Text LIKE @stringtosearch ORDER BY SO.Name END

Please refer to following update query to recently executed T-SQL query on database.

--Please refer to following update query to recently executed T-SQL query on database. --USE Master SELECT deqs.last_execution_time AS [Time], dest.TEXT AS [Query] FROM sys.dm_exec_query_stats AS deqs CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest ORDER BY deqs.last_execution_time DESC

Good collection of .Net and Programming Resources

Good collection of .Net and Programming Resources Below is a main section, covering most of the programming languages http://www.oneqresources.com/tutorial.php Few other resources in sub-sections are: http://www.oneqresources.com/csharptutorials.php http://www.oneqresources.com/cpptutor.php http://www.oneqresources.com/dot-net-downloads.php

Rows to Columns Using Coalese

view plain copy to clipboard print ? State (Tablename) ----- City (Columnname) ----- Chennai Madurai Coimbatore declare @retstr varchar (8000) select Top 5 @retstr = COALESCE (@retstr + ';' , '' ) + City from State print @retstr

Pagination in Sql Server 2005

Method 1: DECLARE @rowsPerPage int , @pageNum int , @startRow int , @endRow int SET @rowsPerPage = 10 SET @pageNum = 3 SET @startRow = ((@pageNum- 1) * @rowsPerPage)+1 SET @endRow = @startRow + @rowsPerPage -1 SELECT * FROM ( SELECT row_number() OVER ( ORDER BY id) as resultNum, id FROM myTable ) as numberResults WHERE resultNum BETWEEN @startRow AND @endRow Method2: SET @rowsPerPage = 10 SET @pageNum = 3 With SQLPaging As ( Select Top (@rowsPerPage * @pageNum) ROW_NUMBER() OVER ( ORDER BY id) as resultNum, id FROM myTable ) select * from SQLPaging where resultNum > ((@pageNum - 1) * @rowsPerPage)

Find the Text In the StoredProcedure

DECLARE @SEARCHSTRING VARCHAR (255) SELECT @SEARCHSTRING = 'MyTable' SELECT DISTINCT sysobjects .name FROM sysobjects , syscomments WHERE sysobjects .id = syscomments .id -- look for stored procs only AND sysobjects .type = 'P' AND sysobjects .category = 0 -- what you are looking for, what you're looking in AND CHARINDEX (@SEARCHSTRING, syscomments . text )>0