Subject: | |
From: | |
Reply To: | |
Date: | Wed, 13 Aug 2008 08:52:10 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
> -----Original Message-----
> From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On
> Behalf Of Kent Wallace
> Sent: Tuesday, August 12, 2008 6:15 PM
> To: [log in to unmask]
> Subject: Re: OT: Any suggestions on a learning C# book?
>
<snip>
> I work with some MS consultants and they want as much as you can get
in
> a stored procedure or stored function. Sometimes I look at my stored
> procedures and they remind me of a COBOL program.
>
>
I have been doing some testing with CLR integrated stored procedures,
using VB.Net, and so far I like what I see.
Example:
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports Microsoft.SqlServer.Server
Partial Public Class StoredProcedures
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub S_HPCR_ChecksToBeProcessed()
'
---------------------------------------------------------------------
' Claim Check Processing: Checks to be processed report
'
---------------------------------------------------------------------
Using conn As New SqlConnection("context connection=true")
Dim cmd As New SqlCommand
With cmd
.Connection = conn
.CommandText = "SELECT * " & _
"FROM HPFiles.dbo.CCInvs1 "
End With
conn.Open()
SqlContext.Pipe.ExecuteAndSend(cmd)
conn.Close()
End Using
End Sub
End Class
I find writing stored procedures this way much more enjoyable, when you
move beyond a simple select, than TSQL. I am currently working on
implementing a port of my Cobol claim check processing, as a CLR
integrated stored procedure, that is a bit more complex than the above
sample and have found it very easy to work with.
As with all things it is not perfect, but perfection would be boring.
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|