Posts

Linq Top 10 records

var myResults=(from emp in db.employees order by emp.emp_name where emp.emp_name.startwith("a") select emp).Take(10) http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx

How to create assembly and functions using CLR

http://towardsnext.wordpress.com/2008/12/12/clr-string-titlecase-function-in-sql-server-2005-clr-integration/ With new feature of CLR integration we can provide function with in our assemblies which can be accessed by the user in the TSQL statements. Let us now try to create one title case function. First create one library project in visual studio 2005. Then create one class with one function inside that. using System; using System.Collections.Generic; using System.Text; using System.Data.SqlTypes; using Microsoft.SqlServer.Server; namespace AssemblyFunctions { public partial class MySQLFunctions { [ SqlFunction (IsDeterministic = true , IsPrecise = true )] public static string TitleCase( string data) { string caseData = data.ToString().Substring(0, 1).ToUpper() + data.ToString().Substring(1, data.ToString().Length -1).ToLower(); return caseData; } } } Now we can compile this assembly and keep it at one location. Then move to MSSQL Management Studio and there in query win...

Share point video Link

Share point video Link

How to handle optional parameters for sps?

Create procedure dbo.SearchEmployee ( @Employeename varchar(20), @EmployeeDesig varchar(20), @EmployeeLocation varchar(20), @EmployeeInterest varchar(20) ) as begin set nocount on set @EmployeeName = '%' + @EmployeeName + '%' set @EmployeeDesig = '%' + @EmployeeDesig + '%' set @EmployeeLocation = '%' + @EmployeeLocation + '%' set @EmployeeInterest = '%' + @EmployeeInterest + '%' SELECT EmployeeName from EmployeeMaster (nolock) WHERE (nullif(@EmployeeName, '') is null or EmployeeName like @EmployeeName) and (nullif(@EmployeeDesig, '') is null or EmployeeDesignation like @EmployeeDesig) and (nullif(@EmployeeLocation, '') is null or EmployeeLocation like @EmployeeLocation) and (nullif(@EmployeeInterest, '') is null or EmployeeInterest like @EmployeeInterest) set nocount off end go seaching on name and interests exec SearchEmployee 'shriram', null, null, 'SQL' searching on intere...

http://www.sharepointboost.com/download.html

http://www.sharepointboost.com/download.html

Sharepoint Help Link

Peers Down load Link http://rshelton.com/Tags/SharePoint/default.aspx
File help Link