Scalability and Performance Enhancements in SQL Server 2012

March 20, 2012

The SQL Server product group has made significant modifications to the existing SQL Engine to improve scalability and Performance associated with the SQL Server Database Engine. Some of the main enhancements that allow organizations to improve their SQL Server workloads include the following:

Columnstore Indexes More and more organizations have a requirement to deliver Breakthrough and predictable performance on large data sets to stay competitive. SQL Server 2012 introduces a new in-memory, columnstore index built directly in the relational engine. Together with advanced query-processing enhancements, these technologies provide blazing-fast performance and improve queries associated with data warehouse workloads by 10 to 100 times. In beta tests customers have experienced a 400 percent improvement in performance.

Partition Support Increased to dramatically boost scalability and performance associated with large tables and data warehouses, SQL Server 2012 now supports up to 15,000 partitions per table by default. This is a significant increase from the previous version of SQL Server, which was limited to 1000 partitions by default. This new expanded support also helps enable large sliding-window scenarios for data warehouse maintenance.

Online Index Create, Rebuild, and Drop Many organizations running mission-critical workloads use online indexing to ensure their business environment does not experience downtime during routine index maintenance. With SQL Server 2012, indexes containing varchar(max), varchar(max), and varbinary(max) columns can now be created, rebuilt, and dropped as an online operation. This is vital for organizations that require maximum uptime and concurrent user activity during index operations.

Achieve Maximum Scalability with Windows Server 2008 R2 Windows Server 2008 R2 is built to achieve unprecedented workload size, dynamic scalability, and across-the-board availability and reliability. As a result, SQL Server 2012 can achieve maximum scalability when running on Windows Server 2008 R2 because it supports up to 256 logical processors and 2 terabytes of memory in a single operating system instance.

0

What is WCF

January 14, 2012

Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application. An endpoint can be a client of a service that requests data from a service endpoint. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data.

A few sample scenarios include:

• A secure service to process business transactions.
• A service that supplies current data to others, such as a traffic report or other monitoring service.
• A chat service that allows two people to communicate or exchange data in real time.
• A dashboard application that polls one or more services for data and presents it in a logical presentation.
• Exposing a workflow implemented using Windows Workflow Foundation as a WCF service.
• A Silverlight application to poll a service for the latest data feeds.
While creating such applications was possible prior to the existence of WCF, WCF makes the development of endpoints easier than ever. In summary, WCF is designed to offer a manageable approach to creating Web services and Web service clients.

Features of WCF

WCF includes the following set of features.

• Service Orientation

One consequence of using WS standards is that WCF enables you to create service oriented applications. Service-oriented architecture (SOA) is the reliance on Web services to send and receive data. The services have the general advantage of being loosely-coupled instead of hard-coded from one application to another. A loosely-coupled relationship implies that any client created on any platform can connect to any service as long as the essential contracts are met.

• Interoperability

WCF implements modern industry standards for Web service interoperability.

• Multiple Message Patterns

Messages are exchanged in one of several patterns. The most common pattern is the request/reply pattern, where one endpoint requests data from a second endpoint. The second endpoint replies. There are other patterns such as a one-way message in which a single endpoint sends a message without any expectation of a reply. A more complex pattern is the duplex exchange pattern where two endpoints establish a connection and send data back and forth, similar to an instant messaging program.

• Service Metadata

WCF supports publishing service metadata using formats specified in industry standards such as WSDL, XML Schema and WS-Policy. This metadata can be used to automatically generate and configure clients for accessing WCF services. Metadata can be published over HTTP and HTTPS or using the Web Service Metadata Exchange standard.

• Data Contracts

Because WCF is built using the .NET Framework, it also includes code-friendly methods of supplying the contracts you want to enforce. One of the universal types of contracts is the data contract. In essence, as you code your service using Visual C# or Visual Basic, the easiest way to handle data is by creating classes that represent a data entity with properties that belong to the data entity. WCF includes a comprehensive system for working with data in this easy manner. Once you have created the classes that represent data, your service automatically generates the metadata that allows clients to comply with the data types you have designed.

• Security

Messages can be encrypted to protect privacy and you can require users to authenticate themselves before being allowed to receive messages. Security can be implemented using well-known standards such as SSL or WS-SecureConversation.

• Multiple Transports and Encodings

Messages can be sent on any of several built-in transport protocols and encodings. The most common protocol and encoding is to send text encoded SOAP messages using is the HyperText Transfer Protocol (HTTP) for use on the World Wide Web. Alternatively, WCF allows you to send messages over TCP, named pipes, or MSMQ. These messages can be encoded as text or using an optimized binary format. Binary data can be sent efficiently using the MTOM standard. If none of the provided transports or encodings suit your needs you can create your own custom transport or encoding.

• Reliable and Queued Messages

WCF supports reliable message exchange using reliable sessions implemented over WS-Reliable Messaging and using MSMQ.

• Durable Messages

A durable message is one that is never lost due to a disruption in the communication. The messages in a durable message pattern are always saved to a database. If a disruption occurs, the database allows you to resume the message exchange when the connection is restored. You can also create a durable message using the Windows Workflow Foundation (WF).

• Transactions

WCF also supports transactions using one of three transaction models: WS-AtomicTtransactions, the APIs in the System.Transactions namespace, and Microsoft Distributed Transaction Coordinator.

• AJAX and REST Support

REST is an example of an evolving Web 2.0 technology. WCF can be configured to process “plain” XML data that is not wrapped in a SOAP envelope. WCF can also be extended to support specific XML formats, such as ATOM (a popular RSS standard), and even non-XML formats, such as JavaScript Object Notation (JSON).

• Extensibility

The WCF architecture has a number of extensibility points. If extra capability is required, there are a number of entry points that allow you to customize the behavior of a service.

0

Web.Config Transformation Features in Visual Studio 2010

December 17, 2011

Introduction

Web.config files typically include settings that have to be different depending on which environment the application is running in. For example, you might have to change a database connection string or disable debugging when you deploy a Web.config file. For Web application projects, ASP.NET provides tools that automate the process of changing (transforming) Web.config files when they are deployed.

For each environment that you want to deploy to, you create a transform file that specifies only the differences between the original Web.config file and the deployed Web.config file for that environment.

A transform file is an XML file that specifies how the Web.config file should be changed when it is deployed. Transformation actions are specified by using XML attributes that are defined in the XML-Document-Transform namespace, which is mapped to the xdt prefix. The XML-Document-Transform namespace defines two attributes: Locator and Transform. The Locator attribute specifies the Web.config element or set of elements that you want to change in some way. The Transform attribute specifies what you want to do to the elements that the Locator attribute finds.

The following example shows the contents of a transform file that changes a connection string and replaces the customErrors element:

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <connectionStrings>
    <add name="MyDB" 
      connectionString="value for the deployed Web.config file" 
      xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
  </connectionStrings>
  <system.web>
    <customErrors defaultRedirect="GenericError.htm"
      mode="RemoteOnly" xdt:Transform="Replace">
      <error statusCode="500" redirect="InternalError.htm"/>
    </customErrors>
  </system.web>
</configuration>

The root element of a transform file must specify the XML-Document-Transform namespace in its opening tag, as shown in the preceding example. The Locator and Transform elements themselves are not reproduced in the deployed Web.config file.

This following sections provide reference information about the syntax to use in transform files.

Locator Attribute Syntax

Each of the following sections explains the syntax for one Locator attribute.

Condition

Specifies an XPath expression that is appended to the current element’s XPath expression. Elements that match the combined XPath expression are selected.

Syntax

Locator="Condition(XPath expression)"

Example

The following example shows how to select connection string elements whose name attribute value is oldname or a providerName attribute whose value is oldprovider. In the deployed Web.config file, the selected elements are replaced with the element that is specified in the transform file.

