Compatibility Level (Tips SQL Server)

Posted on Updated on

This post is intended to include the steps to migrate and change basic version of SQL SERVER 2005 data on 2014

It’s simple to make a BACKUP of Full aging database (SQL 2005), do the RESTORE of the database on the target server (Data Log & Database).

However consider changing the COMPATILITY LEVEL on the 2014 base,

ALTER DATABASE database_name 
SET COMPATIBILITY_LEVEL = { 90 | 100 | 110 | 120 }

Note : 120 is the compatibility level for SQL SERVER 2014

Link :

Policy Management & Tips

Posted on Updated on

It is interesting how implement code standards for stored procedures in Sql Server, stored procedures system are prefixed with “sp_”, for our user stored procedures, let the prefix of “usp_”, this is done with Policy Management (see SSMS – the object explorer, root).


Right-click on Policy Management and select New Condition, Type a name and condition as well as the body of your condition, we have decided to select the Name filter expression LIKE (‘usp_%’).


The next step is to create a policy associated with this codition, right-click Policy Management and select New Policy, select the Check Condition list, the condition created previously, the evaluation mode must be set to “On change: prevent prevention “, the default mode is” on Demand “and policies can not be enabled in this mode, for the Target, make sure you select all the databases and all stored procedures.


SQL Server – Slow Finish

Posted on Updated on

As part of optimizing your SQL queries, if you want to line of code to include the execution plan, drag this instruction before execution.


If you want to optimize the recovery of your data in an environment with a default isolation level of Read Committed or SERIALIZBLE, slide this instruction before execution.


As part of query optimization, you can associate a clean SQL query execution plan for you so to override the behavior of the query optimizer, see reference Plan in SQL Server Management Studio, you can create your SEEK FORCE clauses on your favorite index etc.

link :

You can sometimes just be an update statistics 🙂

For the database novice, the positioning of the index is very important and is based on real data collecting tools (Production Environment)

As for the SQL Server after try: Database Engine Tuning Advisor, included in SSMS since the 2012 version.


Astuces SQL Server

Posted on Updated on

This note aims to put the focus on database issues

How to increase the performance of a view by saving the data to disk?

Create a cluster view (clustered).


cancel or not a transaction inside stored procedure, for example, if an error occurs at a treatment


How to solve the fragmentation problem index?

Use Rebuild or Reorganize index

The result is obtained with function sys.dm_db_index_physical_stats.

Below results  :  

avg_fragmentation_in_percent : The percent of logical fragmentation (out-of-order pages in the index).

fragment_count : The number of fragments (physically consecutive leaf pages) in the index.

avg_fragment_size_in_pages : Average number of pages in one fragment in an index.

If avg_fragmentation_in_percent is greater than 5% and less than 30%

                => ALTER INDEX REORGANIZE

If avg_fragmentation_in_percent value is greater than 30%


Tips Net

Posted on Updated on

Below is a set of frequently asked questions as part of a .Net development platform, this post is also inspired some topics discussed in the Microsoft Best Practise
How to validate the compliance of a development compared to an architecture with a Build? (Ultimate License Requirements)

Create diagram Layer empty, move layers from solution on diagram and add dependencies,

Create Gated CheckIn Build (Based on Shelveset), and in arguments of Build add : /p:ValidateArchitecture=true

How to detect copy and paste source code? (VS Prerequisites 2013)

Use Analyse Solution for Code Clones available under the section ANALYSIS

How to force the update of SSRS reports in a TFS platform (available under the Portal Server )?

Access to Administration console TFS, select Reporting tab, click on Start Rebuild link

Diagnosing a proxy TFS source control ?

Use web service ProxyStatistics available on application layer


Tips .Net

Posted on Updated on

Below is a set of frequently asked questions as part of a development .Net platform associated with TFS infrastructure, this post is also inspired on topics of Best Practise Microsoft:
How to set the distribution of a series of tests as they run?

Define Weighting property of test agent 

How to reuse test cases fairly easily?

Use the Clone feature Test Plan on a root test suite

How to configure an access TFS url for your site?

Using TFS administration console and set the property in the section URL Notification Change URIs

How to recover accidentally deleted files in TFS Source Control?

Go to the Tools section, select Options, and click the link Show deleted items in the Source Control Explorer, right-click and select the option Undelete

How to export a complete test case suites beyond WIQL requests?
Use Apis Test Management, below some snippets to operate.

List the active test plans with filter end date

ITestPlanCollection testPlanCollection = projet.TestPlans.Query("Select * from TestPlan where PlanState = 'Active' AND EndDate < ‘2015-10-22’ ");
Retrieve the results of the execution of a test case

ITestManagementService testManagementService = teamProjectCollection.GetService<ITestManagementService>();

// Get run
IEnumerable<ITestRun> testRunList = testManagementService.QueryTestRuns(string.Format("select * From TestRun where TestRunID={0} AND IsAutomated=0", runId));

// Get first
ITestRun testRunTarget = testRunList.FirstOrDefault();

//Get results
ITestCaseResultCollection restCaseResultCollection = testRunTarget.QueryResults();

How Builds interrupt for a change process and run them later, once the finished modification?

Pausing set the property on the General tab of the Build definition, the builds are accumulated in a queue processing

To Build Not Finished