Thursday, June 11, 2009

SQL SERVER DATATYPE Implict Conversion

Original Path

Another good Path

Data Types (Transact-SQL)

The data type DECIMAL and NUMERIC contains scalar value.
So when convert to this type we have to do an explicit convert
and then cast to the type DECIMAL or NUMERIC.


eg.




DECLARE @myval decimal (5, 2)

SET @myval = 193.57

PRINT CAST(CAST(@myval AS varbinary(20)) AS decimal(10,5))

Things to be Noted

DECLARE @val INTEGER

SET @val = 1000

PRINT CAST(1000 AS DECIMAL(5,1))
PRINT CAST(1000 AS DECIMAL(4,1))

--IF the PRECISION should be greater than or equal to the size of the
--value after subtracting the scalar value from the precision.
--DECIMAL(Fixed PRECISION, scale numbers) Otherwise this error occurs.
--Arithmetic overflow error converting VARCHAR to data type NUMERIC.

DECLARE @test AS INT
SET @test = 10000000

--PRINT CAST(@test AS DATETIME)
--The above commented query gives the error
--Arithmetic overflow error converting expression TO data type datetime.
--This TIME we have TO USE CONVERT AND NOT cast.

PRINT CONVERT(CHAR(8), DATEADD(second, @test, ''), 114)

Links That I Like

Inside ASP.NET Runtime

Inside IIS and ASP.NET


Inside ASP.NET Runtime

URL Rebasing and MasterPages

ASP.NET Cookies

OR Another one from msdn
ASP.NET Cookies

GridView

Custom Grouping and Record Indexing

When to Use the DataGrid, DataListor Repeater

Erros

Invalid postback or callbackargument.

Validation of viewstate MAC failed error.

The application domain in which the thread was running has been unloaded

Exploring Session in ASP.Net

Beginner's Guide To View State


Beginner's Guide to ASP.NET ApplicationFolder

Maintain GridView Scroll Position
and Header Inside Update Panel


Exploring Caching in ASP.NET

Creating an Internationalized Wizard in WPF

WPF Amazon Explorer Using 3D


A lot of good articles spansented by Sacha Barber


Configure and send Mail

Configure and send Mail From SQL SERVER

SQL

madhivanan

sql-server-helper

What's New in SQL Server 2008

Visual Respansentation of SQL Joins

SQL Server data structures


Data Page Structure in MS-SQL

GROUP BY Clause (SQL Server 2005 Vs 2008)

Introduction to JOINs – Basic of JOINs

SQL Server Performance

http://sqlserver-qa.net/blogs/default.aspx

A-Z Index of the SQL Server 2005 database

SQL Server DateTime Format

Exploring your database schemawith SQL

Triggers

Understanding the Basic of Triggers

Caching

Using a controller to manage static resources

Avoid Caching of Ajax Requests

Speed Up My Code

Best Practices for Speeding Up Your Web Site

50 Tips to Boost ASP.NET Performance– Part I

50 Tips to Boost ASP.NET Performance– Part II

Conditional GET and ETag implementation for ASP.NET

http://www.acmebinary.com/blog/archive/2006/09/05/252.aspx

Improve Performance of ASP.NET Web Application

Building ASP.Net Applications – Best practices

Archive for category Performance Tips

How to Improve ASP.NET UpdatePanel Performance

Tips to Improve Your ASP.NET Web site performance

Speed Up Your Site! 8 ASP.NET Performance Tips

ASP.NET Performance

Chapter 6 — Improving ASP.NET Performance

Best Practise for Improving .NET Application Performance and Scalability

Best Practices to Improve ASP.NET Web Application Performance

50 Tips to Boost ASP.NET Performance – Part I

Best Practices to Improve ASP.Net Web Application Performance.
Improve ASP.NET Web Application Performance

ASP.NET Web Site Performance Improvement

Shivprasad koirala .NET Best Practice No: 1:- Detecting High Memory consuming functions in .NET code
Cheet Sheet


VB C# Cheet Sheet

Madskristensen

http://madskristensen.net/

Compiler Error List

Tools

Fax Server Software

Instant SQL Formatter

C# Class Generator, ASP.NET Tools

Create New Database and Auto Generate .NET Code

Codes
Easily Send Emails With .NET

Sending mail with secure service layer in asp.net 3.5/2.0

How to send mail asynchronously in asp.net

Sending email through System.Net.Mail.Smtpmail in asp.net 3.5/2.0

Understanding SMTP Status Codes

Interview Point Of View

Value vs Reference Types

Event fired again when I press F5 to refresh

Trap the Browser Refresh

Preventing Duplicate Record Insertion on Page Refresh

ViewState and Readonly Property of Textbox

Logical Query Processing Phases - Order of Statement Execution

1. FROM
2. ON --Interesting Observation of ON Clause on LEFT JOIN –
How ON Clause Effects Resultset in LEFT JOIN.

3. OUTER
4. WHERE
5. GROUP BY
6. CUBE | ROLLUP
7. HAVING
8. SELECT
9. DISTINCT
10 ORDER BY
11. TOP

I have given the Execution plan for Inner join. i.e.
If we give our condition in the ON CLAUSE or in the
WHERE CLAUSE it gives the same execution plan.






But for left join the execution plan differs and
the ResulSet also differ.





For clear details read Journey to SQL Authority's the two links.


Logical Query Processing Phases – Order of Statement Execution


Interesting Observation of ON Clause on LEFT JOIN – How ON Clause Effects Resultset in LEFT JOIN