SSIS package: permissions - sql-server

I'm fairly certain at this point that my trouble is rooted in permissions.
My SSIS package simply pulls data from an Access DB and populates a SQL table. When I run this package in VS (by clicking Start), it works and my SQL table populates. As soon as I try to execute the package within SSMS or in a SQL Agent job, it falls apart, with the following errors:
I am running SQL Server 2016 and SQL Server Data Tools in VS 2013, in case that is relevant information.
Great appreciation for anyone who can point me in the right direction.

Related

The database 'xxx' cannot be opened because it is version 904

I can't attach my database. When I try to attach a database in SQL Server Management Studio, I get this error:
The database 'C:\FILES\ACCOUNTING.MDF' cannot be opened because it is version 904. This server supports version 852 and earlier. A downgrade path is not supported. Could not open new database 'C:\FILES\ACCOUNTING.MDF'. CREATE DATABASE is aborted. (.Net SqlClient Data Provider)
and I have tried these commands:
cd "C:\Program Files\Microsoft SQL Server\130\LocalDB\Binn"
SqlLocalDB.exe delete "MSSQLLocalDB"
SqlLocalDB.exe create "MSSQLLocalDB"
but it still has an error
You CANNOT do this - you cannot attach/detach or backup/restore a database from a newer version of SQL Server (v904 = SQL Server 2019) down to an older version (v852 which is SQL Server 2016) - the internal file structures are just too different to support backwards compatibility.
You can either get around this problem by
using the same version of SQL Server on all your machines - then you can easily backup/restore databases between instances
otherwise you can create the database scripts for both structure (tables, view, stored procedures etc.) and for contents (the actual data contained in the tables) either in SQL Server Management Studio (Tasks > Generate Scripts) or using a third-party tool
or you can use a third-party tool like Red-Gate's SQL Compare and SQL Data Compare to do "diffing" between your source and target, generate update scripts from those differences, and then execute those scripts on the target platform; this works across different SQL Server versions.
The error message in the problem statement occurs because the SQL Server database files (*.mdf, *.ndf and *.ldf) and backups are not backward compatible. Backward compatibility is why we cannot restore or attach a database created from a higher version of SQL Server to a lower version of SQL Server. However, there are a few options that can help us to downgrade the database from a higher version of SQL Server to a lower version SQL Server. These options include:
Use the Generate Scripts Wizard in SQL Server Management Studio
Use SQL Server Integration Services
Create Custom Scripting and BCP
In this tip we will use the Generate Scripts Wizard in SQL Server Management Studio.
Here are the basic steps we need to follow:
Script the database schema and data from the higher version of SQL Server by using the Generate Scripts Wizard in SSMS.
Connect to the lower version of SQL Server, and run the SQL scripts that were generated in the previous step, to create the database schema and data.
In the next section, I will demonstrate the steps for downgrading a SQL Server 2012 database to SQL Server 2008 R2 database.
Steps to Downgrade a SQL Server Database Using SSMS Generate Scripts Wizard
Step 1 Script the schema of the OUTLANDER database on the SQL Server
2012 instance (IITCUK\DEV01) using the Generate Scripts wizard in
SSMS.
In Object Explorer connect to IITCUK\DEV01, right-click on the
OUTLANDER database, expand Tasks and choose "Generate Scripts...".
This launches Generate and Publish Scripts wizard. Click Next, to skip the Introduction screen and proceed to the Choose Objects page.
On the Choose Objects page, choose option "Script entire database and all database objects", and then click Next to proceed to "Set Scripting Options" page.
n the Advanced Scripting Options dialog box,
set Script for Server Version to SQL Server 2008 R2 (or whatever version you want)
under the Table/View Options, set Script Triggers, Script Indexes and Script Primary Keys to True
and set Types of data to script to Schema and Data - this last option is key because this is what generates the data per table.
Once done, click OK, to close the Advanced Scripting Options dialog box and return to Set Scripting Options page. In Set Scripting Options page, click Next to continue to Summary page.
After reviewing your selections on Summary page, click Next to generate scripts.
Once scripts are generated successfully, choose the Finish button to close the Generate and Publish Scripts wizard.
Step 2 Connect to the SQL Server 2008 R2 instance
(IITCUK\SQLSERVER2008), and then run the SQL scripts that were
generated in Step 1, to create the OUTLANDER database schema and data.
In Object Explorer connect to IITCUK\SQLServer2008, then in SQL Server
Management Studio, open the SQL Server script you saved in Step 1
Modify the script, to specify the correct location for the OUTLANDER database data and log files. Once done, run the script to create the OUTLANDER database on IITCUK\SQLServer2008 instance.
Upon successful execution, refresh the Database folder in Object Explorer. As you can see in the following image, the OUTLANDER database has been successfully downgraded.
Notes
There are a few things to be aware of when using this approach.
This solution creates one large SQL file that has the scripts to create the database objects and also INSERT statements for the data in the tables.
For a large databases, the SQL file can get very large if you script out both the schema and the data and could be hard to load into an editor. Also, you may get a memory related error message from the editor if the file is too big.
For large databases, around 1GB or more, if this approach does not work, then you should look at using SSIS to migrate the database or create custom scripts to script out the objects and BCP out the data for each of the tables. You can use this Generate Scripts wizard to just generate the schema without the data and use SSIS or BCP to export and import the data.
This approach works for SQL Server 2017 to SQL Server 2005. Some of the scripting options might be a bit different in newer versions, but the process is still the same.
Before just executing the script, you should review the script to make sure everything looks correct such as the path of the database files, database options, etc.
Also if you are using new functionality that does not exist in the lower version, SQL Server won't be able to create the objects and you will need to review the scripts that were generated and update the code accordingly.
For a very simple database this approach should work pretty easliy, but you might need to spend some time making some modifications to the script for a more complex database.
Below is a list of all of the scripting options. If you click on an item, the bottom part of the screen gives you a short definition of the option.
Next Steps
To avoid this issue, always make sure that you perform a full backup of the database before you upgrade the SQL Server and database to a higher version of SQL Server. In addition, be sure to thoroughly test the application prior to releasing the application to the users.
Consider this downgrade option as your last option to rollback from an upgrade because the time and storage needed can be very large.
With a very large database be sure you have sufficient storage to support the data needs.
Be sure to verify row and object counts as well as test your application before releasing to production.
Additional Resources:
Why Can't I Restore a Database to an Older Version of SQL Server?
SQL Server Database Engine Backward Compatibility
SQL Server Upgrade Tips

