sql server - Convert excel data into SQL table -
I have an Excel, which has a few columns (column 1, column 2, column 3, .... so on ) And the rows, the number of columns and rows is not fixed here.
Now the data of this Excel has been copied into one table ( Type-Navbar (Max) ) ... Now I have to take data from this column and SQL Need to show in table format in If the number of columns is fixed, then I can easily convert column values into XML values and show the data in a tabular format. As the number of columns is not fixed, please get the desired output, please suggest. Believe me, you use ',' as the delimiter . Will the following help come? Scalar Function Downloads from anywhere Results from the sample above < pre>
2. You do not worry about performance after putting everything in a column function changes [dbo]. [ fnString_DelimeterIndex] (@Text NVARCHAR (4000), @Delimiter CHAR, @Section SMALLINT) declared back as NVARCHAR (4000) @NextPos SMALLINT, @LastPos SMALLINT, @Found SMALLINT start, @Rosh Please select @ rect = 1 @ @extPos = CHARINDEX (@Delimiter, @Text, 1), @LastPos = 0 if the @ bit> @txt = reverse (@Text) -, @ section = 1, select @btpos = 0 , @Found = 1 @NextPos & gt; 0 and ABS (@chen)>
COL1 COL2 COL3 COL4 1 2 3 4 1 2 3 1 2
Comments
Post a Comment