![]() 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. 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. 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. Discussion: The STRINGSPLIT(string, separator) function in SQL Server splits the string in the first argument by the separator in the. Solution 1: SELECT value FROM STRINGSPLIT('An example sentence.', ' ') The result looks like this: value An example sentence. Example 1: You have a sentence, and you'd like to split it by the space character. I never know (before runtime) how many values there will be in that string. Problem: You want to split a string in SQL Server. ![]() Lets remove them by splitting each title using whitespaces and. I have a string containing a lot of values all seperated by. Ive heard a lot of analysts/data scientists saying they spend most of their time. I'm sure the answer is right there in my face but I can't seem to find a good way to do this. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |