October 11, 2008 at 3:11 pm
Hi friends
I am trying to write vb.net script in SSIS script task for the following logic.
while ( select count(*) from table1) > 0
insertsql = "insert into table1 (col1,col2)values Select col1,col2 from table2"
SqlHelper.ExecuteNonQuery(connectionString, CommandType.Text, insertsql)
End While
insert statement works perfect. How do I write the count sql statement in while ?
AM
October 11, 2008 at 3:20 pm
selectsql = "select count(*) from table1"
SqlHelper.ExecuteScalar(connectionString, CommandType.Text, selectsql)
While (SqlHelper.ExecuteScalar(connectionString, CommandType.Text, selectsql) > 0
How could I change this script to make it works?
Thanks for help.
October 13, 2008 at 7:46 am
I found a way to make it works. I have to close this question.
October 13, 2008 at 8:03 pm
ayemya (10/13/2008)
I found a way to make it works. I have to close this question.
You should continue the question because you're still using a loop and a function to do this. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
October 13, 2008 at 9:30 pm
Jeff Moden (10/13/2008)
ayemya (10/13/2008)
I found a way to make it works. I have to close this question.You should continue the question because you're still using a loop and a function to do this. 😉
I'd imagine he'll be back... with the "my machine is smoking because that thing is processing FOREVER"....:) That's a funny thing that happens when you use a WHILE clause with no exit strategy.....:cool:
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply