Wednesday, December 3, 2008

SQL2005 String functions

SQL 2005 String Functions

String Functions are used for manipulating string expression. 
(Pass strings using single quotes)

Len('') - Returns length of string.
select Len("Urgent Work") will return 11

Lower('') - Convert all characters to lowercase characters.
select Lower('Urgent Work') will return urgent work

Upper('') - Convert all characters to uppercase characters.
select Upper('Urgent Work') will return URGENT WORK

LTrim('') - Removes spaces from given character strings on left.
select LTrim(' Urgent Work') will return Urgent Work

LTrim & RTRIM & Trim donot remove tab or line feed character.
RTrim('') - Removes space from given character strings on right.
select LTrim('Urgent Work ')  returns Urgent Work

Trim('') - Removes spaces from given character strings from both left and right.
select LTrim(' Urgent Work ')  returns Urgent Work

SubString('') - Returns a part of string from original string.

SubString(character_expression, position, length)
position - specifies where the substring begins.
length - specifies the length of the substring as number of characters.
Example: select SubString('Urgent Work',1,6)  return "Urgent"

Replace('') - Replace the desired string within the original string.
Replace(character_expression, searchstring, replacementstring)
SearchString - string which you want to replace.
ReplaceString - new string which you want to replace with
select replace('Think Big To Achieve Big', 'Big', 'Small')

Original - Think Big To Achieve Big
Result - Think SmallTo Achieve Small

Right('') - extract particular characters from right part of given string expression.
select right('Think High To Achieve High',15) will return "To Achieve High"

This function will be helpful when you want particular characters from right part.
Example: Let say i have social security nos. and i want to extract last 4 digit of it.
select right('111-11-1111',4) will return 1111
select right('222-22-2222',4) will return 2222
select right('333-33-3333',4) will return 3333
select right('444-44-4444',4) will return 4444

Complete List of Web 2.0 APIs

Complete List of Web 2.0 APIs

http://programmableweb.com/apilist/bycat

Very useful.  Hope helps!



Tuesday, November 18, 2008

sql2000 delete rows having duplicate (identical) records

Suppose, we have identical records like :-

name age
***********
RAM 30
RAM 30

we have to keep one entry each for ram:30  and ram:40 and delete duplicate entries:-

set rowcount 1 
(this will remove top 1 row)
select * from temp where name = 'ram'
delete temp where name = 'ram'
set rowcount 0

Friday, November 7, 2008

