Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 passing parameters to bcp
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

alejo46
Posting Yak Master

Colombia
157 Posts

Posted - 07/08/2013 :  14:39:16  Show Profile  Reply with Quote
good afternoon
I if need your help.
1st is there any web page you can tell me a the basics of activeX, the langauge, code,etc ?

2. I need to modify the code of this ActiveX in order to pass the parameters:This is the bcp path:
\\datamartsql\programas\Bajar_Tabla.bat
the bajar_tabla.bat file content is:
bcp %1 out %2 -c -t"|" -Sdatamartsql -T
%1 and %2 are parameters ? which are the values for each one of these parameters ?

the code for the former activeX that pass the parameters out is:

********Asignación de parámetros al BCP
iContador = 1
bBuscar = true
ls_Nomarch = Trim(DTSGlobalVariables("V_RUTA_CONFIG").Value) & "Bajar_Tabla.bat " & _
"dm1_elite.dbo." & DTSGlobalVariables("V_NOMBRE_TABLA").Value & " " & DTSGlobalVariables("V_NOMBRE_ARCHIVO").Value & v_servidor & " " & v_usuario & " " & v_password

Set oPackage = DTSGlobalVariables.parent

Do While bBuscar
'*******Asignar un elemento de la colección tareas del paquete a una variable objeto tarea
Set oTask = oPackage.Tasks.Item(iContador)
If Trim(oTask.Description) = "BCP para generar archivo" Then
bBuscar = False
Else
iContador = iContador + 1
End If
Loop
Set oCTR = oTask.CustomTask
oCTR.ProcessCommandLine = ls_nomarch
Set oCTR = nothing
Set oTask = nothing
Set oPackage = nothing

Main = DTSTaskExecResult_Success

alejo46
Posting Yak Master

Colombia
157 Posts

Posted - 07/09/2013 :  15:58:41  Show Profile  Reply with Quote
what i intended is to replace this bcp command like this:

bcp %1 out %2 -c -t"|" -Sdatamartsql -T
by this one:

bcp "SELECT * FROM dm1_elite.dbo.SALDOS_PREPAGO_DIARIOS_ALTAMIRA_SALDOS where FEC_SALDO >= '20120816'and FEC_SALDO <= '20120823'" queryout d:\SALDOS_PREPAGO_DIARIOS_ALTAMIRA_SALDOS_20120816_20120823.txt -c -t"|" -Sdatamartsql -T
but i can't identify the parameters value given by bcp %1 out %2
thanks in advanced
Go to Top of Page

russell
Pyro-ma-ni-yak

USA
5072 Posts

Posted - 07/10/2013 :  02:48:24  Show Profile  Visit russell's Homepage  Reply with Quote
I am struggling with the espanol, but what you want to do is build a string, then execute it.

You could even use FileSystemObject to build a batch file and the execute that.

ActiveX can be JavaScript or vbScript. Have a look here for starters
Go to Top of Page

alejo46
Posting Yak Master

Colombia
157 Posts

Posted - 07/12/2013 :  16:34:25  Show Profile  Reply with Quote
OK thanks, but i stiil dont know the the values for both parameters %1 and %2 given by ActiveX and passed to bcp:
bcp %1 out %2 -c -t"|" -Sdatamartsql -T

2nd the link you mention to start learning Activex is temporaly unavailable becuse it yields the error: 404 page cannot be found

Thnks in advance
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000