Pages

Saturday, October 25, 2008

IntelliSense in SQL Server 2008

Microsoft has finally released a SQL Server product that includes IntelliSense for writing TSQL statements. In this article, Tim Chapman shows the ins and outs of using IntelliSense in SQL Server 2008.

If you are used to working in the Microsoft Development Environment, you've likely grown accustomed to using IntelliSense, a feature which reads internal metadata and provides a list of available objects and properties while you are developing.

However, this feature has yet to be available to the TSQL language inside the SQL Server Management Studio. I am happy, though, to say that SQL Server 2008 finally includes TSQL IntelliSense, which provides a listing of available objects to use in SELECT statements, DML statements, and stored procedure calls, along with numerous other operations.

Check out the below link
http://www.zdnetasia.com/techguide/storage/0,39045058,62047009,00.htm

C# Syntax in SQL Server 2008

One Major advantage with Microsoft is, it always tries make life easier. See if you are C# developer and want to join SQL team then its pretty easy.

SET @i += 5

Look at the above code, it's C# syntax on incremeting the variables.

Its kool.....

In-line Variable assignment in SQL Server 2008

In SQL Server 2008, there is one feature called In-line variable assignment. Before i get into the details lets lets look at the below code.


>>>In SQL Server 2005
DECLARE @MyEmpNumber INT
SET @MyEmpNumber = 24
SELECT @MyEmpNumber AS EmpNumber
GO
>>>In SQL Server 2008
DECLARE @MyEmpNumber INT = 24
SELECT @MyEmpNumber AS EmpNumber
GO

In 2005 we can't assign the value at the variable declaration, where in 2008 you can do. This will reduce lot of code in T-SQL.

Njoy with this new feature.

XML Features in SQL Server 2008

Microsoft introduced XML-related capabilities in Microsoft SQL Server 2000 with the FOR XML and OPENXML Transact-SQL keywords, which enabled developers to write Transact-SQL code to retrieve a query result as a stream of XML and to shred an XML document into a rowset. SQL Server 2005 extended these XML capabilities significantly with the introduction of a native xml data type that supports XSD schema validation, XQuery-based operations, and XML indexing. SQL Server 2008 builds on the XML capabilities of previous releases and provides enhancements to meet the challenges that customers have faced when storing and manipulating XML data in the database.

Check out the below link for more information
http://download.microsoft.com/download/a/c/d/acd8e043-d69b-4f09-bc9e-4168b65aaa71/WhatsNewSQL2008XML.doc

Saturday, October 4, 2008

Pass Parameters in ASP.NET

I'm trying to pass information between pages. I'm trying to avoid using
QueryString and Session variables. so what is the way to pass the parameters from one page to another using Server.Transfer???

Can i use context or viewstate? which is better??

This is common question in various forums. My answer is

You can't send viewstate between pages. context items are sent as part of the server.transfer. After the server.transfer, context items are disposed.

COUNT Group Function

Returns the number of items in a group. COUNT_BIG works like the COUNT function. The only difference between the two functions is their return values. COUNT_BIG always returns a bigint data type value. COUNT always returns an int data type value.

@@ROWCOUNT

Rowcount_big() is a function introduced in SQL Server 2000. It returns the number of affected records in the form of a bigint number.

This is same @@ROWCOUNT but the difference is interms of the output. This retuns Int and Rowcount_BIG() returns BIG Int.

RAND() Function

SQL Server has a built-in function that generates a random number, the RAND() mathematical function. The RAND math function returns a random float value from 0 through 1. It can take an optional seed parameter, which is an integer expression (tinyint, smallint or int) that gives the seed or start value.

To use it, you can simply do a simple SELECT, as follows:

SELECT RAND() AS Rand_Num

The result generated by this SELECT statement is as follows (note that your results may be different from the value shown here, hence the name random)

RandomNumber
---------------------
0.34344339282376501

Microsoft MVP Award

Oct 1st was one of the happiest days in my life. You want to know the reason



Dear Vijaya Krishna Kadiyala,

Congratulations! We are pleased to present you with the 2009 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others.

The Microsoft MVP Award provides us the unique opportunity to celebrate and honor your significant contributions and say "Thank you for your technical leadership."

Toby Richards
General Manager
Community Support Services

Wednesday, October 1, 2008

MVC Pattern

What is MVC Pattern:

The main purpose of using MVC pattern is to decouple the GUIfrom the Data.
It also gives the ability to provide multiple views for the same data.MV pattern separates in to three important sections.

> Model: this section is specially for maintaining data.It is actually where yourbusiness logic,querying database,database connection etc.is actually implemented.

>Views: Displaying all or some portions of data,or probably different vciew of data.
View is responsible for look and feel,sorting,formatting etc.

>Controller: In ASP.NET the behind code is the controller as the evetns are hendled by that part.Controller communicates both with Model as well as with View