This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Execute plain SQL in script

Hi,

I have an SQL query that i very complicate and at the end it returns just 1 or 0.

I need to run it into a script and let me return just the number.

I can achieve that? 

I didn't find any object in vb dell to do that.

The sqlcommand need an sqlconnection object and I don't know how to fill it from identity manger.

 

Parents
  • Hi,

    You can get the connection string of the database using:

    ConnectionString = Connection.GetSingleProperty("dialogDatabase", "connectionstring", "")

    Then you could create a connection using:

    Dim conData as ConnectData = DbApp.Instance.Connect(ConnectionString)

    Then take it from there ..... does that help?

    If your database is encrypted you'll have to pass the coonection string in as a parameter that the job service hides and decrypts.

    HTH, Barry.
Reply
  • Hi,

    You can get the connection string of the database using:

    ConnectionString = Connection.GetSingleProperty("dialogDatabase", "connectionstring", "")

    Then you could create a connection using:

    Dim conData as ConnectData = DbApp.Instance.Connect(ConnectionString)

    Then take it from there ..... does that help?

    If your database is encrypted you'll have to pass the coonection string in as a parameter that the job service hides and decrypts.

    HTH, Barry.
Children
No Data