0

Question 1:

I'm running a query like this:

select * 
into table 
from view

The view has a lot of calculations and the query is running for over 15 hours. I know how many rows I need to have in the data. Is there a way to know how many rows were insert to table till now so I will know if to keep with this process or find another way to execute this.

Question 2: is the Insert into , select from more efficient than select * into? when you are trying to move data from view to a table?

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Toto88
  • 129
  • 3
  • 11
  • 1
    Question 2 : Please refer [this link](https://stackoverflow.com/questions/6947983/insert-into-vs-select-into) – RN92 Jul 06 '17 at 06:15
  • Did you try simply `select count(*) from table`? – Zohar Peled Jul 06 '17 at 06:26
  • yes. It takes a lot of time also. I'll try to find a way to make my code more efficient. – Toto88 Jul 06 '17 at 07:10
  • @Toto88. I cant understand your full explanation. However, I suggest you that try, `select @@rowcount`, after run your `select` query. – Pugal May 19 '18 at 08:42

1 Answers1

0

try

select count(*) from table

Looking_for_answers
  • 343
  • 1
  • 6
  • 20