


String with values look like this "001,002,003,004,005.8000" how can I insert each of the values separated by, without making 8000 INSERT statements. Splits a string using a delimiter and returns a substring at index slice. If I have 8000 records it would result in 8000 different insert and I would probably get fired for even thinking about doing this.Ĭan someone point me out in the right direction ?

M圜ommand.CommandText = "INSERT INTO tempTable VALUES value) īut let's face it this is not the way to do it.
STRING SPLIT UNIVERSAL DATABASE HOW TO
VB myString = "101,102,103,104,105,106,107,108,109"įor Each value As String in myString.Split(",") VBA String Array How to Declare and Initialize String Array in Excel VBA as string Understanding Excel VBA Data Types (Variables and Constants) as string. I could easily do something like this (I'll make a small one for the example) : I want to insert them in a database (in this case SQL Server 2008) but the string can be way too large for a NVARCHAR(MAX) so I create a temp table and want to insert the values in it. I never know (before runtime) how many values there will be in that string. I have a string containing a lot of values all seperated by. I'm sure the answer is right there in my face but I can't seem to find a good way to do this.
