StoredProcedureisa programstoredin the databaseaswell asdata.It isactually quiteunusual,becauseweexpectthestoreddatain the development ofdatabaseisnothisprogram.
The core competencyisinSQLServerStoreProceduresandFunctions(Functionsonly foundinSQLServer2000).
With theStoreProcedure,then theSQLprogramthatwe created:
The core competencyisinSQLServerStoreProceduresandFunctions(Functionsonly foundinSQLServer2000).
With theStoreProcedure,then theSQLprogramthatwe created:
Download source code sistem pendukung keputusan, sistem pakar, sistem informasi berbasis web dan desktop.
- canbe usedanytime.
- morequicklyandefficientlybecause it isServerSide.
- easilycreatedandmaintainedbya smallbut'PowerFull'.
StroredMakingProcedure.
Syntax:
CREATEPROCEDUREnama_procedure
[@Parameter1tipe_data_parameter1, ..........., [@ ParameterNtipe_data_parameterN]
U.S.
SQLorTSQLstatement
TSQListhe developmentofSQL,thusbecomingmorePowerful.
The followingstoreprocedurecreationthroughthe EnterpriseManager:
- ClickStoredProcedureinDatabase Northwind.
- RightclickonAreaName.
- SelectNewStoredProcedure.
Change thestatementthatthere isaStoredProcedurethe following:
ThenTodisplay thedatainto aformusing astoredprocedure,createaformlike the following picture:
The followingprogramcode:
Dim Conn As New ADODB.ConnectionDim rsTransaksi As New ADODB.Recordset
Dim StrSQL As String, OpenConnecting As String
Private Sub Form_Load()
Dim CustomerId As String
CustomerId = InputBox('Please Input Customer ID !')
OpenConnecting = 'Provider=SQLOLEDB.1;Persist Security Info=False;' _
& 'User ID=sa;Initial Catalog=NorthWind;Data Source=(local)'
If Conn.State = adStateOpen Then
Conn.Close
Set Conn = New ADODB.Connection
Conn.Open OpenConnecting
Else
Conn.Open OpenConnecting
End If
rsTransaksi.ActiveConnection = Conn
rsTransaksi.CursorLocation = adUseClient
rsTransaksi.CursorType = adOpenDynamic
rsTransaksi.LockType = adLockOptimistic
rsTransaksi.Open 'EXEC CustOrderHist ' & CustomerId & ''
Set DataGrid1.DataSource = rsTransaksi
End Sub
The result: