Tooltip of the month Part 2 Enable cmdshell

This is a small tutorial how to enable CMDShell in SQL Server.

In version SQL 2005 xp-cmdshell is turned off by default.

To enable xp-cmdshell there are 2 ways of doing so: sp_configure command or the Surface Area Configuration tool, to use sp_configure run the following script in Mgmt Studio:
EXEC sp_configure ‘show advanced options’, 1
GO
RECONFIGURE WITH OVERRIDE
GO
EXEC sp_configure ‘xp-cmdshell’, 1
GO
RECONFIGURE WITH OVERRIDE
GO
EXEC sp_configure ‘show advanced options’, 0 *

or use the Surface Area Configuration tool

Start -> Programs –> select the Microsoft SQL Server 2005 program group and fire up the Surface Area Configuration tool (SQL Server 2005 Configuration Tools)

Now, click on xp-cmdshell in the tree menu at the left and then click on “Enable xp-cmdshell” and click “Apply.” Xp-cmdshell is now enabled.

To determine the Windows account use xp_cmdshell ‘whoami.exe’

Back to basics: Entity Framework from scratch part 1

Let me first introduce to you the Entity Framework, this is an object relational mapping (ORM) framework for the .net Framework

The power of Entity Framework is that you can safely use your data from your database creating a semi virtual object database within your application so changes are not directly in your database.

Using the nosql eliminates the need for converting data to and from the database, as the data is stored in its original object representation and relationships are directly represented, instead of building breath taking views.

Why entity framework, you ask me? After we took so much effort in presenting you the nosql, i find nosql to be a great timesaver, but when it comes to larger amounts of data that needs to be stored, or existing data in a database can soon become to heavy for Nosql.

Let’s say we want to build an application for a animal hospital and collect all our client and list their names, and type of animals and how long they have been a client of ours since we started in 2001.

We have 3 tables: Contact, animal and animaltype and build the following query:

This is still a small query but you can imagine if you need typical information from the database, the structure can become very heavy. Especially if you are using specific data for one department.

The logical database schemes do not always meet the application needs, for they are often shared for other applications running on the database, like Enterprisesystems. So often the database model does not relate to the application datamodel.

The entity framework contains a datamodel and design and runtime services so you can define your applicationdata and interact, isolate and play with it on abstract level.

In the next part I will give you an example of the use of entity framework