Results 1 to 2 of 2

Thread: sql-stored procedures

  1. #1
    Guest
    O.K. can someone give me an example of code on how to pass a variable to a sql stored procedure and execute the procedure to return a recordset...I'm having problems finding good text books to help with a lot of questions, any suggestions? I'm running sql7.0 as my back end and vb6.0
    as my front

  2. #2
    Guest
    [/code]
    Function Get_Unique_Source_Values(SourceDBS As String, _
    SourceTBL As String, _
    SourceVAR As String, _
    TargetUNC As String, _
    TargetENC As String, _
    Local_Source_Table As String) As String
    Dim sql As String
    sql = "SELECT DISTINCT cstr([" & SourceTBL & "].[" & SourceVAR & "])"
    sql = sql & " AS [" & TargetUNC & "], NULL AS [" & TargetENC & "]"
    sql = sql & " INTO [" & Local_Source_Table & "]"
    sql = sql & " FROM [" & SourceTBL & "]"
    sql = sql & " IN '" & SourceDBS & "'"
    sql = sql & " WHERE [" & SourceTBL & "].[" & SourceVAR & "] is not null"
    sql = sql & ";"

    Xit_Add_New_Values_To_Target:
    Get_Unique_Source_Values = sql
    End Function
    [/code]


    Is this what you're looking for?

    Hope it helps.

    DerFarm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width