Quantcast
Channel: SQL Server Integration Services forum
Viewing all 24688 articles
Browse latest View live

SSIS "Release" Configuration (VS2015 / SSDT) - Oversight?

$
0
0

Is there any specific reason why SSIS (and SSAS as it seems) do not come pre-setup with a "Release" configuration within Visual Studio (using 2015 at present) when a new project of this type is created? - I can only see that they come with a "Development" configuration as standard.

What also seems to be a little counter-intuitive, is that by attempting to create a "Release" configuration for the SSIS project specifically, Visual Studio indicates this already exists so prevents you creating it. However, it does let you rename the "Development" configuration to "Release" (which would suggest it didn't already exist).

I quite often have solutions containing different types of projects (e.g. C#.NET, SQL Database, SSIS, SSRS) but if I want to build these using a standalone build server and build the project via the command line use of the Visual Studio "devenv" exe/application, there is no "Release" configuration for SSIS (and SSAS) as default. Building using the "Default" configuration may not be desired on some of the projects and it seems additional work to add a "Release" configuration into every new SSIS (and SSAS project) just for this purpose, when, on first view (please feel free to correct me if wrong or there is some good reasoning for this), it would seem a reasonable piece of functionality to have as standard on a new project of these types.

It's often more convenient (less setup) for me to build a Solution of Projects using the same configuration rather than each Project specifically using different configurations per project.

Any thoughts/reasoning on this?




Error deploying SSIS package to SSIS catalog

$
0
0

Hello,

I get the following error when deploying the SSIS package to SSIS catalog on SQL Server 2014 from VS 2015.

Can someone please help me to resolve this error?

Error: could not find stored procedure 'SSISDB.catalog.deploy_packages'. (.Net SqlClient Data Provider)

Error Number: 2812
Severity: 16
State: 1
Line Number: 1

------------------------------
Program Location:
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.SqlServer.IntegrationServices.Common.ObjectModel.SqlHelper.ExecuteSQLCommand(SqlStoreConnection storeConnection, CommandType cmdType, String cmdText, SqlParameter[] parameters, ExecuteType execType, Int32 commandTimeout)
   at Microsoft.SqlServer.Management.IntegrationServices.CatalogFolder.DeployPackages(String projectName, Dictionary`2 packageNamesAndXmls)
   at Microsoft.SqlServer.IntegrationServices.Wizard.Common.Model.DeployExportProjectHelper.DeployPackages(ProjectInfo project, BindingList`1 packages)
   at Microsoft.SqlServer.IntegrationServices.Wizard.Common.Model.DeploymentModel.DeployPackages(ProjectInfo project, String projectName, BindingList`1 packages)
   at Microsoft.SqlServer.IntegrationServices.Wizard.Common.Model.DeploymentModel.DeployPackages()
   at Microsoft.SqlServer.IntegrationServices.Deployment.DeployProjectPage.DoWork(Object sender, DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

Thanks!!

Is there a better way to implement SCD other than Dimension Merge

$
0
0

Hi ,

Would be great help if some one can help me out .....

Is there any better way to implement SCD other than the SCD component or the dimension Merge component ?

Thanks a ton :)

HELP!

$
0
0

Good morning all,

Below is my current query, but I am trying to add a parameter where my end date NULL or >= today.  Any help would be greatly appreciated.

SELECT        harris_live.pu_account.name, harris_live.pu_account_pay.last_payment_amt, harris_live.pu_account_pay.last_payment_date, harris_live.pu_stat_codes.stat_code,
                         harris_live.pu_account_pay.end_date, harris_live.pu_account_pay.bill_code, harris_live.pu_account.account_no
FROM            harris_live.pu_account CROSS JOIN
                         harris_live.pu_account_pay CROSS JOIN
                         harris_live.pu_stat_codes
WHERE        (harris_live.pu_account_pay.end_date >=

Errors while upgrading the SSIS packages from SQL2008 to SQL 2016

$
0
0

While trying to update the SQL 2008 integrations packages from 2008 to 2016, the update is failing with the below errors -


Warning 0x40016044: Get Connection String Info: Found SQL Server Integration Services 2008 Script Task "ST_1b8c1763d99e40528347c83543e8c102" that requires migration!

Error 0x5: Get Connection String Info: Failed to compiled scripts contained in the package. Open the package in SSIS Designer and resolve the compilation errors.

Error 0x5: Get Connection String Info: MSB6003 - The specified task executable "csc.exe" could not be run. Could not load file or assembly 'Microsoft.CodeAnalysis.CSharp, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified., C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.Core.targets, 67, 5

The visual studio is VS2015 professional 

Version 14.0.25424.00 Update 3

Has anyone seen this error, could you please share any ideas to resolve this?

Thanks

Ramana

Data Export from CRM online/one Prem Using CRM SDK Using SSIS

$
0
0

has anybody done a prototype code to pull the data from CRM using SSIS using CRM SDK

i have access to an CRM entity which has optionset , lookup fields . so i need to pull these with other required fields 

then below URL gave me an idea but did not work for fields with empty or nulls .  

https://community.dynamics.com/crm/b/crminogic/archive/2015/09/04/exporting-data-from-dynamics-crm-using-ssis 

appreciate your help

SSDT crash on creation of SSIS solution in Visual Studio 2015

$
0
0

I've already created a connect item, but received no help and I've lost track of the number of times I've reimaged now.

https://connect.microsoft.com/SQLServer/feedback/details/2781125/ssis-projects-crash-visual-studio

I can create SSRS projects, SSAS projects, even SQLCLR solutions all with no problem but the instant I get to the SSIS tools, Visual Studio crashes. Any help at all would be greatly appreciated. Do I need to do a full install of all the features in SQL Server in order to get this to work? This is what I get when it crashes:

Problem signature:
  Problem Event Name:APPCRASH
  Application Name:devenv.exe
  Application Version:14.0.25420.1
  Application Timestamp:57685d85
  Fault Module Name:KERNELBASE.dll
  Fault Module Version:6.3.9600.18340
  Fault Module Timestamp:5736541b
  Exception Code:c06d007e
  Exception Offset:00014878
  OS Version:6.3.9600.2.0.0.272.7
  Locale ID:1033
  Additional Information 1:f52d
  Additional Information 2:f52dc01603afe3db0d0705b005637c7d
  Additional Information 3:feb1
  Additional Information 4:feb116513753713917b7c27f6152f7f8

How to connect SQL server through OLEDB manager in script task.

$
0
0
Need to connect SQL server through script task using Oledb Connection Manger.

Orange Ready bar on package exection - SQL Server Data Tools BI 2013

$
0
0

When I right click and execute a package I get an Orange ready bar at the problem. When I stop debugging and try to open again I get a ViewManager.WindowProfile. 

when I try and go to Tools > Import and Export Settings > Reset All Settings > Business Intelligence Settings I get two errors.

1. An error occured while importing settings for 'Windows Layouts' [code 5460].

2. A fatal error has occured that prevented settings from being reset.

I have uninstalled and reinstalled Business Intelligence for Visual Studio 2013.

I have no clue what I did to make this happen. I have been working with this tool for years and never had this problem.

Thanks,

-Jeff

[Azure Blob Upload Task] - Value does not fall within the expected range. (Microsoft.SqlServer.ManagedDTS)

$
0
0

Hi

I’m trying to use the Azure Blob Upload Task to move a file from my C drive to my Azure Storage account but on running the SSIS project (or just the component by itself) I get the error
: Value does not fall within the expected range. (Microsoft.SqlServer.ManagedDTS)

I know the storage account is fine because I can use Azure Storage Explorer and save files without issue.
The SSIS connection is also good.

Dev Environment: VS 2015, SSDT(latest)

Thanks
Mike

Here is the simple 1 component code dump

<?xml version="1.0"?>
<DTS:Executable xmlns:DTS="www.microsoft.com/SqlServer/Dts"
  DTS:refId="Package"
  DTS:CreationDate="7/29/2016 2:11:02 PM"
  DTS:CreationName="Microsoft.Package"
  DTS:CreatorComputerName="xxxxxxxxxxxx"
  DTS:CreatorName="xxxxxxxxxxxx"
  DTS:DTSID="{89ECFBD1-797A-4EBC-8986-5895DBFFED83}"
  DTS:ExecutableType="Microsoft.Package"
  DTS:LastModifiedProductVersion="13.0.1601.5"
  DTS:LocaleID="1033"
  DTS:ObjectName="Package"
  DTS:PackageType="2"
  DTS:VersionBuild="13"
  DTS:VersionGUID="{1698E589-21E6-4AD6-A5A9-7105925C75F4}">
  <DTS:Property
    DTS:Name="PackageFormatVersion">8</DTS:Property>
  <DTS:Variables />
  <DTS:Executables>
    <DTS:Executable
      DTS:refId="Package\Azure Blob Upload Task"
      DTS:CreationName="CopyToBlobTask"
      DTS:Description="Azure Blob Upload Task"
      DTS:DTSID="{02652254-7C2E-496F-84D4-D4AEA71D590F}"
      DTS:ExecutableType="CopyToBlobTask"
      DTS:LocaleID="-1"
      DTS:ObjectName="Azure Blob Upload Task"
      DTS:TaskContact="Azure Blob Upload Task; (C) Microsoft Corporation; All Rights Reserved"
      DTS:ThreadHint="0">
      <DTS:Variables />
      <DTS:ObjectData>
        <CopyToBlobTask
          ConnectionId="{C2D09777-093F-43D7-89D6-9DA54A4176FE}"
          BlobContainer="mssqltest"
          LocalDirectory="C:\Download\Blobtest\up"
          FileNameFilter="*"
          TimeRangeFrom="01-Jan-1900 12:00:00 AM +10:00"
          TimeRangeTo="31-Dec-2200 12:00:00 AM +10:00" />
      </DTS:ObjectData>
    </DTS:Executable>
  </DTS:Executables>
  <DTS:DesignTimeProperties><![CDATA[<?xml version="1.0"?>
<!--This CDATA section contains the layout information of the package. The section includes information such as (x,y) coordinates, width, and height.-->
<!--If you manually edit this section and make a mistake, you can delete it. -->
<!--The package will still be able to load normally but the previous layout information will be lost and the designer will automatically re-arrange the elements on the design surface.-->
<Objects
  Version="8">
  <!--Each node below will contain properties that do not affect runtime behavior.-->
  <Package
    design-time-name="Package">
    <LayoutInfo>
      <GraphLayout
        Capacity="4" xmlns="clr-namespace:Microsoft.SqlServer.IntegrationServices.Designer.Model.Serialization;assembly=Microsoft.SqlServer.IntegrationServices.Graph">
        <NodeLayout
          Size="190,42"
          Id="Package\Azure Blob Upload Task"
          TopLeft="69.5,86.5" />
      </GraphLayout>
    </LayoutInfo>
  </Package>
</Objects>]]></DTS:DesignTimeProperties>
</DTS:Executable>

Linked servers - How to create a view using another view of a linked Oracle database

$
0
0

Hi!

  I am currently working on a power BI project. I have already successfully linked our Oracle database server in our SQL server 2005 database. However, due to the size of the Oracle table, I decided to create a view to filter only the data I need. 

  How can I create a view using the database view that I created on the linked server?

  Thanks

Bobbet Castillo

Importing DATETIME data from SQL to DB2

$
0
0

I have some SQL Data to import into a DB2 database.

Some of the SQL Data is to imported is DATETIME and must be imported into a DB2 TIMESTAMP.

What is the best way of doing this in a SSIS package?

I am running into issues such as:

CONVERT(VARCHAR(50), DATECOL  121)

Thanks

Fast Load Issue

$
0
0

Hi Folks, 

I have one query on data load from Oracle to oracle via SSIS

- I have created DFT

- Source is Oracle table

- Destination is Oracle table

- Chose the option of Table Name - Fast Load (Using Direct Path)  in Oracle Destination 

When i executed the package,i am getting error as below

Error

[Dest 1 [251]]

Error: Fast Load error encountered during PreLoad or Setup phase.

Class: OCI_ERROR Status: -1 Code: 0 Note:  At: ORAOPRdrpthEngine.c:735

Text: ORA-00604: error occurred at recursive SQL level 1

ORA-01405: fetched column value is NULL

However if i changed the load mode to Table Name View, data loaded successfully in destination table.

I really want to load data by using Table Name - Fast Load (Using Direct Path) mode, please provide the solution.


Amit Srivastava,

NIIT Technologies

Please mark as answer if helpful

Blog:fascinatingsql.blogspot.in


Max commit size- data flow task

$
0
0

Hi Friends

I have got a doubt.

I was trying to explore the use of maximum commit size.

I put the max commit size as 1.5 lakhs and run the data flow task .

The source has 1 crore record

When the data flow task is executing and transferred the record of say some 20,000 record . I stopped the package.

I was expecting the table should not have any record as I set the commit size to 1.5 lakhs. but when I query the table

it has the 20000 record. Then what is the use of max commit size. Should it not commit only after 1.5 lakhs records got transferred?

Also when I stop the package should it not rollback? what is the difference between stopping the package and the package failure?

Please clarify me.Thanks in advance.

Design question - SSIS vs BCP vs Linked Server vs other

$
0
0

Hi,

I have a requirement to archive some data to another SQL server. This will be high volume data, 10-50M rows every weekend.

1. SSIS is not really a possibility as the software will have to be installed on client machines.

2. My second preference is linked server. That could work as requiring a linked server from a client is not something unreasonable and works ok in this case as don't need to write queries with cross joins.

3. BCP based solutions is another option, we also have a bespoke windows service  which can read data from databases and write the data to another server.

My preference is linked server as it can support distributed transactions. It is important to know that if something goes wrong whilst the data moves to the other server, transactional integrity is preserved and the process can be re-run without data going missing. Option 3 gives more flexibility as it's bespoke software that could be configured, however am not convinced it can guarantee the transactional model and might be more difficult to make it work.

Does linked server perform reasonable well, I know it's not as fast as SSIS bulk but it's reasonable speed. Any other opinions, what options do I have?

Thanks,

Panos


Error code 0x80004005

$
0
0

I'm trying to download Windows 10 on my Windows 7 laptop. When it gets to 84% this code pops up. What can I do to fix it?

SQL SSIS Packages failing sporadically

$
0
0

SQL SSIS packages are failing sporadically.

The error is:

0x8007000E "Not enough storage is available to complete this operation."

If I run them again, they run with no problems.

Thank you..

Remove HTML Tags Using SSIS Derived Column Expression

$
0
0

HI Gurus,

Source: SharePoint

Target: Sql Server

I would need a help to remove the htmltag from text field. Please see the example column below

Defects :

<div class="ExternalClass77BF522667BE422EB5C2D38F916D3EFF"><p>No defects</p><p>&#160;</p></div>

From the above I would only need "No defects" and rest of the data is unnecessary.

Could somebody please help me to get the expression for SSIS derived Column.

Thanks,

Naveen

SSIS Gurus needed for July!

$
0
0

Come forth all you technical gurus and word wizards!

It's time to show us what you've got, what you know, what you found out!

Spare your fellow professionals from the same mistake!

Share your revelations and awesome ways of doing things!

All you have to do is add an article to TechNet Wiki from your own specialist field. Something that fits into one of the categories listed on the submissions page. Copy in your own blog posts, a forum solution, a white paper, or just something you had to solve for your own day's work today.

Drop us some nifty knowledge, or superb snippets, and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!

This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!

HOW TO WIN

1) Please copy over your Microsoft technical solutions and revelations toTechNet Wiki.

2) Add a link to it on THIS WIKI COMPETITION PAGE (so we know you've contributed)

3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.

If you win, we will sing your praises in blogs and forums, similar to the weekly contributor awards. Once "on our radar" and making your mark, you will probably be interviewed for your greatness, and maybe eventually even invited into other inner TechNet/MSDN circles!

Winning this award in your favoured technology will help us learn the active members in each community.

June's entries are with our judges right now, but here is a reminder of the previous month's winners.

Guru Award BizTalk Technical Guru – May 2016 
Gold Award Winner

Kjetil TonstadTop 10 Tips From a BizTalk Admin to BizTalk DevelopersTGN: “I love this, how to help each other. Well done Kjetil!”
JS: “Integration apps are a lot more than coding. Always remember these.”
SW: “Great article. With the current DevOps trend alignment between developers and administers is key!”
Ed Price: “This is a good set of tips, with a few helpful images, and the Reference links at the bottom give more context. Great job!”
Silver Award Winner

Eldert GrootenboerBizTalk Server: Processing large files (streaming)Ed Price: “Great mix of code, images, and descriptions. Although the code isn’t broken up much (with explanations of what the code does), all the code comments make up for it and make it super clear! Good to end with the See Also section!”
SW: “Streaming large message can be a challenge with BizTalk. This article provide guidance in that area. Very good!”
TGN: “I love this, well explained and a question that is very relevant to BizTalk”
Bronze Award Winner

SMSVikasKBizTalk Server 2013 R2 Dynamics CRM Online / On Premise CRUD Operations (Part 1)JS: “Seeing a lot of CRM lately. Good info for anyone who hasn’t worked with it before.”
SW: “CRUD om Dynamics guidance article. Good”
Ed Price: “Great description (I like CRUD) and fantastic use of images, although it would be better with more explanations in the text.”
TGN: “Why did you split these up into to articles? good article though”

Guru Award Forefront Identity Manager Technical Guru – May 2016 
Gold Award Winner

Peter GeelenFIM2010 / MIM2016: Run profile statistics with PowerShell and Excel Pivot TablesEd Price: “I love the code formatting with the scroll bar. Great explanations and use of images!”
Silver Award Winner

Peter GeelenFIM2010 / MIM2016: Run profile statistics with SQL and Excel Pivot TablesEd Price: “It’s great to have the downloads on TechNet Gallery!”

Guru Award Microsoft Azure Technical Guru – May 2016 
Gold Award Winner

Bhushan GawaleGetting Started with Azure Automation DSCAS: “Very good and helpful article! Thanks for publishing!”
Ed Price: “Great starting point for learning Azure Automation DSC! Good use of images and code, with excellent explanations!”
Silver Award Winner

Sibeesh VenuCreating Azure Mobile App With Visual Studio AS: “Good starting point, but for me all screenshots are broken – none of them is visible. I would find it particularly useful if you just have provided links to a more detailed article(s) on how to configure Visual Studio for windows Mobile development. And probably just show a sample with HTML/JS or UWP (if it is available)”
Ed Price: “What an important topic that’s very well described! The images add a lot of value!”
Bronze Award Winner

Sandro PereiraAzure Logic Apps: Tips and Tricks about the “new” Logic Apps DesignerAS: “A good overview of designer features! I would however also expect to see the less known fact that drop down lists are actually filtered and there is much more to discover when you begin typing into the search field.”
Ed Price: “The images are magnificently assembled to make this process incredibly clear. A very important topic! Great job!”
Guru Award Miscellaneous Technical Guru – May 2016 
Gold Award Winner

ChilbertoConnecting a BitBucket Repository to Visual Studio Team ServicesRichard Mueller: “Well explained. We need links/references.”
Ed Price: “Great use of images. This is a fantastic scenario! It could use a See Also section. “
Silver Award Winner

Carmelo La MonicaManage analog sensor with Raspberry pi2Richard Mueller: “Grammar needs work and we need links/references.”
Ed Price: “Thorough, and great to have the code and images! But it could benefit from breaking apart the code and explaining what it does more, as well as ending with See Also and References sections. Great to have the TOC.”

Guru Award SharePoint 2010 / 2013 Technical Guru – May 2016 
Gold Award Winner

Dan ChristianHow to build a custom report for SharePoint Server lists, libraries or sitesJohn Naguib: “Great one well done”
Margriet Bruggeman: “Great article with not only text, but also images and videos to make this very user friendly.”
Hezequias Vasconcelos: “Great article. Content technical good. Well detailed, great of attached reference materials. Excellent technical guide.”
Ed Price: “Fantastically thorough, with great images and explanations, and once again, your YouTube videos just blow me away, with how well they help tell the story and are integrated into the article like this! It’s a true art form!”
Silver Award Winner

Waqas SarwarSharePoint 2016 How to Change SuitBar’s Text PowerShellHezequias Vasconcelos: “Good content new platform SharePoint 2016. great scripts and well distributed in the Shell”
Ed Price: “Short and sweet! Fantastic scenario. It could use more references and links to other Wiki articles.”
Bronze Award Winner

Vivek JAGGAAlternative Solutions to the Deprecated Features in SharePoint 2016Ed Price: “I love how you’re very clear at the front of this article (as an overview) and then dig deeper into the specifics. Good references at the end.”
John Naguib: “Nice article you can add also the development area”
Margriet Bruggeman: “Useful article with good alternatives. “

Guru Award Small Basic Technical Guru – May 2016 
Gold Award Winner

Philip MuntsSmall Basic: Simpler and Cheaper Raspberry Pi GPIOMichiel Van Hoorn: “This is really Awesome (see also the original article). It opens up Small Basic to the real world. ”
Ed Price: “Building off his Raspberry Pi article, this article does an amazing job of digging deeper and showing you more options, such as Raspberry Pi Zero.”
Silver Award Winner

Nonki TakahashiSmall Basic: ImageMichiel Van Hoorn: “Really cool overview of working with Images (like photos) in SmallBasic. We good topic to inspire programming”
Ed Price: “Very thorough end to end overview of using Images!”

Guru Award SQL BI and Power BI Technical Guru – May 2016 
Gold Award Winner

Greg DecklerGood Ol’ VLOOKUP – The Ultimate Guide to Lookups in Power BIPT: “Quite a valuable and well-written article. Thank you for the extensive coverage of various lookup techniques.”
RB: “Interesting comparison of the lookup techniques available within Power BI.”
Silver Award Winner

Anil MaharjanHow to find a Calculated Measure and Calculated Dimension within a particular cubePT: “This submission a very brief and just mentions a little information that is common knowledge and easily discovered with a simple web search.”
RB: “Interesting tip, a screen dump of the result with all the columns would have been great.”

Guru Award SQL Server General and Database Engine Technical Guru – May 2016 
Gold Award Winner

ChervineStretching SQL Server 2016 tables to the Azure CloudJS: “Great article, your explanations and samples are spot on.”
Ed Price: “Super valuable scenario! Love the diagram, code snippets, and screen shots!”
Silver Award Winner

ShankyWhat Does Fragmentation Means In a Heap Table In SQL ServerEd Price: “Very thorough! Great references at the end.”

Guru Award System Center Technical Guru – May 2016 
Gold Award Winner

vishwanatham sridharSCOM Connector Design prototypeEd Price: “Great scenario with some helpful reference links!”
Silver Award Winner

Anders RodlandSCCM 2012 R2 step-by-step: upgrade of SP1 to current branch – Step by StepEd Price: “Missing the images. Very thorough steps! Great use of the TOC. Could benefit from references.”
Bronze Award Winner

Anders RodlandSystem Center Configuration Manager Build NumbersEd Price: “Good collection of builds and KBs!”

Guru Award Transact-SQL Technical Guru – May 2016 

Guru Award Universal Windows Apps Technical Guru – May 2016 
Gold Award Winner

Namrah KhurramTraffic Lights Simulation via LEDs on Raspberry PiTGN: “Man this is cool. Good information and well structured. well I’m impresses Namrah!”
Ed Price: “A cool scenario that’s masterfully explained! The code has great formatting. It could benefit from See Also and References sections at the end.”
Silver Award Winner

Manuel Cota“DrawIndexedInstanced and the Concepts behind a Home-Made Game Engine”Ed Price: “It could benefit from a TOC at the top and from See Also and References sections at the bottom, but I love how this breaks down the code and explains everything in depth! Great use of diagrams!”
TGN: “I learned a lot from this article. Well done, thanks for sharing!”
Bronze Award Winner

Sajid Ali KhanUWP: Things Required To Do Right After Creation of New ProjectEd Price: “Great use of images and good References section at the end! I love how the code is both on GitHub and MSDN Gallery and how the download links are given!”
TGN: “This can help a lot of people, my favourite this month! Thanks for sharing Sajid”

Guru Award Visual C# Technical Guru – May 2016 
Gold Award Winner

Emiliano MussoEntity Framework Introduction using C#, part IEd Price: “This is a masterful article, It’s thoroughly broken down, and it leverages images, great code formatting, and even a download and an Italian language version at the end!”
Jaliya Udagedara: “Great article with step by step explanation. If you are a newbie to EF, read this one article which will cover most of the basics. And you can download the sample code from MSDN Code Gallery.”
Carmelo La Monica: “Good and very impressive article, it explain in all parts Entity Framework 7, i attend second part “
Silver Award Winner

SYEDSHANUMVC ASP.NET Identity customizing for adding profile imageCarmelo La Monica: “Very good expression, good images and very detailed in all parts.”
Ed Price: “Very thorough steps! Great scenario!”
Jaliya Udagedara: “Good article explaining how you can manage your profile picture with a ASP.NET MVC application. Sample code is available in MSDN Code Gallery.”

Guru Award Wiki and Portals Technical Guru – May 2016 
Gold Award Winner

Peter GeelenWiki: Fixing table layout (table right side off page)Richard Mueller: “Great information that will help a great deal to fix tables in the Wiki. Good use of Wiki guidelines.”
Ed Price: “This is a fantastic solution from Peter!”

Guru Award Windows PowerShell Technical Guru – May 2016 
Gold Award Winner

Matt McNabbOffice 365: How to Manager User License Lifecycle with PowerShellEd Price: “Wow! Great description of these steps, and it ends well with several other links to dig into!”
Richard Mueller: “Good TOC. An excellent idea to code this and overcome limitations. This should be very useful.”
Silver Award Winner

Arleta WanatSharePoint Online: Get all checked-out files using PowershellRichard Mueller: “Good headings and TOC. Good ideas and well explained.”
Ed Price: “Great scenario and use of PowerShell code!”

Guru Award Windows Server Technical Guru – May 2016 
Gold Award Winner

Kia Zhi Tang (Ryen Tang)Nano Server: Using New-NanoServerImage with Show-Command to deploy Nano ServerMark Parris: “Excellent article on the deployment of Nano server. ”
JM: “This is an excellent article on building a new Nano Server, thanks for your contribution!”
Richard Mueller: “Good use of Wiki guidelines, with even horizontal rules and Return to top links. Show-Command is a very interesting feature I like a lot. Good references.”

Thanks in advance!
Pete Laker


#PEJL
Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over toTechNet Wiki, for future generations to benefit from! You'll never get archived again, and you could win weekly awards!

Have you got what it takes o become this month's TechNet Technical Guru? Join a long list of well known community big hitters, show your knowledge and prowess in your favoured technologies!

Send email with attachments from local desktop using SSIS

$
0
0

Hi

I have created a package as below

Step 1) Data flow task --> Source as SQL--> Destination to Excel ( In one folder)

Step 2) Script task with below code

After executing the package step1 is executing fine, but step two is throwing error as shown below (last)

Not sure what I am doing wrong.. Could any one assit how to fix this issue, This is I am trying from my local desktop.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

#region Namespaces
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
using System.Net;
using System.Net.Mail;


#endregion

namespace ST_2d0fa26c89c645de8d6ddcd332f534da.csproj
{
    /// <summary>
    /// ScriptMain is the entry point class of the script.  Do not change the name, attributes,
    /// or parent of this class.
    /// </summary>
[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{
        #region Help:  Using Integration Services variables and parameters in a script
        /* To use a variable in this script, first ensure that the variable has been added to 
         * either the list contained in the ReadOnlyVariables property or the list contained in 
         * the ReadWriteVariables property of this script task, according to whether or not your
         * code needs to write to the variable.  To add the variable, save this script, close this instance of
         * Visual Studio, and update the ReadOnlyVariables and 
         * ReadWriteVariables properties in the Script Transformation Editor window.
         * To use a parameter in this script, follow the same steps. Parameters are always read-only.
         * 
         * Example of reading from a variable:
         *  DateTime startTime = (DateTime) Dts.Variables["System::StartTime"].Value;
         * 
         * Example of writing to a variable:
         *  Dts.Variables["User::myStringVariable"].Value = "new value";
         * 
         * Example of reading from a package parameter:
         *  int batchId = (int) Dts.Variables["$Package::batchId"].Value;
         *  
         * Example of reading from a project parameter:
         *  int batchId = (int) Dts.Variables["$Project::batchId"].Value;
         * 
         * Example of reading from a sensitive project parameter:
         *  int batchId = (int) Dts.Variables["$Project::batchId"].GetSensitiveValue();
         * */

        #endregion

        #region Help:  Firing Integration Services events from a script
        /* This script task can fire events for logging purposes.
         * 
         * Example of firing an error event:
         *  Dts.Events.FireError(18, "Process Values", "Bad value", "", 0);
         * 
         * Example of firing an information event:
         *  Dts.Events.FireInformation(3, "Process Values", "Processing has started", "", 0, ref fireAgain)
         * 
         * Example of firing a warning event:
         *  Dts.Events.FireWarning(14, "Process Values", "No values received for input", "", 0);
         * */
        #endregion

        #region Help:  Using Integration Services connection managers in a script
        /* Some types of connection managers can be used in this script task.  See the topic 
         * "Working with Connection Managers Programatically" for details.
         * 
         * Example of using an ADO.Net connection manager:
         *  object rawConnection = Dts.Connections["Sales DB"].AcquireConnection(Dts.Transaction);
         *  SqlConnection myADONETConnection = (SqlConnection)rawConnection;
         *  //Use the connection in some code here, then release the connection
         *  Dts.Connections["Sales DB"].ReleaseConnection(rawConnection);
         *
         * Example of using a File connection manager
         *  object rawConnection = Dts.Connections["Prices.zip"].AcquireConnection(Dts.Transaction);
         *  string filePath = (string)rawConnection;
         *  //Use the connection in some code here, then release the connection
         *  Dts.Connections["Prices.zip"].ReleaseConnection(rawConnection);
         * */
        #endregion


/// <summary>
        /// This method is called when this script task executes in the control flow.
        /// Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
        /// To open Help, press F1.
        /// </summary>
public void Main()
{


            var theMailer = new MailMessage();
            theMailer.To.Add("myemail@gmail.com");
            theMailer.From = new MailAddress("myemail.com", "Hello");
            theMailer.IsBodyHtml = true;
            theMailer.Subject = "From Report";
            theMailer.Attachments.Add(new Attachment(@"C:\Outputreport.xlsx"));
            theMailer.Body = "<table><tr><td>Report</td></tr></table>";
            var myClient = new SmtpClient("smtp.gmail.com",587);
            myClient.EnableSsl = true;
            myClient.DeliveryMethod = SmtpDeliveryMethod.Network;
            myClient.Credentials = new NetworkCredential("myemail@gmail.com", "Password");
            myClient.Send(theMailer);

            Dts.TaskResult = (int)ScriptResults.Success;
}

        #region ScriptResults declaration
        /// <summary>
        /// This enum provides a convenient shorthand within the scope of this class for setting the
        /// result of the script.
        /// 
        /// This code was generated automatically.
        /// </summary>
        enum ScriptResults
        {
            Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
            Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
        };
        #endregion

}
}

******************************************************************

Error Message

DTS Task has encountered an exception in user code:

Project name : ST_2d0fa26c89c645de8d6ddcd332f534da

Exception has been thrown by the target of an invocation

 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

Viewing all 24688 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>