mar 16 anders jeppesen blog Microsoft CRM Microsoft CRM 2011 Scribe scripts T-SQL

Monitor Microsoft CRM Async log with Scribe

Use the script below to monitor the entries you have in the async log – you can make some rules based on how many days it have been waiting etc. SELECT TOP (10000) MAIN_FilteredAsyncOperation.name, MAIN_FilteredAsyncOperation.operationtypename, MAIN_FilteredAsyncOperation.statuscodename, (SELECT DATEDIFF(DAY, startedonutc, GETDATE()) FROM FilteredAsyncOperation WITH(NOLOCK)WHERE asyncoperationid = MAIN_FilteredAsyncOperation.asyncoperationid) AS DayDurationInQueue ,CONVERT(char(10),startedonutc,126) AS DateEnteredQueue FROM FilteredAsyncOperation AS MAIN_FilteredAsyncOperation…

Read more

mar 13 anders jeppesen blog Microsoft CRM Microsoft CRM 2011 Scribe scripts T-SQL

HOW TO Lookup Scribe CRM adapter error messages in MSMQ based integration

OOTB it’s not possible to see the complete error message from the CRM API if you get an error in your integrations using the Scribe Console API. But the call stack is in the system, hidden inside the SCRIBEINTERNAL database. WHO TO: Open the SCRIBEINTERNAL database from SQL Studio Manager Navigate to views and Query…

Read more

aug 13 anders jeppesen blog Microsoft CRM Microsoft CRM 2011 Scribe scripts T-SQL

Check for missing index on SQL database

To get an indicator on the missing index’s on your SQL you can use the script below. It’s taken from this the MS BlogURL: http://blogs.msdn.com/b/bartd/archive/2007/07/19/are-you-using-sql-s-missing-index-dmvs.aspx SELECT migs.avg_total_user_cost * (migs.avg_user_impact / 100.0) * (migs.user_seeks + migs.user_scans) AS improvement_measure, ‘CREATE INDEX [missing_index_’ + CONVERT (varchar, mig.index_group_handle) + ‘_’ + CONVERT (varchar, mid.index_handle) + ‘_’ + LEFT (PARSENAME(mid.statement,…

Read more

nov 8 blog scripts SQL Reports T-SQL

Validate email address with T-SQL and regular expressions

I needed an easy way of validation email addresses in a SQL database, this is the outcome from it: –Select all records in the entity select id, name, emailaddress from table1 –The except compare the two dataset and output the difference EXCEPT –Select all records in the entity again now with the expression on select…

Read more

jun 10 anders jeppesen code Scribe scripts vbs

VBS Script for moving files to a network share with credentials

Hi, I have made this script who is moving all files in folder A into folder B or a network share. The special thing here is that you are able to logon to the share is you don’t have a trust between domains or if it’s to unix, samba, etc. shares. If the destination and…

Read more

aug 13 Java Javascript Microsoft CRM scripts

Lookup values from parent entities

Hi, This is another way to lookup values from parent entities this will work on all versions of CRM (OnPremise, Hosted, Online) Have fun! /Anders //debugger;var AccountLookUp = crmForm.all.parentcustomerid.DataValue;if (AccountLookUp != null && AccountLookUp != “undefined”) { var AccountID = AccountLookUp[0].id; var Accountxml = “” +”<?xml version=”1.0″ encoding=”utf-8″?>” +”<soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>” +GenerateAuthenticationHeader() +” <soap:Body>”…

Read more

jul 26 Microsoft Microsoft CRM scripts T-SQL tables update

T-SQL Make SLECT statement only on fields with data in

If you need to make a data dump of a table but don’t want to have all the empty fields, they just run this script and it will create the needed select statement that you can copy paste into a new query. DECLARE @TAB_NAME NVARCHAR(MAX) SET @TAB_NAME = ‘SystemUser’ DECLARE @RET_QUERY NVARCHAR(MAX) SET @RET_QUERY =…

Read more

jul 25 Microsoft CRM scripts T-SQL tables update

T-SQL Update fields from another table / database

Use the script below if you need to update data between 2 SQL databases or inside the same database, it’s plain and simple when you get the grib on it: Copy the text bewteen Start code and End code into you SQL Management Studio START CODE: update DESTINATION_DATABASENAME.dbo.AccountExtensionBase –Write the database / table you want…

Read more