on 01-26-2015 10:52 AM
Hi All
Please kindly check this code for Store Procedure Exists or not .
''' <summary>
''' To Check Store Procedure Exists or Not
''' </summary>
''' <param name="SPName">Pass Store Procedure Name</param>
''' <returns>return TRUE or FALSE</returns>
''' <remarks>To Check Whether Store Procedure Exists or Not</remarks>
Public Function CheckSPExists(ByVal SPName As String) As Boolean
otempRecset = oApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
otempRecset.DoQuery("SELECT CASE COUNT('A') WHEN 1 THEN 'EXISTS' ELSE 'NOT EXISTS' END FROM Sys.objects WHERE Name =" & SPName & "AND Type = 'P'")
If otempRecset.RecordCount > 0 Then
Return True
Else
Return False
End If
End Function
Hi,
I am afraid your query:
SELECT CASE COUNT('A') WHEN 1 THEN 'EXISTS' ELSE 'NOT EXISTS' END FROM Sys.objects WHERE Name =" & SPName & "AND Type = 'P'
may not be able to add to the DoQuery directly without additional "+" sign and/or " ' " character. You may try to print the result to see what DoQuery can get.
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.