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

SSIS is not using the provided custom Sharepoint credentials

$
0
0

Hello,

I have multiple packages that need to access a Sharepoint server. So I am using the popular package from here:
http://sqlsrvintegrationsrv.codeplex.com/releases

The way I have it set up, is that there is a job in SQL Server that runs multiple packages every day, however when it tries to run them, it does not work. I am getting authentication and validation errors.

When I run the packages locally, it works fine.

After investigating, I found out that the credentials I provide to connect to Sharepoint are not used. The package uses my windows account even if I specifically set it to use custom credentials. To test this, I simply created a new account on my computer and ran the package with correct custom credentials and found that it didn't work. If I do the same on the account that has access to Sharepoint, it works.

I would like to know if there is a fix or a workaround for this ? 

Thank you,

Yan


How to filter based on where condition of CDC data from oledb data source SSIS

$
0
0

Hi,

We are using the CDC for ETLs. so we are taking the changed data and Moving. Here is an example.

so here is my SQLCommand. 

SELECT 
	cast(sys.fn_cdc_map_lsn_to_time(__$start_lsn) as date) as [start_date],
	cast(sys.fn_cdc_map_lsn_to_time(__$end_lsn) as date)  as [end_date], 
	customer_id, 
	client_id, 
	social_id, 
	provider_id, 
	lead_id, 
	type_gender_code, 
    type_customer_code, 
    type_transaction_code, 
    lead_type_code, 
    first_name, 
    prefix_name, 
    middle_name, 
    last_name, 
    suffix_name, 
    birth_date , 
    address1, 
    address2, 
    city, 
    state,  
    distance_from_dealer 
   
FROM            
	cdc.customer_customer_CT
where
	(
          cast(sys.fn_cdc_map_lsn_to_time(__$start_lsn) as date) >= ? and 
	      cast(sys.fn_cdc_map_lsn_to_time(__$start_lsn) as date) <=  ?  
     ) and
     (
               CONVERT(time,sys.fn_cdc_map_lsn_to_time(__$start_lsn))  >= ? and
	           CONVERT(time,sys.fn_cdc_map_lsn_to_time(__$start_lsn)) <= ?
      ) and
      __$operation in (2,4) 

so based on Date and Time we are moving the data.

everything works fine if i Do not add the  where condition to it. If I add where condition to it. Its showing that invalid character value to cast.

how to cast the date and time in where condition of SQL command in SSIS.

Thanks.

SSIS datatype datetime verification

$
0
0

Hi,

In our ssis project we need to verify the data from input csv file as datetime else we need to set it invalid data.can anyone help me to do that?

Regards

Jon

SSIS Authentication Model: SQL Authentication vs Windows Authentication (Windows Integrated Security)

$
0
0

Hello,

I am in the process of defining a SQL authentication mode model for SSIS package development.  I am proposing to eliminate SQL mixed mode based authentication COMPLETELY and to solely utilize Windows authentication (Windows Integrated Security) as our SQL Server authentication type.

Are any of you working at SSIS heavy shops where you only utilize Windows based authentication for SQL Server access?

From a security standpoint, utilizing solely Windows authentication within a SQL environment has many advantages.

I am now in the process of identifying the impact this security model would have on the development, maintainability, scalability, and performance of SSIS packages.

Particularly, I am concerned that with the elimination of SQL based authentication, overall development time and complexity of SSIS packages will greatly increase.

Consider the following example.   I develop highly N-Tier conforming SSIS packages in which one main SSIS package would call several data flow packages in order to segregate units of functionality.  This chain dependency of SSIS packages allows for easy maintenance and testing within a production environment.

A typical SSIS package I develop can be viewed in the following manner:

[Main Package 1] ---> [Business Logic Layer Package] --->  [Individual Data Flow Package]

As one can see above, one SSIS package calls another SSIS package, which finally calls another.

Now, as anyone would, I would schedule SSIS package execution using SQL Server Agent.  This being said, using the example above, if I had 5 data flow packages being executed within my main SSIS package that reference 5 different data sources, for security adherence, I could create 5 separate SQL authentication based users within SQL Server so that only the needed permissions are granted to each user used with each of the 5 data flows.

Now, if I were to eliminate SQL Server based authentication, the process becomes difficult as I would only be able to use Windows Integrated Security for authentication.

Now, being that I will continue to desire to assign a custom set of SQL based permissions to each user utilized within the 5 data flows above in our example, the only way I can see being able to assign a custom user to each SSIS data flow using the Windows authentication model for SQL Server would be to use "Credential" and "Proxy: objects as discussed here:

However, this solution presents a problem in that I cannot assign a unique Windows user to execute each of my 5 SSIS packages as only one SSIS package is actually going to get scheduled by SQL Server Agent. 

Being that one SSIS package calls other SSIS packages, unless I am mistaken (please correct me if I'm wrong) I can only set the "run as" Windows user at the SQL Server Agent job level and not at the SSIS package level like I want to.  This would limit my SSIS package being executed as one user, which is not what I desire security-wise. 

Is there any way you know of to be able to specify the exact Windows user each of the 5 SSIS packages in my example would be executed as?

If not, please consider my proposed idea to create a "hybrid" approach to this security issue:

  1. SQL Server would be configured to support "mixed mode" authentication.
  2. One Windows authentication based user would be created on SQL server that would be used as the "Run As" user when scheduling the main SSIS package via SQL Server Agent.
  3. 5 seperate SQL Server authentication based users would be created on SQL Server for each of the data flow packages.
  4. Each of the 5 SSIS packages would be developed to store the individual SQL Server authentication based connection strings on a centrally located SQL Server table.
  5. Only the "Run As" Windows authentication based user that the entire set of SSIS packages are running as would be granted select only access to this "SSIS package parameters" table.
  6. During execution time, each of the 5 SSIS data flow designated packages would authentication to SQL Server FIRST via Windows authentication in order to access the SSIS SQL "parameters table".
  7. Each of the 5 SSIS data flow designated packages would then access the parameter table and grab its unique SQL authentication based connection string and apply this connection string to its corresponding data flow task objects.
  8. All ETL operations would then be performed by the data flow designated SSIS packages using the uniquely assigned SQL authentication based user within each data flow package.

This solution above has the following benefits:

  1. No connection information including user names and passwords are stored in plain text within the SSIS environment via XML config files.
  2. Each SSIS package can only access SQL connection string information from the "parameter table" ONLY if the Windows user the SSIS package is currently running as is granted sufficient permissions.
  3. SSIS package development is not overly bloated and cumbersome as individual SSIS data flow designated packages can still use package configurations to easily configure data flow tasks, not adding unnecessary development efforts to existing development workflows.

What do you think about my solution?  Is this a feasible solution for an enterprise environment?  Do you think this approach adheres to a solid set of good security practices?

I am open to all suggestions on how I can tackle this problem with security and ease of development being number one priority.

I would greatly appreciate your input on this!





SQL 2008 Package in SQL 2005

$
0
0

Hi, 

I developed a SSIS package on Visual studio 2008 ( BIDS). My package runs absolutely fine from BIDS.  I am populating SQL Server 2005 tables. 

However when I deploy my package on the SQL server 2005 I get the below error :

Executed as user:  ...sion 9.00.4035.00 for 32-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  10:23:26 PM  Error: 2012-08-06 22:23:26.53     Code: 0xC001700A     Source:       Description: The version number in the package is not valid. The version number cannot be greater than current version number.  End Error  Error: 2012-08-06 22:23:26.56     Code: 0xC0016020     Source:       Description: Package migration from version 3 to version 2 failed with error 0xC001700A "The version number in the package is not valid. The version number cannot be greater than current version number.".  End Error  Error: 2012-08-06 22:23:26.56     Code: 0xC0010018     Source:       Description: Error loading value "<DTS:Property xmlns:DTS="www.microsoft.com/SqlServer/Dts" DTS:Name="PackageFormatVersion">3</DTS:Property>" from node "DTS:Property".  End Error  Could not load package "...  The package could not be lo...  The step failed.

I did research about this and I get to know that :

This happens when we try to run the SSIS 2008 package on SQL 2005 machine ( server).

This machine that I am running SSIS 2008 package on does NOT have SQL 2008 BIDS installed. 

Please advice as to what I need to do inorder to run the package on SQL 2005 server machine? Are there any workarounds ? 

Thanks,


EVA05

Execute SQL Task Parameterized SP

$
0
0

I have a Stored Procedure that takes in a Bit Parameter (0/1) that i want to execute from a Execute SQl Task. The value for the parameter needs to come in from a user defined variable.

The Exec SQL Task command is Exec spName ?

I have added a parameter of Type Variant_Bool Name as 0 and Size as 1.

The ByPassPrepare is set to false.

the SP Executes but it does not seem to pick up the variable that i set, any ideas?


Regards, Dinesh

Which Properties I should have in SSIS package to load data faster?

$
0
0

Hi, i am loading 5 millions of records in a table which takes around 20 mins.

I have a stored proc which loads 5 millions of records in two tables which takes around 25 mins.

I have fastLoad in Oledb destination and access mode is set to open rowset using fastload but still you can see from the time its not performing well.

So wondering what are the other properties i should i have so that the the data load will be faster?

I am simply loading from OLEDB source to OLEDB destination.

---Just realised, there's something i can do dropping and creating constraints back on table.

Text file with comment filed containing carriage returns

$
0
0

I have a text file that is tab delimited, non-qualfied, with column names as the first row. The row delimiter is {CR}{LF}. The last field is a comment field, and some rows contain CRLFs within that field. I tried removing those with a derived column that uses this expression :
REPLACE(REPLACE(Comments,"\n"," "),"\r"," ")

My guess is it doesn't work because SSIS identifies the end of each row before looking at the contents of the last field.

Does anyone have a suggestion?

Thank you


WRONG FORUM

Error at Data Flow Task: No column information was returned by the SQL Command

$
0
0

I am using SSIS 2008 R2 trying to add this script to my package.  This is the source script for populating my table.  I know my package works with a different source script.  Does SSIS support temp tables?  This script works perfectly in SSMS.  How else can I do this?  Like to have to use multiple data sources, one for each temp table in SSIS instead?

This is my SQL script that I added to the OLE DB Source editor in the Data Flow.  Note that I currently just have a total of one Source connection and one source query in SSIS:

IF EXISTS (SELECT  * FROM tempdb.dbo.sysobjects o    WHERE o.xtype IN ('U')  AND o.id = object_id(N'tempdb..#GC_clientaddress')) DROP TABLE #GC_clientaddress;
IF EXISTS (SELECT  * FROM tempdb.dbo.sysobjects o    WHERE o.xtype IN ('U')  AND o.id = object_id(N'tempdb..#client_demographics')) DROP TABLE #client_demographics;
IF EXISTS (SELECT  * FROM tempdb.dbo.sysobjects o    WHERE o.xtype IN ('U')  AND o.id = object_id(N'tempdb..#max_dates')) DROP TABLE #max_dates;
IF EXISTS (SELECT  * FROM tempdb.dbo.sysobjects o    WHERE o.xtype IN ('U')  AND o.id = object_id(N'tempdb..#max_dates2')) DROP TABLE #max_dates2;

select distinct
   CONVERT(nvarchar(20),c.clientcode_c) AS client_id, --Legacy CDT# (must be the same legacy ID for all conversion tables)
   CONVERT(nvarchar(50),c.lastname_vc) AS last_name,
   CONVERT(nvarchar(50),c.firstname_vc) AS first_name,
   CONVERT(nvarchar(15),isnull(c.middlename_vc,'')) AS middle_name,
   CONVERT(nvarchar(20),c.altclientcode_vc) AS agency_id_no, --TNKIDS Number
   CONVERT(nvarchar(50),
      CASE
      WHEN c.gender_c = 'M' THEN 'Male'
      WHEN c.gender_c = 'F' THEN 'Female'
      WHEN c.gender_c = 'U' THEN 'Unknown'
      ELSE 'Unknown'
      END) AS gender, 
   CONVERT(varchar(20),
      CASE
      WHEN c.gender_c = 'M' THEN 'M'
      WHEN c.gender_c = 'F' THEN 'F'
      WHEN c.gender_c = 'U' THEN 'U'
      Else 'U'      
      END ) AS gender_code,
   CONVERT(nvarchar(9),(SUBSTRING(c.socialsecnum_c, 1,3)+SUBSTRING(c.socialsecnum_c, 5,2)+SUBSTRING(c.socialsecnum_c, 8,4))) AS ss_number,
     c.birthdate_d AS date_of_birth,
   --CONVERT(nvarchar(50), address1_vc) AS street_address_1,
   --CONVERT(nvarchar(50), address2_vc) AS street_address_2,
   --CONVERT(nvarchar(50), city_vc) AS City,
   --CONVERT(nvarchar(50), state_c) AS state,
   --CONVERT(nvarchar(2), state_c) AS state_code,
   --CONVERT(nvarchar(9), zip_c) AS zip_code,
   CONVERT(nvarchar(50),
      CASE
      WHEN c.religion_c = 'A' THEN '7th Day Adventist'
      WHEN c.religion_c = 'AG' THEN 'Agnostic'
      WHEN c.religion_c = 'AT' THEN 'Atheist'
      WHEN c.religion_c = 'B' THEN ' Buddhist'
      WHEN c.religion_c = 'BA' THEN 'Baptist'
      WHEN c.religion_c = 'C' THEN 'Catholic'
      WHEN c.religion_c = 'E' THEN 'Episopalian'
      WHEN c.religion_c = 'EC' THEN 'Ecumencial'
      WHEN c.religion_c = 'H' THEN 'Hindu'
      WHEN c.religion_c = 'HG' THEN 'Huguenot'
      WHEN c.religion_c = 'J' THEN 'Jewish'
      WHEN c.religion_c = 'JW' THEN 'Jehovahs Witness'
      WHEN c.religion_c = 'L' THEN 'Lutheran'
      WHEN c.religion_c = 'MU' THEN 'Muslim'
      WHEN c.religion_c = 'ME' THEN 'Methodist'
      WHEN c.religion_c = 'MEN' THEN 'Mennonite'
      WHEN c.religion_c = 'MO' THEN 'Mormon'
      WHEN c.religion_c = 'M' THEN 'Moslem'
      WHEN c.religion_c = 'N' THEN 'None'
      WHEN c.religion_c = 'NO' THEN 'Nondenominational'
      WHEN c.religion_c = 'O' THEN 'Other'
      WHEN c.religion_c = 'P' THEN 'Protestant'
      WHEN c.religion_c = 'PC' THEN 'Pentecostal'
      WHEN c.religion_c = 'PS' THEN 'Presbyterian'
      WHEN c.religion_c = 'Q' THEN 'Quaker'
      WHEN c.religion_c = 'UN' THEN 'Unknown'
      WHEN c.religion_c = 'UT' THEN 'Unitarian'
      ELSE 'Unknown'    
      END) AS religion,
   UPPER(CONVERT(varchar(20),
      CASE -- Cased out religion codes KMH 06/17/10
      WHEN c.religion_c = 'A' THEN 'A'
      WHEN c.religion_c = 'AG' THEN 'AG'
      WHEN c.religion_c = 'AT' THEN 'AT'
      WHEN c.religion_c = 'B' THEN ' B'
      WHEN c.religion_c = 'BA' THEN 'BA'
      WHEN c.religion_c = 'C' THEN 'C'
      WHEN c.religion_c = 'E' THEN 'E'
      WHEN c.religion_c = 'EC' THEN 'E'
      WHEN c.religion_c = 'H' THEN 'H'
      WHEN c.religion_c = 'HG' THEN 'HG'
      WHEN c.religion_c = 'J' THEN 'J'
      WHEN c.religion_c = 'JW' THEN 'JW'
      WHEN c.religion_c = 'L' THEN 'L'
      WHEN c.religion_c = 'MU' THEN 'MU'
      WHEN c.religion_c = 'ME' THEN 'ME'
      WHEN c.religion_c = 'MEN' THEN 'MEN'
      WHEN c.religion_c = 'MO' THEN 'MO'
      WHEN c.religion_c = 'M' THEN 'M'
      WHEN c.religion_c = 'N' THEN 'N'
      WHEN c.religion_c = 'NO' THEN 'NO'
      WHEN c.religion_c = 'O' THEN 'O'
      WHEN c.religion_c = 'P' THEN 'P'
      WHEN c.religion_c = 'PC' THEN 'PC'
      WHEN c.religion_c = 'PS' THEN 'PS'
      WHEN c.religion_c = 'Q' THEN 'Q'
      WHEN c.religion_c = 'UN' THEN 'UN'
      WHEN c.religion_c = 'UT' THEN 'UT'
      ELSE 'UN'    
      END)) AS religion_code,
     CONVERT(nvarchar(50), --Added ethnicity case statement KMH 5/26/10
     CASE
     WHEN c.race_c = 'H' THEN 'Hispanic'
     ELSE 'Non Hispanic'
     END) AS ethnicity,
   CONVERT(nvarchar(20), --Added ethnicity case statement KMH 5/26/10
     CASE
     WHEN c.race_c = 'H' THEN '01'
     ELSE '02'
     END) AS ethnicity_code,
   CONVERT(nvarchar(50),
      CASE
      WHEN c.race_c = 'A' THEN 'Asian'
      WHEN c.race_c = 'AI' THEN 'American Indian'
      WHEN c.race_c = 'B' THEN 'African American'
      WHEN c.race_c = 'BR' THEN 'Bi-racial'
      WHEN c.race_c = 'C' THEN 'Caucasian'
      WHEN c.race_c = 'H' THEN 'Hispanic'
      WHEN c.race_c = 'ME' THEN 'Middle Eastern'
      WHEN c.race_c = 'N' THEN 'Native Hawaiian/Other Pacific Islander'
      WHEN c.race_c = 'O' THEN 'Other'
      ELSE 'Other'
      END) AS race_1,
   UPPER(CONVERT(varchar(20), 
      CASE 
      WHEN c.race_c is NULL THEN 'U'
      WHEN c.race_c = 'A' THEN 'A'
      WHEN c.race_c = 'AI' THEN 'AI'
      WHEN c.race_c = 'B' THEN 'B'
      WHEN c.race_c = 'BR' THEN 'BR'
      WHEN c.race_c = 'C' THEN 'C'
      WHEN c.race_c = 'H' THEN 'H'
      WHEN c.race_c = 'ME' THEN 'ME'
      WHEN c.race_c = 'N' THEN 'N'
      WHEN c.race_c = 'O' THEN 'O'
      ELSE 'U'
      END))AS race_1_code,
   CONVERT(nvarchar(150), 'ar.client') AS original_table_name
   
into #client_demographics
from
   ar.client c 
   INNER JOIN cd.enrollments en ON (c.uniqueid_c = en.clientid_c)
   INNER JOIN cd.episode ep ON (ep.uniqueid_c = en.episodeid_c and ep.clientid_c = c.uniqueid_c)
where
   (ep.enddate_d is NULL OR ep.enddate_d >= getdate()-729) and
   en.location_c in (select code from dbo.yv_LKUP_OfficeLocation where state = 'TN')--change data pull with states here (check location codes on dbo.yv_LKUP_OfficeLocation)
   
   
select distinct
   c.clientcode_c,
   c.firstname_vc,
   c.lastname_vc,
   ad.type_c,
   ad.startdate_d,
   ad.enddate_d,
   ad.address1_vc,
   ad.address2_vc,
   ad.city_vc,
   UPPER(ad.state_c) as state,
   ad.zip_c,
   ad.county_vc
   
into #GC_clientaddress
from
   echo.er_address ad
   LEFT JOIN ar.client c ON (ad.linkid_c = c.uniqueid_c)
   INNER JOIN cd.episode ep ON (ep.clientid_c = c.uniqueid_c)
where
	c.clientcode_c in (select client_id from #client_demographics)  


    select gc.clientcode_c, MAX(gc.startdate_d) AS maxdate 
    into #max_dates
    from #GC_clientaddress gc
    where 
		gc.clientcode_c in (select clientcode_c from #GC_clientaddress)
		AND(gc.enddate_d is NULL OR gc.enddate_d >= getdate()-730) 
    group by gc.startdate_d, gc.clientcode_c
    --having count(*) > 2

select distinct clientcode_c, max(maxdate) maxdate
into #max_dates2
from #max_dates
group by clientcode_c
order by clientcode_c


select distinct cd.client_id,
cd.last_name,
cd.first_name,
cd.middle_name,
cd.agency_id_no,
cd.gender,
cd.gender_code,
cd.ss_number,
cd.date_of_birth,
cd.religion,
cd.religion_code,
cd.ethnicity,
cd.ethnicity_code,
cd.race_1,
cd.race_1_code,
cd.original_table_name,
gc.type_c,
gc.startdate_d,
gc.enddate_d,
gc.address1_vc,
gc.address2_vc,
gc.city_vc,
gc.[state],
gc.zip_c,
gc.county_vc

from #client_demographics cd
left join #GC_clientaddress gc on gc.clientcode_c = cd.client_id
join #max_dates2 md on md.clientcode_c = gc.clientcode_c and md.maxdate = gc.startdate_d

This script works perfectly when run in SSMS, but fails with this error and no columns appear in the SSIS Editor interface.


Ryan D

Importing record from xml file to sql table using ssis.

$
0
0

Hi , 

I am trying to import xml file record which contains inline xsd schema into sql table. I had tried all ways which I know and did lot of google but not able to import it. I am new in ssis.

Here I am providing xml file data which has to be imported.

<?xml version="1.0" encoding="utf-8" ?> 
 <DataSet>
 <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
 <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
 <xs:complexType>
	<xs:choice minOccurs="0" maxOccurs="unbounded">
 <xs:element name="Table">
 <xs:complexType>
 <xs:sequence>
  <xs:element name="Date" type="xs:dateTime" minOccurs="0" /> 
  <xs:element name="Brand" type="xs:string" minOccurs="0" />   
  </xs:sequence>
  </xs:complexType>
  </xs:element>
  </xs:choice>
  </xs:complexType>
  </xs:element>
  </xs:schema>
- <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
 <NewDataSet>
 <Table diffgr:id="Table1" msdata:rowOrder="0">
  <Date>2009-01-01T13:30:00+05:30</Date> 
  <Brand />   
  </Table>
<Table diffgr:id="Table1" msdata:rowOrder="0">
  <Date>2009-01-01T13:30:00+05:30</Date> 
  <Brand />   
  </Table>
<Table diffgr:id="Table1" msdata:rowOrder="0">
  <Date>2009-01-01T13:30:00+05:30</Date> 
  <Brand />   
  </Table>
<Table diffgr:id="Table1" msdata:rowOrder="0">
  <Date>2009-01-01T13:30:00+05:30</Date> 
  <Brand />   
  </Table>
</NewDataSet>
  </diffgr:diffgram>
</DataSet>

Please help me how to import this data into sql table using ssis.

Thanks.

Rename File With Previous/Prior Month

$
0
0

I currently have dynamcialy created PDF's created through a script task in C# that someone else created. They currently have names like Ford-8-7-2012, Nissan-8-7-2012. The date part is based off of the date it is run.

I need to change the file names to the previous month and current year, which is what the data is for. With the names above the new file names would be Ford-7-2012, Nissan-7-2012. I am not sure if I can use an expression or if I have to dig through the C# code to fix this, as I am not very handy in C#.

I also didn't know if there would be problems when Jaunuary comes considering just reenaming the month aspect would cause it to carry over the previous month with the current year so this coming New Year would be Ford-12-2013 instead of Ford-12-2012.

Any suggestions?

OLE DB Destination - table name or view name variable - fast load

$
0
0

Hi

I have read through a few posts on here on how to create a dynamic table name using the  table name or view name variable - fast load property in the OLE DB destination component in SSIS 2008.

Please can someone outline the steps of how I can create a table name that includes the datetime on the fly using the OLE Db destination?

Thanks

Micrsoft Acces qry to SSIS

$
0
0

I currently have a query set up in a Microsoft Access Database called qryExportFinal which creates a table. This query currently is manually run, then exported to excel, then saved as a tab deliminated file.

 I would like to automate this process but I am not sure how to run the Access Query in SSIS. Or if there is even an option to run the qry, I was considering trying it through either through a sql statement or a script task maybe, but I am not quite sure how.

 I assume after I figure out a way to run the qry I can use a data flow to automatically save the file to a tab deliminated destination.


SSIS Making the connection manager dynamic

$
0
0

Hi,

I am trying to make the connection manager dynamic by ading connection strings through variables, but it gives me error whenever i am trying to fetch the variable through SQL task.

Can anyone give the step wise details?


failing a sql job upon send mail task

$
0
0

Hi,

Is there an easy way some setting perhaps that I can fail a sql job after successfully completing a mail task in SSIS?

Thanks,

Phil

help with usinf script task to get the filename

$
0
0

There is a folder that will have file to be loaded to a table.
This filename is dynamic in nature.
So, I am using a script task to get the filename .I am passing the folder path to this and also assigning a readwrite variable to hold the filename from the folder path .
But, it is giving an error message.


Here is the code :

ReadOnlyVarible in the script task :Inputfilename
ReadWriteVariables :filename

Imports System.Data
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.Windows.Forms
Imports System.IO


Partial Public Class ScriptMain

    Public Sub Main()
        Dim Filename1 As String

        Dim FilePath As String = Dts.Variables("User::inputFilePath").Value.ToString()

        Dim list As String() = System.IO.Directory.GetFiles(FilePath, "*.xls*")

        Dts.Variables("User::filename").Value = list

 

        Dts.TaskResult = Dts.Results.Success


    End Sub
End Class

Bug Discovered in SSIS Data Miing Model Training Task

$
0
0

In SQL 2005 I ran across a scenario which I think is a bug but would like comments on

I have a package (screenshot below) which uses a view to feed data into a data flow destination task "Data Mining Model Training".  A select * from the view in SSMS runs in 7 seconds (returning 7500 rows 350 columns of mostly bit fields), but in the below screenshot, records are moved from the OLE DB Source to the "Data Mining Model Training 1" task at speeds similar to 1 record per second.  When I added an index to an underlying table in the view, it changed the speeds to almost instant. 

The bug IMO is that why would it take SSIS so long to return the records when no index is on the view, but when i do select * from SSMS it returns all the data within 7 seconds.

 

Importing CSV file to SQL Server, Code Page and Data Type Issues

$
0
0

I have a series of CSV files that I need to import daily into a SQL server database.  I am having a particular issue with a field: LoanNumber.  LoanNumber can be either a very long number or text, my issue is the data needs to eventually get into a varchar field and depending on how I try to move it through SSIS, either the text gets Nulled or some of the numbers end up as text in scientific notation.

The origin of these files are CSV files I download.  The resulting file is a CSV that uses Code Page 65001 (UTF-8) where some LoanNumber's are text, some numeric and some in scientific notation, the Text is Qualified by "" and comma delimiter is a ','.  My goal is to get this field into a SQL Server table as a varchar, which requires Code Page 1252 as part of the transformation.

Part of my issue is the different ways Excel handles the CSV file depending on how it is opened.  If I use Windows Explorer and double click on the file name, it will open in Excel with no wizard or prompting, I can widen and change the LoanNumber column to a "Number" type which converts all the scientific notation to numbers and save the file.  What is odd though, is even after saving the file using the save button, and without making additional changes, when I close the file Excel prompt's me to save again.  If I save with this prompt, Excel saves the CSV as an ANSI 1252 file that is tab delimited (according to SSIS) even though it is still a CSV file.

On the other hand, if I have Excel open and try to open the CSV file, it gives me the text conversion wizard.

My question is this: is there a way in Excel to force a CSV file to be saved in the ANSI 1252, tab delimited format, or is there some other way to save the file that is easy for SSIS to interpret?  I have been converting all of my CSV files to Excel files, and using SSIS with Excel data sources, but Excel will implicitly convert some of my numbers to Scientific Notation at times, even if the column is a Number column I've found, so I don't think Excel data sources for SSIS are the right answer.

Text file with comment field containing carriage returns

$
0
0

I have a text file that is tab delimited, non-qualfied, with column names as the first row. The row delimiter is {CR}{LF}. The last field is a comment field, and some rows contain CRLFs within that field. I tried removing those with a derived column that uses this expression :

REPLACE(REPLACE(Comments,"\n"," "),"\r"," ")

My guess is it doesn't work because SSIS identifies the end of each row before looking at the contents of the last field.

Does anyone have a suggestion?

Thank you

Viewing all 24688 articles
Browse latest View live


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