From: pelican on 12 Aug 2010 15:55 I need to import a text file every 30 minutes into SQL. The text file looks like this One, two, three One, two, three One, two, three, four, five, six, seven One, two, three One, two three, One, two, three, four So you see number of columns varies. But the SQL import wizard sets up the number of columns based the very first line of the input file. So the file on SQL looks like this: Column 1 Column2 Column3 One Two Three One Two Three One Two three, four, five, six, seven One two three One two three One two three,four I have tried many ways on SQL to find a way to let the import wizard to make it a 7 column table, but it did not work. I would like to have this: Column 1 Column2 Column3 Column4 Column5 Column6 Column7 One Two Three One Two Three One Two three four five six seven One two three One two three One two three four Can anyone tell me what I should do? Thanks in advance! Pelican
From: Andrew J. Kelly on 13 Aug 2010 09:09 Maybe this will help: http://www.sqlis.com/sqlis/post/Handling-different-row-types-in-the-same-file.aspx -- Andrew J. Kelly SQL MVP Solid Quality Mentors "pelican" <pelican(a)discussions.microsoft.com> wrote in message news:558D36E4-A23A-4CCE-9D41-E2400B2DA066(a)microsoft.com... > I need to import a text file every 30 minutes into SQL. The text file > looks > like this > > One, two, three > One, two, three > One, two, three, four, five, six, seven > One, two, three > One, two three, > One, two, three, four > > So you see number of columns varies. But the SQL import wizard sets up > the > number of columns based the very first line of the input file. So the > file > on SQL looks like this: > > Column 1 Column2 Column3 > One Two Three > One Two Three > One Two three, four, five, six, seven > One two three > One two three > One two three,four > > I have tried many ways on SQL to find a way to let the import wizard to > make > it a 7 column table, but it did not work. > I would like to have this: > > Column 1 Column2 Column3 Column4 Column5 Column6 Column7 > One Two Three > One Two Three > One Two three four five six seven > One two three > One two three > One two three four > > Can anyone tell me what I should do? Thanks in advance! > Pelican >
From: pelican on 13 Aug 2010 12:16 Thank Andrew. I searched for "Flat File Connection" in SQL Management Studio and SSIS. I was not successful. Where can I open the screen for Flat File Connection" and do the wonderful steps that this article shows? thanks, "Andrew J. Kelly" wrote: > Maybe this will help: > http://www.sqlis.com/sqlis/post/Handling-different-row-types-in-the-same-file.aspx > > > -- > > Andrew J. Kelly SQL MVP > Solid Quality Mentors > > "pelican" <pelican(a)discussions.microsoft.com> wrote in message > news:558D36E4-A23A-4CCE-9D41-E2400B2DA066(a)microsoft.com... > > I need to import a text file every 30 minutes into SQL. The text file > > looks > > like this > > > > One, two, three > > One, two, three > > One, two, three, four, five, six, seven > > One, two, three > > One, two three, > > One, two, three, four > > > > So you see number of columns varies. But the SQL import wizard sets up > > the > > number of columns based the very first line of the input file. So the > > file > > on SQL looks like this: > > > > Column 1 Column2 Column3 > > One Two Three > > One Two Three > > One Two three, four, five, six, seven > > One two three > > One two three > > One two three,four > > > > I have tried many ways on SQL to find a way to let the import wizard to > > make > > it a 7 column table, but it did not work. > > I would like to have this: > > > > Column 1 Column2 Column3 Column4 Column5 Column6 Column7 > > One Two Three > > One Two Three > > One Two three four five six seven > > One two three > > One two three > > One two three four > > > > Can anyone tell me what I should do? Thanks in advance! > > Pelican > > > . >
|
Pages: 1 Prev: Defining a date variable as null in SQL Server 2008 Next: Reduce log file size |