September 29, 2010 at 6:03 am
Hi
We have some notes data that I am supposed to put into a ms sql table.
The notes data look something like this.
511;102;106;0601;50040;201101;2011;0;0,5;0
511;102;106;0601;50040;201102;2011;0;0,5;0
511;102;106;0601;50040;201103;2011;0;0,5;0
I now have them imported to my sql server in one table with one collumn.
The ; indicates a new collumn.
What would be the best and easiest way to make this in table manner.
Comments please?
Dan
September 29, 2010 at 6:56 am
Personally, the easiest would be to put SQL Server Integration Services to work on it. SSIS can do this type of break down quite easily.
Another option, not as easy, would be to use SQLCMD.exe. You can define the column & row delimiters and import the data that way.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
September 29, 2010 at 8:09 am
So you want to break apart this delimited string (with the ; being the delimiter) into separate fields? If I'm understanding this correctly, click here for the latest Delimited Split Function.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply