Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Check Store Procedure Name Exists or Not

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


            Return False

        End If

    End Function

Former Member
Not what you were looking for? View more on this topic or Ask a question