on 07-12-2012 1:29 AM
Hi
I'm doing an aplication with the SAP Business One SDK but
i don't now if i can use objects of Sql to remove a Temporary Table
The Code that I try use is...............
oConexionSQL = New SqlConnection(sCadenaConexion)
oComandoSQL = New SqlCommand
oComandoSQL.Connection = oConexionSQL
sQuery = "if not OBJECT_ID('" & sNombre_Tabla & "') is null DROP TABLE " & sNombre_Tabla
oComandoSQL.CommandText = sQuery
oComandoSQL.ExecuteNonQuery()
oConexionSQL.Close()
Someone can answer me
Thanks
Hello Dear ,
give a try to your query as well if that doesn't work the following will surely do..
oRecSet.DoQuery("SELECT * FROM SYSOBJECTS WHERE NAME = 'sNombre_Tabla'");
if (oRecSet.RecordCount > 0)
{
sqlQuery = "Drop table sNombre_Tabla "
oComandoSQL.CommandText = sQuery
oComandoSQL.ExecuteNonQuery()
}
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rafael,
SAP has a built in sql connection. You can use the DI API. For you to able to create a query, you should declare like this.
Dim oCompany As SAPbobsCOM.Company
Dim oRec As SASPbobsCOM.Recordset
Dim oQuery As String
oCompany = SBO_Application.Company.GetDICompany
oRec = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
oQuery = ""
oRec.DoQuery(oQuery)
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
11 | |
11 | |
6 | |
6 | |
5 | |
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.