sqlchild
sqlchild

Reputation: 9074

CLR in SQL SERVER

I am a bit confused about SQL CLR. When i use the below query , then am i using CLR?

SqlCommand cmd = 
    new SqlCommand(
    "SELECT * from items where name like '" + textBox1.Text + "%'", conn);
SqlDataReader reader = cmd.ExecuteReader();

Please provide a simple explanation of SQL CLR with some real example

Upvotes: 0

Views: 275

Answers (2)

Albin Sunnanbo
Albin Sunnanbo

Reputation: 47048

No, you are using ADO.NET from a .NET program (running on the CLR) to query a SQL database.
Except from the textBox1.Text part this could have been code running in SQL CLR.

SQL CLR is like stored procedures written in c# or VB.NET. The documentation provides a couple of examples.

Upvotes: 4

detroitpro
detroitpro

Reputation: 3913

The context of SQL CLR refers to using managed .NET code as the language for programmability inside your database. If you where to deploy that code to SQL server as a DLL then I believe you would be "using the CLR" in the context of your question.

Upvotes: 0

Related Questions