Posts

Showing posts from June, 2011

Data scrubbing using SQL functions for SQL Server

Many a times, it is required to scrub the data before it is used in development environments as the data may be sensitive and cannot be shared with the vendors. The  below SQL functions can be used to scrub the data. --Creating the User defined function    CREATE FUNCTION getRandomText(@sLength TINYINT)   RETURNS VARCHAR(10)   AS                 BEGIN                  DECLARE @counter TINYINT                  DECLARE @nextChar CHAR(1)                  DECLARE @randomString VARCHAR(50)                    SET @sLength=10                  SET @counter = 1                  SET @randomString = ''                  WHILE @counter <= @sLength                  BEGIN                  SELECT @nextChar = CHAR(ROUND((SELECT r FROM getRand) * 93 + 33, 0))                  IF ( (ASCII(@nextChar) between 65 and 90)  or (ASCII(@nextChar) between 97 and 122) )                    BEGIN                    SELECT @randomString = @randomString + @nextChar                    SET @counter = @co

Convert fetchXML to SQL Query in MSCRM 4.0

If for some sane reasons if fetchxml needs to be converted to a SQL Query in MSCRM 4.0, it is possible. It actually requires the below DLL's which are avilable in the folder Server\setup Microsoft.Crm.dll, Microsoft.Crm.Platform.Server.dll and Microsoft.Crm.Reporting.dll The code looks as below : Microsoft.Crm.BusinessEntities.ExecutionContext myContext = new Microsoft.Crm.BusinessEntities. ExecutionContext (OrganizationId from the context); myContext.OnBeginRequest(UserId, false); Microsoft.Crm.Reporting.ReportQueryBuilder myreportQueryBuilderObj = new ReportQueryBuilder(); string Query = myreportQueryBuilderObj.BuildReportQuery(fetchXml, myContext); The query will be returned as string. The Query is not readable but it works, -:)

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline

In web.config file,  system.webServer tag, for the validation element set the value of the attribute   validateIntegratedModeConfiguration to false. This infact helped in my case.