I am trying to find the easiest and simplest and quickest way to upload a sheet from Excel to a table in SQL Server 2012 automatically every morning as a job from a location on my folder to the table.
-
What have you tried so far? Do you have any part of the process working?Peter Smith– Peter Smith2019-09-16 20:22:51 +00:00Commented Sep 16, 2019 at 20:22
-
i have manually added it so far. just looking online i read ssis is the best solution but i dont have visual studiosjrj– jrj2019-09-16 20:25:15 +00:00Commented Sep 16, 2019 at 20:25
-
SSIS runs on the SQL server. Do you have access to the SQL server? Have you tried to run this from SQL or just from Windows. You can schedule tasks in the server with the agent.Peter Smith– Peter Smith2019-09-16 20:28:24 +00:00Commented Sep 16, 2019 at 20:28
-
i have access to sql server and the the server and the table i am trying to dump this into. the schedule tasks does not work for excel sheets from what i read online?jrj– jrj2019-09-16 20:36:15 +00:00Commented Sep 16, 2019 at 20:36
-
There are several examples via Google. See this one here for example.Peter Smith– Peter Smith2019-09-16 20:42:37 +00:00Commented Sep 16, 2019 at 20:42
1 Answer
SSIS is the ETL tool you could use, but if it’s a very simple job you can just write a BCP command.
https://learn.microsoft.com/en-us/sql/tools/bcp-utility?view=sql-server-2017
The way the schedule it is to add the task to the agent job on the server. A few things to bear in mind with ETL:
Will your file be named the same each day?
Do you need to retain archived versions of the file?
How do you do error handling if it’s absent or malformed?
Does the DDL need to change periodically to accomodate new date ranges (I.e. new day/month year) Will this pattern be reused in the future?
Do you need to test logically (duplicates/logical fallacies/referential integrity etc)?
Under whose account will the job run (hint, don’t use your own - get a service account)?
The more complex the answers are to these types of questions the more likely you’ll need a real ETL tool like SSIS