0

I have a large set of data. Now i am passing that data in the form of concatenated string with delimiters. In the stored procedure i am parsing the string and storing responses to table. Is this is the best approach OR passing Table to stored procedure is best approach.

I heard that passing table to stored procedure will incur multiple database calls for each row. Is this is true?

Siva
  • 109
  • 1
  • 6
  • 1
    Just use the table. If nothing else, it's much cleaner. If - and *only when* - there is verified performance problem, then consider trying to "optimize" it. (If you absolutely do not want to use a TVF/TVP then at least use XML, which SQL Server supports fairly well, for the serialization format.) – user2864740 Apr 18 '14 at 19:19

1 Answers1

2

You mean table-valued parameters? No, it won't cause "multiple database calls for each row", it's just another way of passing a large chunk of data into a procedure.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
dean
  • 9,960
  • 2
  • 25
  • 26
  • "I heard that passing table to stored procedure will incur multiple database calls for each row." - but is *all* the data sent in a single "call" or across multiple (RPC) calls? And does it matter? – user2864740 Apr 18 '14 at 19:19
  • Yes to both questions. – dean Apr 18 '14 at 19:21