String manipulations

        Dim strSample As String = "Left Center Right"

        'left
        strSample = strSample.Substring(0, 4)

        'center
        strSample = strSample.Substring(5, 6)

        'right
        strSample = strSample.Substring(12)


        'split
        Dim SplitString As String = "Cat, Dog, Hen, Zebra"
        Dim SplitArr() As String
        Dim i As Integer

        SplitArr = SplitString.Split(","c)

        For i = 0 To SplitArr.Length - 1
            console.writeline(SplitArr(i))
        Next

        'Join
        Dim JoinArr(2) As String
        Dim JoinString As String
        JoinArr(0) = "Give"
        JoinArr(1) = "Take"
        JoinArr(2) = "Apply"
        JoinString = String.Join(",", JoinArr)
        Console.WriteLine(JoinString)

        'insert
        Dim strTemp As String = "This is My Stng"
        strSample = strTemp.Insert(13, "ri")
        Console.WriteLine(strSample)    'OUTPUT: "This is My String".

        'Remove
        Dim RemoveString As String = "This is my Sam@o@o@ple"
        'strSample = "This is my Sample"
        strSample = RemoveString.Remove(14, 5)
        Console.WriteLine(strSample)

        'replace
        Dim ReplaceString = "This is My String"
        ' strSample = "This is Another String"
        strSample = ReplaceString.Replace("My", "Another")
        Console.WriteLine(strSample)

        'Trim Spaces
        Dim SpaceString As String = "        This string will have the spaces removed        "
        Console.WriteLine(SpaceString)
        Dim TrimmedString As String
        TrimmedString = Trim(SpaceString)
        Console.WriteLine(TrimmedString)

        'Trim Other
        Dim HashString As String = "#####Testing!######"
        TrimmedString = HashString.Trim("#")
        Console.WriteLine(TrimmedString)

        'Left Trim ( TrimStart)
        Dim SpaceString1 As String = "        This string will have the leading spaces removed        "
        Console.WriteLine(SpaceString)
        TrimmedString = SpaceString1.TrimStart(" ")
        Console.WriteLine(TrimmedString)

        'Right Trim ( TrimEnd)
        Dim SpaceString2 As String = "        This string will have the trailing spaces removed        "
        Console.WriteLine(SpaceString)
        TrimmedString = SpaceString.TrimEnd(" ")
        Console.WriteLine(TrimmedString)

        'Pad Left
        Dim MainString As String = "This will be padded on the left"
        Dim PaddedString As String

        PaddedString = MainString.PadLeft(36, "@") '36 = new length of string with 5 new chars
        Console.WriteLine(PaddedString)

        'Pad Right
        Dim MainString1 As String = "This will be padded on the right"
        PaddedString = MainString1.PadRight(36, "@") '36 = new length of string with 5 new chars
        Console.WriteLine(PaddedString)

        'UPPER CASE
        Dim MixedString As String = "UpPeR oR LoWeR cAsE"
        Dim UPPERString As String
        ' UPPERString = "UPPER OR LOWER CASE"
        UPPERString = MixedString.ToUpper
        Console.WriteLine(UPPERString)

        'lower case
        Dim MixedString1 As String = "UpPeR oR LoWeR cAsE"
        Dim lowerString As String
        'lowerString = "upper or lower case"
        lowerString = MixedString1.ToLower
        Console.WriteLine(lowerString)

        'TitleCase
        Dim TitleString As String = "UPPER lower Title"
        TitleString = TitleString.ToLower()  ' mainly because of UPPER not changing to title
        TitleString = System.Globalization.CultureInfo.InstalledUICulture.TextInfo.ToTitleCase(TitleString)
        Console.WriteLine(TitleString)

        'Format
        Dim UnFormattedDateTime As Date = #1/27/2001 5:04:23 PM#
        Dim strFormattedString As String
        ' Returns current system time in the system-defined long time format.
        strFormattedString = Format(Now(), "Long Time")
        ' Returns current system date in the system-defined long date format.
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(Now(), "Long Date")
        Console.WriteLine(strFormattedString)
        ' Also returns current system date in the system-defined long date 
        ' format, using the single letter code for the format.
        strFormattedString = Format(Now(), "D")
        Console.WriteLine(strFormattedString)
        ' Returns the value of UnFormattedDateTime in user-defined date/time formats.
        strFormattedString = Format(UnFormattedDateTime, "h:m:s")   ' Returns "5:4:23".
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(UnFormattedDateTime, "hh:mm:ss tt")   ' Returns "05:04:23 PM".
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(UnFormattedDateTime, "dddd, MMM d yyyy")   ' Returns "Saturday,
        ' Jan 27 2001".
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(UnFormattedDateTime, "HH:mm:ss")   ' Returns "17:04:23"
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(23)   ' Returns "23".
        Console.WriteLine(strFormattedString)
        ' User-defined numeric formats.
        strFormattedString = Format(5459.4, "##,##0.00")   ' Returns "5,459.40".
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(334.9, "###0.00")   ' Returns "334.90".
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(5, "0.00%")   ' Returns "500.00%".
        Console.WriteLine(strFormattedString)

        'Concat
        Dim ConcatString As String
        Dim aString As String = "A"
        Dim bString As String = "B"
        Dim cString As String = "C"
        Dim dString As String = "D"
        ' ConcatString = "ABCD"
        ConcatString = String.Concat(aString, bString, cString, dString)
        Console.WriteLine(ConcatString)

        'IndexOf
        Dim MainString2 As String = "ABCDE"
        Dim Result As Integer
        Result = MainString2.IndexOf("D")  ' result = 3
        Console.WriteLine("D is Character number : " & Result.ToString)

        'Chars
        Dim MainString3 As String = "ABCDE"
        Dim ResultChar As Char
        ResultChar = MainString3.Chars(3) ' resultChar = "D"
        Console.WriteLine("Character 3 is : " & ResultChar.ToString)

        'LastIndexOf
        Dim MainString4 = "A\B\C\D\E\F\G\H\I\J"
        Result = MainString.LastIndexOf("\")
        Console.WriteLine("Last occurence of ' \ ' is at Position : " & Result.ToString())

        'Compare
        Dim FirstString As String = "Alphabetical"
        Dim SecondString As String = "Order"
        Dim ThirdString As String = "Order"
        Dim FourthString As String = "Alphabetical"
        Dim Result1 As Integer
        Dim Result2 As Integer
        Result1 = String.Compare(FirstString, SecondString)
        Console.WriteLine("Result = " & Result1.ToString & Environment.NewLine & "First String Is Smaller Than Second")
        Result2 = String.Compare(ThirdString, FourthString)
        Console.WriteLine("Result = " & Result2.ToString & Environment.NewLine & "Third String Is Greater Than Fourth")

        'Length
        Dim MainString5 As String = "String To Test The Length"
        Dim Result3 As Integer = MainString.Length
        Console.WriteLine(Result.ToString & " Characters")

        'Copy
        Dim EmptyString As String
        Dim CopyString As String = "This Will Be Copied Into An Empty String"
        EmptyString = String.Copy(CopyString)
        Console.WriteLine(EmptyString)

String manipulations

        Dim strSample As String = "Left Center Right"

        'left
        strSample = strSample.Substring(0, 4)

        'center
        strSample = strSample.Substring(5, 6)

        'right
        strSample = strSample.Substring(12)


        'split
        Dim SplitString As String = "Cat, Dog, Hen, Zebra"
        Dim SplitArr() As String
        Dim i As Integer

        SplitArr = SplitString.Split(","c)

        For i = 0 To SplitArr.Length - 1
            console.writeline(SplitArr(i))
        Next

        'Join
        Dim JoinArr(2) As String
        Dim JoinString As String
        JoinArr(0) = "Give"
        JoinArr(1) = "Take"
        JoinArr(2) = "Apply"
        JoinString = String.Join(",", JoinArr)
        Console.WriteLine(JoinString)

        'insert
        Dim strTemp As String = "This is My Stng"
        strSample = strTemp.Insert(13, "ri")
        Console.WriteLine(strSample)    'OUTPUT: "This is My String".

        'Remove
        Dim RemoveString As String = "This is my Sam@o@o@ple"
        'strSample = "This is my Sample"
        strSample = RemoveString.Remove(14, 5)
        Console.WriteLine(strSample)

        'replace
        Dim ReplaceString = "This is My String"
        ' strSample = "This is Another String"
        strSample = ReplaceString.Replace("My", "Another")
        Console.WriteLine(strSample)

        'Trim Spaces
        Dim SpaceString As String = "        This string will have the spaces removed        "
        Console.WriteLine(SpaceString)
        Dim TrimmedString As String
        TrimmedString = Trim(SpaceString)
        Console.WriteLine(TrimmedString)

        'Trim Other
        Dim HashString As String = "#####Testing!######"
        TrimmedString = HashString.Trim("#")
        Console.WriteLine(TrimmedString)

        'Left Trim ( TrimStart)
        Dim SpaceString1 As String = "        This string will have the leading spaces removed        "
        Console.WriteLine(SpaceString)
        TrimmedString = SpaceString1.TrimStart(" ")
        Console.WriteLine(TrimmedString)

        'Right Trim ( TrimEnd)
        Dim SpaceString2 As String = "        This string will have the trailing spaces removed        "
        Console.WriteLine(SpaceString)
        TrimmedString = SpaceString.TrimEnd(" ")
        Console.WriteLine(TrimmedString)

        'Pad Left
        Dim MainString As String = "This will be padded on the left"
        Dim PaddedString As String

        PaddedString = MainString.PadLeft(36, "@") '36 = new length of string with 5 new chars
        Console.WriteLine(PaddedString)

        'Pad Right
        Dim MainString1 As String = "This will be padded on the right"
        PaddedString = MainString1.PadRight(36, "@") '36 = new length of string with 5 new chars
        Console.WriteLine(PaddedString)

        'UPPER CASE
        Dim MixedString As String = "UpPeR oR LoWeR cAsE"
        Dim UPPERString As String
        ' UPPERString = "UPPER OR LOWER CASE"
        UPPERString = MixedString.ToUpper
        Console.WriteLine(UPPERString)

        'lower case
        Dim MixedString1 As String = "UpPeR oR LoWeR cAsE"
        Dim lowerString As String
        'lowerString = "upper or lower case"
        lowerString = MixedString1.ToLower
        Console.WriteLine(lowerString)

        'TitleCase
        Dim TitleString As String = "UPPER lower Title"
        TitleString = TitleString.ToLower()  ' mainly because of UPPER not changing to title
        TitleString = System.Globalization.CultureInfo.InstalledUICulture.TextInfo.ToTitleCase(TitleString)
        Console.WriteLine(TitleString)

        'Format
        Dim UnFormattedDateTime As Date = #1/27/2001 5:04:23 PM#
        Dim strFormattedString As String
        ' Returns current system time in the system-defined long time format.
        strFormattedString = Format(Now(), "Long Time")
        ' Returns current system date in the system-defined long date format.
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(Now(), "Long Date")
        Console.WriteLine(strFormattedString)
        ' Also returns current system date in the system-defined long date 
        ' format, using the single letter code for the format.
        strFormattedString = Format(Now(), "D")
        Console.WriteLine(strFormattedString)
        ' Returns the value of UnFormattedDateTime in user-defined date/time formats.
        strFormattedString = Format(UnFormattedDateTime, "h:m:s")   ' Returns "5:4:23".
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(UnFormattedDateTime, "hh:mm:ss tt")   ' Returns "05:04:23 PM".
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(UnFormattedDateTime, "dddd, MMM d yyyy")   ' Returns "Saturday,
        ' Jan 27 2001".
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(UnFormattedDateTime, "HH:mm:ss")   ' Returns "17:04:23"
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(23)   ' Returns "23".
        Console.WriteLine(strFormattedString)
        ' User-defined numeric formats.
        strFormattedString = Format(5459.4, "##,##0.00")   ' Returns "5,459.40".
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(334.9, "###0.00")   ' Returns "334.90".
        Console.WriteLine(strFormattedString)
        strFormattedString = Format(5, "0.00%")   ' Returns "500.00%".
        Console.WriteLine(strFormattedString)

        'Concat
        Dim ConcatString As String
        Dim aString As String = "A"
        Dim bString As String = "B"
        Dim cString As String = "C"
        Dim dString As String = "D"
        ' ConcatString = "ABCD"
        ConcatString = String.Concat(aString, bString, cString, dString)
        Console.WriteLine(ConcatString)

        'IndexOf
        Dim MainString2 As String = "ABCDE"
        Dim Result As Integer
        Result = MainString2.IndexOf("D")  ' result = 3
        Console.WriteLine("D is Character number : " & Result.ToString)

        'Chars
        Dim MainString3 As String = "ABCDE"
        Dim ResultChar As Char
        ResultChar = MainString3.Chars(3) ' resultChar = "D"
        Console.WriteLine("Character 3 is : " & ResultChar.ToString)

        'LastIndexOf
        Dim MainString4 = "A\B\C\D\E\F\G\H\I\J"
        Result = MainString.LastIndexOf("\")
        Console.WriteLine("Last occurence of ' \ ' is at Position : " & Result.ToString())

        'Compare
        Dim FirstString As String = "Alphabetical"
        Dim SecondString As String = "Order"
        Dim ThirdString As String = "Order"
        Dim FourthString As String = "Alphabetical"
        Dim Result1 As Integer
        Dim Result2 As Integer
        Result1 = String.Compare(FirstString, SecondString)
        Console.WriteLine("Result = " & Result1.ToString & Environment.NewLine & "First String Is Smaller Than Second")
        Result2 = String.Compare(ThirdString, FourthString)
        Console.WriteLine("Result = " & Result2.ToString & Environment.NewLine & "Third String Is Greater Than Fourth")

        'Length
        Dim MainString5 As String = "String To Test The Length"
        Dim Result3 As Integer = MainString.Length
        Console.WriteLine(Result.ToString & " Characters")

        'Copy
        Dim EmptyString As String
        Dim CopyString As String = "This Will Be Copied Into An Empty String"
        EmptyString = String.Copy(CopyString)
        Console.WriteLine(EmptyString)

Monday, November 3, 2008

Handling Keystrokes in DataGridView

Private Sub dgv_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles dgv.EditingControlShowing
 
If Me.dgv.CurrentCell.ColumnIndex = 0 And Not e.Control Is Nothing Then
    Dim tb As TextBox = CType(e.Control, TextBox)
    AddHandler tb.KeyDown, AddressOf TextBox_KeyDown
    AddHandler tb.KeyPress, AddressOf TextBox_KeyPress
End If

 
End Sub
 

Private Sub TextBox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
 If  e.KeyCode = Keys.Space Then
     flag = True
 End If

End Sub
 
Private Sub TextBox_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
 e.Handled = flag
 flag = False

End Sub

Export SQL table to excel

Dim excel As New Excel.Application
        Dim wBook As Excel.Workbook
        Dim wSheet As Excel.Worksheet

        wBook = excel.Workbooks.Add()
        wSheet = wBook.ActiveSheet()

        Dim dt As DataGridView = TblJobMethodsDataGridView.DataSource.Tables(0)
        Dim dc As System.Data.DataColumn
        Dim dr As System.Data.DataRow
        Dim colIndex As Integer = 0
        Dim rowIndex As Integer = 0

        For Each dc In dt.Columns
            colIndex = colIndex + 1
            excel.Cells(1, colIndex) = dc.ColumnName
        Next

        For Each dr In dt.Rows
            rowIndex = rowIndex + 1
            colIndex = 0
            For Each dc In dt.Columns
                colIndex = colIndex + 1
                excel.Cells(rowIndex + 1, colIndex) = dr(dc.ColumnName)

            Next
        Next

        wSheet.Columns.AutoFit()
        Dim strFileName As String = "D:\ss.xls"
        Dim blnFileOpen As Boolean = False
        Try
            Dim fileTemp As System.IO.FileStream = System.IO.File.OpenWrite(strFileName)
            fileTemp.Close()
        Catch ex As Exception
            blnFileOpen = False
        End Try

        If System.IO.File.Exists(strFileName) Then
            System.IO.File.Delete(strFileName)
        End If

        wBook.SaveAs(strFileName)
        excel.Workbooks.Open(strFileName)
        excel.Visible = True

Friday, August 29, 2008

youtube videos download


just copy poste the youtube url address into the textbox
and press download button. video should be save by default name in the hard disk and rename later on. (also play associated the video in the youtube.com).
Very useful.
download from the following link:-

http://s2.orbitfiles.com/index.php?link=3232725130&sid=6fc5f8f8b300bfe120252bca16ec1fad&force=1

Wednesday, August 27, 2008

vb2008: using LinQ

I have now set up a console app to test this piece of code using Northwind as follows:-
Imports System.Data.LinqModule Module1
Sub Main() Dim db As New NorthWindDataContext
Dim Emps = From Employee In db.Employees _ Select Employee
Debug.Print(Emps.Count)
For Each emp In Emps

Console.WriteLine("Code={0}, Name={1}", emp.EmployeeID, emp.FirstName) Next
Console.ReadLine() End Sub
End Module

vb2008: Unable to debug: The binding handle is invalid


Unable to debug: The binding handle is invalid


Open the project properties, Debug, Disable -> "Enable the Visual Studio hosting process"


vb2008: how to retrieve the desktop display settings

use the following code:-

Dim MyScreenSize As New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)

Monday, July 28, 2008

Sunday, July 20, 2008

SQL Server: Calculating Running Totals, Subtotals and Grand Total Without a Cursor

SQL Server: Calculating Running Totals, Subtotals and Grand Total Without a Cursor

  • Sample Data Used by Examples
Create a table named "Orders" and enter some sample data into it...

create table Orders
(

OrderID int identity,
OrderAmt Decimal(8,2),
OrderDate SmallDatetime

)

Select command gives the following output:

OrderID OrderAmt OrderDate
----------- ---------- --------------------
1 10.50 2003-10-11 08:00:00
2 11.50 2003-10-11 10:00:00
3 1.25 2003-10-11 12:00:00
4 100.57 2003-10-12 09:00:00
5 19.99 2003-10-12 11:00:00
6 47.14 2003-10-13 10:00:00
7 10.08 2003-10-13 12:00:00
8 7.50 2003-10-13 19:00:00
9 9.50 2003-10-13 21:00:00
All my examples will be using this table to produce the running totals, sub totals, and grand total reports shown below. Basically this table contains a number of different orders that where created over time. Each order has an ID (OrderID) which uniquely identifies each record, an order amount (OrderAmt) that holds a decimal amount for the order, and a timestamp (OrderDate) that identifies when the order was placed.

  • Running Total On Each Record

This first example will display a simple method of calculating the running total of the OrderAmt. The calculated running total will be displayed along with each record in the Orders table. The "Running Total" column will be created with a simple SELECT statement and a correlated sub query. The correlated sub query is the part of the statement that does the heavy lifting to produce the running total.
select OrderId, OrderDate, O.OrderAmt,
(select sum(OrderAmt) from Orders where OrderID <= O.OrderID) as 'Running-Total' from Orders O

On running the above query, the following rows are listed :

OrderId OrderDate OrderAmt Running-Total
----------- -------------------- ---------- -------------
1 2003-10-11 08:00:00 10.50 10.50
2 2003-10-11 10:00:00 11.50 22.00
3 2003-10-11 12:00:00 1.25 23.25
4 2003-10-12 09:00:00 100.57 123.82
5 2003-10-12 11:00:00 19.99 143.81
6 2003-10-13 10:00:00 47.14 190.95
7 2003-10-13 12:00:00 10.08 201.03
8 2003-10-13 19:00:00 7.50 208.53
9 2003-10-13 21:00:00 9.50 218.03

As you can see, there is a "Running Total" column that displays the running total along with the other column information associated with each Orders table record. This running total column is calculated, by summing up the OrderAmt for all Orders where the OrderID is less than or equal to the OrderID of the current ID being displayed.


  • Running Totals With Subtotals and Grand totals

In this example, I will calculate a single sub totals for all Orders that were created on the same day and a Grand Total for all Orders. This will be done using a CASE clause in the SELECT statement. Here is my example.
select O.OrderID,convert(char(10),O.OrderDate,101) 'Order Date',O.OrderAmt,
case when OrderID = (select top 1 OrderId from Orders
where convert(char(10),OrderDate,101)
= convert(char(10),O.OrderDate,101)
order by OrderID desc)
then (select cast(sum(OrderAmt) as char(10))
from Orders
where OrderID <= O.OrderID and convert(char(10),OrderDate,101) = convert(char(10),O.OrderDate,101)) else ' ' end as 'Sub Total', case when OrderID = (select top 1 OrderId from Orders order by OrderDate desc) then (select cast(sum(OrderAmt) as char(10)) from Orders) else ' ' end as 'Grand Total' from Orders O order by OrderID


Output from the SELECT statement looks like this:

OrderID Order Date OrderAmt Sub Total Grand Total
----------- ---------- ---------- ---------- -----------
1 10/11/2003 10.50
2 10/11/2003 11.50
3 10/11/2003 1.25 23.25
4 10/12/2003 100.57
5 10/12/2003 19.99 120.56
6 10/13/2003 47.14
7 10/13/2003 10.08
8 10/13/2003 7.50
9 10/13/2003 9.50 74.22 218.03
In this example the first CASE statement controls the printing of the "Sub Total' column. As you can see, the sub total is printed only on the last order of the day, which is determined by using a correlated sub query. The second CASE statement prints the "Grand Total", which is only printed along with the very last order. Each of these CASE statements uses the TOP clause to determine which OrderID is the correct order for which to print out the "Grand Total".

Saturday, July 19, 2008

SQL Editor with advanced feature like autocomplete/intelisense in vb.net

download the trial version of SQL Editor with advanced feature (like autocomplete/intelisense in vb.net).

Worth a look. Try it.

http://www.mingsoftware.com/UniversalSQLEditor/download/UniversalSQLEditorSetup.msi
Great to have this blog...

Happy Blogging !!
ss02