How to deploy to SSIS package to DB server, encountering many errors

(Note: this is my first post please bear with any mistakes in my presentation)
My issue is that I have a very simple SSIS package using the Microsoft Oracle Connector (created by Attunity) which executes fine within Visual Studio 2015 on my laptop, but throws numerous errors when deployed to either SQL Server, or when attempting to run from the command line. I've tried various links I've found here and elsewhere but I still cannot get this to work.
I am a complete newbie on these tools, I am coming from an Oracle and .NET background, so I may be missing some basics here.
Laptop setup is: Visual Studio 2015, ODP.NET 64 bit, 64-bit Oracle Client, MS Oracle Connector by Attunity 5.0 64-bit, Sql Server Data Tools for VS 2015, Sql Server Management Studio 2016 - 13.0.16106.4.
On the database server: SQL Server version is 2016 (SP1) - 13.0.4001.0 (X64)
Developer Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 , Oracle 64-bit client, SSIS, and MS Oracle Connector by Attunity 5.0 64-bit version.
I'm attempting to populate 3 SQL Server tables from 3 corresponding Oracle tables.
I have a very simple integration services project in VS 2015: 1 control flow item, with 3 data flows - all 3 run a simple SELECT against the same Oracle database with a connection manager to that DB, each one reads a different table, and populates a different SQL Server table (using the OLE Destination object), all 3 Oracle tables are in the same database instance, and SQL
Server tables are in the same database.
The project runs fine from my laptop within the VS IDE, all 3 feeds run in parallel and populate the corresponding SQL server tables as expected.
However, I'm getting numerous error messages attempting to execute the package using other methods. Googling around has not helped to clarify things - I think I basically understand the error messages, but I'm unclear on how to resolve them.
DTEXEC - I copied my .dtsx file for the above project to the C:\TEMP folder server where SQL Server resides, and I ran the 64-bit dtexec utility as follows:
F:\Program Files\Microsoft SQL Server\130\DTS\Binn>dtexec /file c:\temp\package.dtsx > c:\temp\dtexec_errors.txt
Please see images below for errors I'm receiving.
SSIS DB catalog - Created the SSISDB catalog under 'integration services catalogs' folder in SSMS. Within Visual Studio I right clicked the package and selected Deploy . After deployment, right clicked the package in SSMS, picked 'Execute'. Received several similar errors to what is shown in the screen shots.
Thanks in advance for any advice, pointers, assistance. Also note that from Oracle to SQL server I plan to do little to no transformation, plus this solution will eventually be used for possibly upwards of 200+ tables, if there is a better or easier way that can be automated and gets similar high performance I'm open to hearing it.

SSIS Package (SQL 2016) getting failed from batch execution

We have developed SSIS package which had target framework SQL Server 2014.
Package has 2 states:
1. Which truncates the required SQL Table.
2. Pull data from SharePoint list data by hitting Service call and dumps data to truncated sql server table.
Latter on some SQL Server 2016 upgrades been done on server from IT department. So Dev team has to change target version in SSIS to SQL Server 2016. Which is working fine from SSDT tool (All states executes perfect).
The generated ".dtsx" I found in "~/obj/Development" path in source code directory. Then we developed the the batch file which is targeting to execute generated .dtsx file. If we executes the batch file as administrator it doesn't works, takes amount of time and shows "Operation TimeOut" at the end. Why should this is happening, any clue ?

Delete entries from SSIS package execution report in SSMS (SQL Server Management Studio)

I've deployed SSIS packages into SSMS (SQL Server Management Studio) and tried to execute project.
But, It failed to run due to some configuration errors.
In order to resolve issues, I changed configurations multiple times and executed SSIS project in SSMS.
Now, issues resolved and job is running successfully.
However, execution information report shows lot of failure entries and I'd like to delete them.
Experts, could you please help with how to delete those entries?
Thanks in advance.
Under 'Integration Services Catalogs', right click SSISDB - Properties, under 'Operations Log', 'Retention Period', by default installation, it is 365 days. You may adjust it. SQL Server will delete for you. It will delete all projects log, not just this project.
The other way is to delete records in database SSISDB tables. Not recommended.

invoke_ascmd on sql server 2012

I am trying to create a local cube through an SSIS task. With earlier version of sql server I used ascmd. I could not find ascmd for sql server 2012, so I used invoke-ascmd. However when I use the -Server option to point to the local cube, it errors out with the message:
Warning WarningCode="-1055653884" Description="Errors in the met adata
manager. Either the database with the ID of '' does not exist
in the server with the ID of '\LocalCube', or the user does
not have permissions to access the object." Source="Microsoft SQL
Server 2012 Analysis Services"
Does anyone know how to resolve this?
This appears to be happening only when I migrate projects from sql server 2008. Simply migrating the analysis server project, and changing the connection string values in datasource,building,deploying and recreating the xmla script does not seem to be enough.
I need to actually go to the analysis server project delete the cube, data source etc. and recreate them and then recreate the xmla script.

Resources