SSIS Get Columns of Two Different SharePoint Lists - sql-server

I'm trying to get two columns but each one of them are in differents SharePoint Lists.
Is it possible to get these columns and put it into a single destination? I'll need to use both later.
Thanks in advance.

Assuming you can use SSIS this article gives detailed instructions on how to get information from a sharepoint list. Once you have set up the sharepoint data sources to get the single column from the lists. Then point the data flow out to a Union All component, this will allow you to combine the two desperate data flows into on data flow (see attached picture). Then you can connect the single data flow to data destination, in the case of the picture it is a SQL server table.
If you do not have access to SSIS it is possible to do extract the data directly from the SQL tables if you have access to the sharepoint database. Not an approach that l would recommend.

Related

SSIS Send email to different recipients with different data from SQL Table

I am trying to create an SSIS Package that sends out emails to different recipients and includes some of the data as a table that is either included in the body of the email or attached as an Excel file.
I have three tables, one that includes the email addresses, one that includes the error type and the main table that contains customer information like name, old address info, and new address info all broken out into about 16 different columns, of which are codes to pull from the two other tables to determine which person to email to update the address and a code description on why they need to update it.
I have created a script task to combine the data and pass it to a foreach loop container.
I'm not sure how to take the customer info, old address and new address columns of data from what I've pulled together in the sql task (CIF_Nbr to Current_XIPplus4) and create a table from it that can be inserted into the body or added as an attachment to the send mail task.
A branch could have multiple lines of data so I would prefer one attachment for all same branches sent only once to that branch.
My three tables have the following columns:
I'm using Microsoft Visual Studio 2008 and SQL server 2008 if that helps. I'm pretty much stuck with the default toolbox.
Hopefully this all makes sense. I'm fairly new to visual studio so the more detail the better. Thanks.
I decided to take this a different direction since this was being used on more of an adhoc basis.
Instead of SSIS I set it up in excel using power query to pull the data together from different sources and some vba code found at Ron Debruin's site http://www.rondebruin.nl/ to parse out and email each group needing to make an update.
Thanks to all for the help provided.
Let me know if you have any questions.

What would be the best method for building Dynamic Reports from my SQL DB Data?

I am building a simple database with about 6-7 tables. I will be setting a schedule to do a clean import from a .txt file.
I want to take this data and create a report, like I would do in an excel spreadsheet, convert it to a pdf and post it to our company intranet for those interested to access it.
I'm trying to think of the best way to build my report. Would I just use an excel spreadsheet with a direct connection to the database? Would I create some sort of console application (c/c#/vb/vb.net) that would query the db, generate the report in an excel file, convert to pdf and save?
I'm quite comfortable in these different languages, just not as experienced in the reporting services (although I do have a lot of experience working with EXCEL and VBA Macros) but I want to get into it (SSRS) and get familiar with it as I will be doing a lot of projects like this in the future. This is seems like an easy one to get my hands dirty with and learn and build off of.
Any insight or suggestions would be greatly appreciated.
Thanks so much!
My suggestion:
Create desired SQL queries to retrieve the data in desired form
Link these queries to your Excel sheet, perhaps directly in form of pivot tables for aggregation of results
Using VBA, you can easily create PDF from the data at the click of a button
The initial design will be time intensive, but after that, everything is automated and one just needs to press the button that creates the PDF.
How to link Access queries to your Excel file:
Data --> Get external Data
You can easily refresh all data whenever you open the Excelsheet by using the code below in the On Open event of the workbook:
ThisWorkbook.RefreshAll
If you need further clarification, do not hesitate to ask
If your end goal is to create a PDF that will be out on your intranet then I would create the report in SSRS. Then you can schedule it to run and output a PDF to your network location.
I've had good experiences using a pivot table in Excel which is a connected table to your SQL database.
In the connection parameters in Excel there is a field where you can define your SQL query, whether it be to call a stored procedure or just a simple SELECT statement.
The main reason I prefer a pivot table SQL connection rather than a normal table connection is because if you have a chart that references the connected table, the chart formatting will be reset when you refresh your connection (if you need to updated your report).
If I use a chart that references a pivot table (or a pivot chart) then the formatting is retained.

Automatically or easily updating my database

