SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
9,126 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a .csv that has 4 columns that I need to insert data from two of those columns into two different tables. Two of those columns I need to join to two different tables to do insert statements into the two tables. Anyone know how to do this?
I'd like to use SSIS, but I am not a DBA and can't even figure out how to use it after it's installed and can't seem to even find it. So T-SQL will have to do.
Is this a one-time import or scheduled?
If this is one time, you can just use the import/export wizard to import it into a table. Then write TSQL to do the inserts into the target table.
It will be scheduled to run daily.
I've also figured out how to get to SSIS but it appears I will need to install a package for one of the folder paths under Data Collector. Does anyone know which folder I should use for this and which Package I should install?
It is not clear what you are asking.
A screen shot would be handy.
Sign in to comment
3 answers
Sort by: Most helpful
The simplest way to do what you describe it to import the CSV into a "staging" table, and then write TSQL to do what you need to do.
Sign in to comment
Yes, as Tom says, for a solution without SSIS (which I don't know myself), you need to import the file into a table, and then work from the table.
If the file is located so that you can access it from SQL Server, you can use the BULK INSERT command.
If it is not, you may be able to import it with the command-line utility BCP.
We also need which version of SQL Server you are using. What's the output of "SELECT @@version"?
Its 2014 Standard
OK, so this means no matter you use BULK INSERT or BCP, you cannot handle a file like this:
That is, a file where text is quoted sometimes, and sometimes not. If fields are quoted consistently, or not all there are no problems. But you only said CSV file, and that can be both this and that.
Sign in to comment
Hi @MR BILL ,
If so, please create new Integration Services project and package.
Best Regards,
Mona
----------
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hot issues in November--What can I do if my transaction log is full?
Hot issues in November--How to convert Profiler trace into a SQL Server table?
Hi @MR BILL ,
May I know if you have anything to update?
Best Regards,
Mona
Sign in to comment
Activity