<configuration xmlns:xdt="...">
  <connectionStrings>
    <add name="AWLT" connectionString="newstring"
       providerName="newprovider"
       xdt:Transform="Replace" 
       xdt:Locator="Condition(@name='oldname'
         or @providerName='oldprovider')" />
  </connectionStrings>
</configuration>

The effective XPath expression that is applied to the development Web.config file as a result of the specified Condition expression is the following:

configuration/connectionStrings/add[@name='AWLT' or @providerName='System.Data.SqlClient']

This expression is a result of combining the implicit XPath condition for the current element (configuration/connectionStrings) with the expression that is specified explicitly.

Match

Selects the element or elements that have a matching value for the specified attribute or attributes. If multiple attribute names are specified, only elements that match all the specified attributes are selected.

Syntax

Locator=”Match(comma-delimited list of one or more attribute names)”

Example

The following example shows how to select the connection string add element that has AWLT in the name attribute in the development Web.config file. In the deployed Web.config file, the selected element is replaced with the add element that is specified in the transform file.

<configuration xmlns:xdt="...">
  <connectionStrings>
    <add name="AWLT" connectionString="newstring"
       providerName="newprovider"
       xdt:Transform="Replace" 
       xdt:Locator="Match(name)" />
  </connectionStrings>
</configuration>

XPath

Specifies an absolute XPath expression that is applied to the development Web.config file. (Unlike Condition, the expression that you specify is not appended to the implicit XPath expression that corresponds to the current element.)

Syntax

Locator="XPath(XPath expression)"

Example

The following example shows how to select the same elements that are selected by the preceding example for the Condition keyword.

<configuration xmlns:xdt="...">
  <connectionStrings>
    <add name="AWLT" connectionString="newstring"
       providerName="newprovider"
       xdt:Transform="Replace" 
       xdt:Locator="XPath(configuration/connectionStrings[@name='AWLT'
         or @providerName='System.Data.SqlClient'])" />
  </connectionStrings>
</configuration>

Transform Attribute Syntax

Each of the following sections explains the syntax for one Transform attribute.

Replace

Replaces the selected element with the element that is specified in the transform file. If more than one element is selected, only the first selected element is replaced. For an example of how to use the Replace keyword, see the examples for the Locator attributes.

Syntax

Transform="Replace"

Insert

Adds the element that is defined in the transform file as a sibling to the selected element or elements. The new element is added at the end of any collection.

Syntax

Transform="Insert"

Example

The following example shows how to select all the connection strings in the development Web.config file. In the deployed Web.config file, the specified connection string is added to the end of the collection.

<configuration xmlns:xdt="...">
  <connectionStrings>
    <add name="AWLT" connectionString="newstring"
       providerName="newprovider"
       xdt:Transform="Insert" />
  </connectionStrings>
</configuration>

InsertBefore

Inserts the element that is defined in the transform XML directly before the element that is selected by the specified XPath expression. The XPath expression must be an absolute expression, because it is applied to the development Web.config file as a whole; it is not appended only to the current element’s implicit XPath expression.

Syntax

Transform="InsertBefore(XPath expression)"

Example

The following example shows how to select the deny element that denies access to all users, and then inserts an allow element before it that grants access to administrators.

<configuration xmlns:xdt="...">
  <authorization>
    <allow roles="Admins"
      xdt:Transform="InsertBefore(/configuration/system.web/authorization/deny[@users='*'])" />
  </authorization>
</configuration>

InsertAfter

Inserts the element that is defined in the transform XML directly after the element that is selected by the specified XPath expression. The XPath expression must be an absolute expression, because it is applied to the development Web.config file as a whole; it is not appended to the current element’s implicit XPath expression.

Syntax

Transform="InsertAfter(XPath expression)"

Example

The following example shows how to select the allow element that grants access to administrators, and inserts a deny element after it that denies access to a specified user.

<configuration xmlns:xdt="...">
  <authorization>
    <deny users="UserName"
      xdt:Transform="InsertAfter
        (/configuration/system.web/authorization/allow[@roles='Admins'])" />
  </authorization>
</configuration>

Remove

Removes the selected element. If multiple elements are selected, removes the first element.

Syntax

Transform="Remove"

Example

The following example shows how to select all the connection string add elements in the development Web.config file. In the deployed Web.config file, only the first connection string element is removed.

<configuration xmlns:xdt="...">
  <connectionStrings>
    <add xdt:Transform="Remove" />
  </connectionStrings>
</configuration>

RemoveAll

Removes the selected element or elements.

Syntax

Transform="RemoveAll"

Example

The following example shows how to select all the connection strings in the development Web.config file. In the deployed Web.config file, all the elements are removed.

<configuration xmlns:xdt="...">
  <connectionStrings>
    <add xdt:Transform="RemoveAll" />
  </connectionStrings>
</configuration>

RemoveAttributes

Removes specified attributes from the selected elements.

Syntax

Transform="RemoveAttributes(comma-delimited list of one or more attribute names)"

Example

The following example shows how to select all the compilation elements in the development Web.config file. (Because there can be only one compilation element in the configuration file, you do not have to specify a Locator attribute.) In the deployed Web.config file, the debug and batch attributes are removed from the compilation element.

<configuration xmlns:xdt="...">
  <compilation 
    xdt:Transform="RemoveAttributes(debug,batch)">
  </compilation>
</configuration>

SetAttributes

Sets attributes for selected elements to the specified values. The Replace transform attribute replaces an entire element including all of its attributes. In contrast, the SetAttributes attribute enables you to leave the element as it is but change selected attributes. If you do not specify which attributes to change, all of the attributes that are present in the element in the transform file are changed.

The SetAttributes transform affects all selected elements. This is different from the Replace transform attribute, which affects only the first selected element if multiple elements are selected.

Syntax

Transform="SetAttributes(comma-delimited list of one or more attribute names)"

Example

The following example shows how to select all the compilation elements in the development Web.config file. (Because there can be only one compilation element in the configuration file, you do not have to specify a Locator attribute.) In the deployed Web.config file, the value of the compilation element’s batch attribute is set to false.

<configuration xmlns:xdt="...">
  <compilation 
    batch="false"
    xdt:Transform="SetAttributes(batch)">
  </compilation>
</configuration>

Omitting Locator Attributes

Locator attributes are optional. If you do not specify a Locator attribute, the element to be changed is specified implicitly by the element that the Transform attribute is specified for. In the following example, the entire system.web element is replaced, because no Locator attribute is specified to indicate otherwise.

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.web xdt:Transform="Replace">
    <customErrors defaultRedirect="GenericError.htm"
      mode="RemoteOnly">
      <error statusCode="500" redirect="InternalError.htm"/>
    </customErrors>
  </system.web>
</configuration>

Using Transform and Locator Attributes on Separate Elements

A Transform attribute does not have to be set in the same element as a Locator element. You can specify a Locator element on a parent element in order to select elements whose child elements you want to work with. You can then specify a Transform attribute in a child element in order to apply a change to the children.

The following example shows how to use the Locator attribute to select location elements for the specified path. However, only elements that are children of the selected location elements are transformed.

<configuration xmlns:xdt="...">
  <location path="C:\MySite\Admin" xdt:Locator="Match(path)"> 
    <system.web>
      <pages viewStateEncryptionMode="Always"
        xdt:Transform="SetAttributes(viewStateEncryptionMode)" />
    </system.web> 
  </location> 
</configuration>

If you specify a Locator attribute but you do not specify a Transform attribute in the same element or in a child element, no changes are made.

Note

A Transform attribute on a parent element can affect child elements even if no Transform is specified for them. For example, if you put the attribute xdt:Transform=”Replace” in the system.web element, all the elements that are children of the system.web element are replaced with the content from the transform file.

0

Online QR Code Generator

November 27, 2011

QR Code
A QR code (abbreviated from Quick Response code) is a type of matrix barcode (or two-dimensional code) first designed for the automotive industry. More recently, the system has become popular outside of the industry due to its fast readability and comparatively large storage capacity. The code consists of black modules arranged in a square pattern on a white background. The information encoded can be made up of any kind of data (e.g., binary, alphanumeric, or Kanji symbols).

Encryption

Although encrypted QR codes are not very common, there are a few implementations. An Android app, for example, manages encryption and decryption of QR codes using DES algorithm (56 bits).Japanese immigration use encrypted QR codes when placing visas in passports.

Error correction

Example of a QR code with artistic embellishment that will still scan correctly thanks to error correction.
Codewords are 8 bits long and use the Reed–Solomon error correction algorithm with four error correction levels. The higher the error correction level, the less storage capacity. The following table lists the approximate error correction capability at each of the four levels:

Level L

7% of codewords can be restored.

Level M

15% of codewords can be restored.

Level Q

25% of codewords can be restored.

Level H

30% of codewords can be restored.

Due to the design of Reed–Solomon codes and the use of 8-bit codewords, an individual code block cannot be more than 255 codewords in length. Since the larger QR symbols contain much more data than that, it is necessary to break the message up into multiple blocks. The largest possible block size is never used, though. The QR specification defines the block sizes so that no more than 15 errors can be corrected within each block. This limits the complexity of certain steps in the decoding algorithm. The code blocks are then interleaved together, making it less likely that localized damage to a QR symbol will overwhelm the capacity of any single block.

Thanks to error correction, it is possible to create artistic QR codes that still scan correctly, but contain intentional errors to make them more readable or attractive to the human eye, as well as to incorporate colors, logos and other features into the QR code block.

Encoding

The format information records two things: the error correction level and the mask pattern used for the symbol. Masking is used to break up patterns in the data area that might confuse a scanner, such as large blank areas or misleading features that look like the locator marks. The mask patterns are defined on a 6×6 grid that is repeated as necessary to cover the whole symbol. Modules corresponding to the dark areas of the mask are inverted. The format information is protected from errors with a BCH code, and two complete copies are included in each QR symbol.

The message data is placed from right to left in a zigzag pattern. In larger symbols, this is complicated by the presence of the alignment patterns and the use of multiple interleaved error-correction blocks.

Use the below button to generate the QR Code Online.

Data:

0

Get Object Names Based on Parameter

November 16, 2011

If we now the parameter name and want to know the Objects using that parameter then in that case we can use the below stored procedure to retrive the Object Names

/***********************************************************************
* Author : V.U.M.Sastry Sagi
* Date   : 11/16/2011
* Purpose: Returns all Objects including SPs and Functions based on
           given parameter
***********************************************************************/
CREATE PROCEDURE GetObjectNamesBasedOnParameter ( @prameter VARCHAR(100) )
AS
    BEGIN
        SELECT  dbo.sysobjects.name AS ObjName ,
                dbo.sysobjects.xtype AS ObjType ,
                dbo.syscolumns.name AS ColName ,
                dbo.syscolumns.colorder AS ColOrder ,
                dbo.syscolumns.length AS ColLen ,
                dbo.syscolumns.colstat AS ColKey ,
                dbo.systypes.xtype
        FROM    dbo.syscolumns
                INNER JOIN dbo.sysobjects ON dbo.syscolumns.id = dbo.sysobjects.id
                INNER JOIN dbo.systypes ON dbo.syscolumns.xtype = dbo.systypes.xtype
        WHERE   ( dbo.syscolumns.name = @prameter )
                AND ( dbo.systypes.status <> 1 )
        ORDER BY dbo.sysobjects.name ,
                dbo.syscolumns.colorder 
           
          
    END
0