![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
-----Original Message----- Hi sanghun , Let me ask you something. Why is this done in a DTS? You have a SQL table and is going to update other SQL tables according to some business rule. For the enunciate provided, this is a Stored Procedure suited task. Please provide further information. Bye, ----- sanghun jung wrote: ----- Hi there, Background - Win2000 server, SQL2000 with SP3 I have a table with 10 columns. Each column has either 0 or 1. Values are changed everyday by users. At night, A DTS kicks off and read the value, if 0 then do nothing, if 1 then kick off another DTS package to update some data. In ActiveX script, if it is 0, then skip this part, not as a failure. Once it calls DTS, ActiveX reset the value to 0 to the appropreate column. Can ActiveX do this job? Can you show me sample of code that will do this or any links that I may see some ActiveX code? Thanks in advance. sanghun . |
#4
| |||
| |||
|
|
Hi sanghun , Let me ask you something. Why is this done in a DTS? You have a SQL table and is going to update other SQL tables according to some business rule. For the enunciate provided, this is a Stored Procedure suited task. Please provide further information. Bye, ----- sanghun jung wrote: ----- Hi there, Background - Win2000 server, SQL2000 with SP3 I have a table with 10 columns. Each column has either 0 or 1. Values are changed everyday by users. At night, A DTS kicks off and read the value, if 0 then do nothing, if 1 then kick off another DTS package to update some data. In ActiveX script, if it is 0, then skip this part, not as a failure. Once it calls DTS, ActiveX reset the value to 0 to the appropreate column. Can ActiveX do this job? Can you show me sample of code that will do this or any links that I may see some ActiveX code? Thanks in advance. sanghun |
#5
| |||
| |||
|
|
Hi, Valmir Thanks for your interesting on my problem. First, some thing needs to read values(either 0 = no run DTS, 1 = run DTS) from each column (about 10 columns) in a "readme" table. Each column has different DTS that will update tables. So "readme" table is the guy that tell you what to run for tonight. Users set the switch during office hours. 1. Stored Procedure, how can I make SP will read the readme table and find out what DTSs need to run tonight? 2. All the DTSs do nothing but truncate prod-table and copy all data from test-table when they execute. I am a DBA newbie (about three months now), has not touch SP yet. I will be glad to work on SP. If you can help me out on this, I will appreciate it. Thanks Sanghun -----Original Message----- Hi sanghun , Let me ask you something. Why is this done in a DTS? You have a SQL table and is going to update other SQL tables according to some business rule. For the enunciate provided, this is a Stored Procedure suited task. Please provide further information. Bye, ----- sanghun jung wrote: ----- Hi there, Background - Win2000 server, SQL2000 with SP3 I have a table with 10 columns. Each column has either 0 or 1. Values are changed everyday by users. At night, A DTS kicks off and read the value, if 0 then do nothing, if 1 then kick off another DTS package to update some data. In ActiveX script, if it is 0, then skip this part, not as a failure. Once it calls DTS, ActiveX reset the value to 0 to the appropreate column. Can ActiveX do this job? Can you show me sample of code that will do this or any links that I may see some ActiveX code? Thanks in advance. sanghun . |
#6
| |||
| |||
|
|
-----Original Message----- In which case you can do all this without DTS although it will provide you with a nice GUI I would have something like say you have a table with columns 1-10 and each could be set to 0 or 1) IF (SELECT Count(*) FOM TABLE WHERE col1 = 1) >0 THEN BEGIN TSQL steps END IF (SELECT Count(*) FOM TABLE WHERE col2 = 1) >0 THEN BEGIN TSQL Steps END IF (SELECT Count(*) FOM TABLE WHERE col3 = 1) >0 THEN BEGIN TSQL Steps END The only difficulty comes if the other tables you manipulate are on a different server. For this you can use a linked server or two. -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "sanghun" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:a24901c3ec06$820c02d0$a101280a (AT) phx (DOT) gbl... Hi, Valmir Thanks for your interesting on my problem. First, some thing needs to read values(either 0 = no run DTS, 1 = run DTS) from each column (about 10 columns) in a "readme" table. Each column has different DTS that will update tables. So "readme" table is the guy that tell you what to run for tonight. Users set the switch during office hours. 1. Stored Procedure, how can I make SP will read the readme table and find out what DTSs need to run tonight? 2. All the DTSs do nothing but truncate prod-table and copy all data from test-table when they execute. I am a DBA newbie (about three months now), has not touch SP yet. I will be glad to work on SP. If you can help me out on this, I will appreciate it. Thanks Sanghun -----Original Message----- Hi sanghun , Let me ask you something. Why is this done in a DTS? You have a SQL table and is going to update other SQL tables according to some business rule. For the enunciate provided, this is a Stored Procedure suited task. Please provide further information. Bye, ----- sanghun jung wrote: ----- Hi there, Background - Win2000 server, SQL2000 with SP3 I have a table with 10 columns. Each column has either 0 or 1. Values are changed everyday by users. At night, A DTS kicks off and read the value, if 0 then do nothing, if 1 then kick off another DTS package to update some data. In ActiveX script, if it is 0, then skip this part, not as a failure. Once it calls DTS, ActiveX reset the value to 0 to the appropreate column. Can ActiveX do this job? Can you show me sample of code that will do this or any links that I may see some ActiveX code? Thanks in advance. sanghun . . |
#7
| |||
| |||
|
|
-----Original Message----- Hi sanghun, Please validate my understanding of your necessity. 1. read record in readme 2. If col_1 = 1 Update Table A (or set flag to update Table A after hours) Update Table B (or set flag to update Table B after hours) Update Col_1 to 0 3. If col_2 = 1 Update Table C (or set flag to update Table C after hours) Update Table D (or set flag to update Table D after hours) Update Col_2 to 0 and so on... 8. After Hours... I read the flags and run the Truncate and Update command. All this is done within SQL Tables ? Is that it? ----- sanghun wrote: ----- Hi, Valmir Thanks for your interesting on my problem. First, some thing needs to read values(either 0 = no run DTS, 1 = run DTS) from each column (about 10 columns) in a "readme" table. Each column has different DTS that will update tables. So "readme" table is the guy that tell you what to run for tonight. Users set the switch during office hours. 1. Stored Procedure, how can I make SP will read the readme table and find out what DTSs need to run tonight? 2. All the DTSs do nothing but truncate prod-table and copy all data from test-table when they execute. I am a DBA newbie (about three months now), has not touch SP yet. I will be glad to work on SP. If you can help me out on this, I will appreciate it. Thanks Sanghun -----Original Message----- Hi sanghun , Let me ask you something. Why is this done in a DTS? You have a SQL table and is going to update other SQL tables according to some business rule. For the enunciate provided, this is a Stored Procedure suited task. Please provide further information. Bye, ----- sanghun jung wrote: ----- Hi there, Background - Win2000 server, SQL2000 with SP3 I have a table with 10 columns. Each column has either 0 or 1. Values are changed everyday by users. At night, A DTS kicks off and read the value, if 0 then do nothing, if 1 then kick off another DTS package to update some data. In ActiveX script, if it is 0, then skip this part, not as a failure. Once it calls DTS, ActiveX reset the value to 0 to the appropreate column. Can ActiveX do this job? Can you show me sample of code that will do this or any links that I may see some ActiveX code? Thanks in advance. sanghun . . |
#8
| |||
| |||
|
|
Two DBs (prod and test) are reside on same SQL server. This is dealing with pure SQL tables. As I said Test tables to Prod tables. Can we send email each other for further advice? sang_h_jung (AT) uhc (DOT) com Sanghun -----Original Message----- In which case you can do all this without DTS although it will provide you with a nice GUI I would have something like say you have a table with columns 1-10 and each could be set to 0 or 1) IF (SELECT Count(*) FOM TABLE WHERE col1 = 1) >0 THEN BEGIN TSQL steps END IF (SELECT Count(*) FOM TABLE WHERE col2 = 1) >0 THEN BEGIN TSQL Steps END IF (SELECT Count(*) FOM TABLE WHERE col3 = 1) >0 THEN BEGIN TSQL Steps END The only difficulty comes if the other tables you manipulate are on a different server. For this you can use a linked server or two. -- -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.allisonmitchell.com - Expert SQL Server Consultancy. www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "sanghun" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:a24901c3ec06$820c02d0$a101280a (AT) phx (DOT) gbl... Hi, Valmir Thanks for your interesting on my problem. First, some thing needs to read values(either 0 = no run DTS, 1 = run DTS) from each column (about 10 columns) in a "readme" table. Each column has different DTS that will update tables. So "readme" table is the guy that tell you what to run for tonight. Users set the switch during office hours. 1. Stored Procedure, how can I make SP will read the readme table and find out what DTSs need to run tonight? 2. All the DTSs do nothing but truncate prod-table and copy all data from test-table when they execute. I am a DBA newbie (about three months now), has not touch SP yet. I will be glad to work on SP. If you can help me out on this, I will appreciate it. Thanks Sanghun -----Original Message----- Hi sanghun , Let me ask you something. Why is this done in a DTS? You have a SQL table and is going to update other SQL tables according to some business rule. For the enunciate provided, this is a Stored Procedure suited task. Please provide further information. Bye, ----- sanghun jung wrote: ----- Hi there, Background - Win2000 server, SQL2000 with SP3 I have a table with 10 columns. Each column has either 0 or 1. Values are changed everyday by users. At night, A DTS kicks off and read the value, if 0 then do nothing, if 1 then kick off another DTS package to update some data. In ActiveX script, if it is 0, then skip this part, not as a failure. Once it calls DTS, ActiveX reset the value to 0 to the appropreate column. Can ActiveX do this job? Can you show me sample of code that will do this or any links that I may see some ActiveX code? Thanks in advance. sanghun . . |
![]() |
| Thread Tools | |
| Display Modes | |
| |