I have available to me a Report that is generated in Microsoft SharePoint, and it holds the quantities for certain items. The reports can be exported as excel documents, but if it is possible i would like to avoid that.
In my Access database I have all the same items but with additional data concerning special requests and item identification in the item's respective documentation folders.
I am looking for a way to have the select few columns that represent the quantities and some other factors, to be automatically updated in my database.
How can I go about this? Is there a specific terminology for what I am attempting to do, I am unable to find it on Google?
So to clarify ... you have item data exported from SharePoint and item data in Access and ideally you'd like to merge both and store the results in Access.
Or maybe another way of putting it, you would like to compliment the data in Access with the data from SharePoint.
If the database that powered the SharePoint report ran in Access as well, the word you are looking for is replication. You want to automatically replicate the data from one server/database to another.
Unfortunately I don't know of any software that replicates data to Access.
Your best bet would be to write a program that scheduled the running of the SharePoint report and then imported that data into Access.
I'm happy to give you the terminology of what to Google for. Just don't make me use SharePoint and Access. :)
If you have the same items in a report in SharePoint and in Access hopefully there is a field that uniquely identifies each item and is used in each table (a unique key). If these items (typically we would say 'records' or 'tuples' in database circles) are inventory SKUs or product numbers would be examples of potential unique keys. If you re taking the information in two tables and merging them together using a unique key we call it a 'Natural Join'. I know Access and SharePoint both support SQL and using SQL this would be done using a SELECT statement.
I would try googling: Natural Join tables in SharePoint and Accesss
Or: SQL SELECT between SharePoint and Access
Hope this helps.
If you choose linked tables to SharePoint (as opposed to importing them local), then you will always have a live copy of the data. In fact this is replicated model in Access 2010. Then a query could be used that joins in the additional table columns with quanity etc. Replication would need caution since any changes to the local access table would go back up to SharePoint and that may not be desired or even allowed.
In this case I would thus simply import the SharePoint tables local and again use a join based on a PK to the tables with quanity etc. that is local. Note that the local copy + cache runs very fast in 2010, and prior to Access 2010 + SharePoint 2010 the speed of such a setup is not so good compared to Access 2010.
If you are using an older version of Access + SharePoint then I would suggest you continue your approach of important the SharePoint tables (as opposed to being linked to the live tables on SharePoint). You then again simply use a query that joins in the additional columns you wish to display in your reports.
Such a results query would not only be of use for reports, but you could export that query into Excel or word.
Best regards.

SSRS multiple data sources

I am using SSRS 2008 to create a report. Is it possible to create a report from multiple data sources?
Thanks.
With SQL Server Reporting Services 2008 R2 you can use the lookup functions to lookup a piece of data from a second dataset:
http://blog.datainspirations.com/2010/03/19/sql-server-2008-r2-reporting-services-look-up-look-down-look-all-around-part-i/
Very handy.
From older versions of SSRS, you can create a subreport that occupies a cell in a table: the subreport can be called with a different parameter for every row, effectively "joining" to the second dataset.
http://technet.microsoft.com/en-us/library/ms160348.aspx
Yes, you can use multiple Data Sources. Although you can't join the data. For instance, you can't have a table with fields from both Data Sources. BUT you can have a Data Source from Oracle and a Data Source from MS SQL. You can use a List to group things together.
Generally, you'll want to use linked servers if you can and do the work in your query.
You can present data from multiple data sources in a single report, merging datasets from different sources however, is not possible, unless you use some technique to merge this data from the database side, i.e. using a stored procedure. Also if your stored procedure returns multiple result sets, you have to do things like adding them into a table and returning the combined data as a single result, its not terribly difficult, but to your originally stated question, you can use multiple data sources in a report quite easily.

Run a query from two data sets programmatically

I am trying to reconcile data from a website and a database programmatically. Right now my process is manual. I download data from the website, download data from my database, and reconcile using an Excel vlookup. Within Excel, I am only reconciling 1 date for many items.
I'd like to programmatically reconcile the data for multiple dates and multiple items. The problem is that I have to download the data from the website manually. I have heard of people doing "outer joins" and "table joins" but I do not know where to begin. Is this something that I code in VBA or notepad?
Generally I do this by bulk inserting the website data into a staging table and then write select statments to join that table to my data in the database. You may need to do clean up first to be able to match the records if they are stored differently.
Python is a scripting language. http://www.python.org
There are tools to allow you to read Excel spreadsheets. For example:
http://michaelangela.wordpress.com/2008/07/06/python-excel-file-reader/
You can also use Python to talk to your database server.
http://pymssql.sourceforge.net/
http://www.oracle.com/technology/pub/articles/devlin-python-oracle.html
http://sourceforge.net/projects/pydb2/
Probably the easiest way to automate this is to save the excel files you get to disk, and use Python to read them, comparing that data with what is in your database.
This will not be a trivial project, but it is very flexible and straight forward. Trying to do it all in SQL will be, IMHO, a recipe for frustration, especially if you are new to SQL.
Alternatively:
You could also do this by using VBA to read in your excel files and generate SQL INSERT statements that are compatible with your DB schema. Then use SQL to compare them.

Resources