al4629740
asked on
creating a stored procedure
I am new to making stored procedures in SQL. I have vb6 code below that I wish to test out using a stored procedure. Could someone assist in giving an example of what the stored procedure would look like in SQL?
Set conn = New ADODB.Connection
conn.Open "Provider=sqloledb;Data Source=" & ConnectionIP & ",xxxx;Network Library=DBMSSOCN;Initial Catalog= " & CAPDB & "; User ID=xx;Password=xxxxxxx"
Dim sStringtoEx As String
Dim sStringtoEx2 As String
sStringtoEx = "Update AttendanceGrid Set AttendanceGrid.[CSW/TitleXX] = tblRegistration.[CSW/TitleXX] FROM AttendanceGrid INNER JOIN tblRegistration on AttendanceGrid.id = tblRegistration.id"
conn.Execute sStringtoEx
sStringtoEx2 = "Update AttendanceGrid Set X = case when tblRegistration.Overage = 3 THEN 'X' else '' end FROM tblRegistration INNER JOIN AttendanceGrid on tblRegistration.id=AttendanceGrid.id "
conn.Execute sStringtoEx2
End Sub
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER