Category Archive for: .NET Programming with SQL Server

XML Data Type

One of the major programming features of SQL Server is the XMLdata type, With older versions of SQL Server, XMLdata is stored inside a string or a blob. Now XML is a supported data type that allows you to combine SQL queries with XQuery expressions to search within XMLdata. An XMLdata type can be used as a variable,…

Read More →

User-Defined Functions

User-defined functions are somewhat similar to stored procedures. The big difference is that user defined functions can be invoked within SQL statements. Creating User·Defined Functions A CLR user-defined function can be defined with the attribute [SqlFunction], The sample function Hash () converts the string that is passed to a hashed string. The MD5 algorithm that is used…

Read More →

Stored Procedures

SQL Server allows the creation of stored procedures with C#. A stored procedure is a subroutine, and they are physically stored in the database. They definitely are not to be considered a replacement for T-SQL. T-SQL still has an advantage when the procedure is mainly data-driven, Take a look at the T-SQL stored procedure GetCustomerOrders, which returns…

Read More →


This section discusses another namespace, the Microsoft. SqlServer .Server namespace, The Microsoft sqlServer. Server namespace includes classes, interfaces, and enumerations specific to the .NET Framework. However, many of the System. Data, SqlClient classes are also needed within server-side code as you will see, The following table lists the major classes from the Microsoft. SqlServer. Server namespace and their functionality. This…

Read More →

.NET Runtime Host

SQL Server is a host of the .NET runtime. In versions prior to CLR 2.0, multiple hosts already existed to run .NET applications; for example, a host for Windows Forms and a host for ASP.NET. Internet Explorer is another runtime host that allows running Windows Forms controls, SQL Server allows running a .NET assembly inside the SQL Server…

Read More →

.NET Programming with SQL Server

SQLSeryer 2005 was the first version of this database product to host the .NET runtime, In fact, it was the first new version of Microsoft’s SQLServer product in nearly six years, It allows running .NET assemblies in the SQLServer process. Furthermore, it enables you to create stored procedures, functions, and data types with .NET programming languages such as…

Read More →

Back to Top