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

SSIS - Treat Consecutive Delimiters as one

$
0
0

Hello, 

Does anyone know how to enable "Treat Consecutive Delimiters as one." option to work with txt files on SSIS?

if this exists in excel, should be exist everywhere... or not ? 



Gilberto H.


Implementing Best Practices is Increasing Execution Time

$
0
0

I have inherited some SSIS packages that are used to populate a data warhouse using SAP SQL Server DB as a source.  I am fairly new to SSIS so I've been doing a lot of research on best practices as part of my education.

One of the data flow tasks pulls material related data and looked like a prime target for optimization as it was utilizing 6 separate OLE DB Source tasks each with their own SSIS Sort all merged within SSIS.  I was able to duplicate the logic with a single query and incorporate server-side sorting.  This should have, from all I've learned, increased performance and reduced the execution time.  Instead the execution time went from 1:02.200 to 2:35.580.

Confused I tried another tact and just removed the Sort Tasks from the original package by moving the sort to the OLE DB Sources.  Execution time was better than the attempt at consolidation but still greater than the original at 1:32.259.

Does anyone have any idea what's going on here and why it is behaving contrary to expectations?  The total output is only about 6500 rows.  If there is any additional info needed to make a prognosis let me know I just didn't want to bloat this post any more that it already is.

Thanks

How to re-engineer OLAP access to a modern data mart?

$
0
0

I am reengineering a crude data mart that was created in SQL Server 7.  (It consists of tables based directly on mainframe extracts, with no data cleaning or conforming, etc.)  The new system is starting to take shape in SQL Sever 2008 R2, but I am under pressure to make like-for-like data available immediately, which means the complete data modelling and cube building will have to wait. My problem is:  How should I expose the data to the users?

Currently, people are using Access to link to views on the tables in the old (SQL Server 7) database. This creates a recurring PITA problem with the scheduled database refreshes:  If the extracts are late coming out of the mainframe, people have already connected to the database by the time the ETL tries to run, and it fails because of table locks. I suppose the same situation will arise in the new data mart if I again grant user access to views on the tables -- unless I modify the ETL to allow new versions of the tables to be built while the clients are still pointing to the old ones.

Should I simply deny direct access to these tables, and instead provide stored procedures for use by Access and Excel clients?  (I haven't tried this before, and I'm worried about provoking a backlash if it doesn't go smoothly).




Whatever I do, it may be necessary to create a messaging solution that informs users of which data they are using (i.e. last week versus this week)  while the tables are getting refreshed (or the extracts are late). Any tips?

File name property is not valid

$
0
0

Hi,

I need to create dynamic .csv files with each deptname and systems date using sis2008 package

i created package with sql query execute for eachloop data flow container oldb container and flat file destination.

every thing is good but flat file connect is giving errors saying the filename property is not valid. the filename is a device or contains invalid characters.

my expressition connection string for dynamic creation of a file i gave following code

@[User::path]+ @[User::Client] +"_"+(DT_STR, 4, 1252) DATEPART("yy" , GETDATE()) +  RIGHT("0" + (DT_STR, 2, 1252) DATEPART("mm" , GETDATE()), 2) + RIGHT("0" + (DT_STR, 2, 1252) DATEPART("dd" , GETDATE()), 2)+".csv"

but the eeror is :: file name property is not valid

please help

Thanks

Madhavi



Madhavi Pasapula


Execute package task external reference mode SQL Server

$
0
0

Hi All,

I was trying to use the SQL Server  as the external reference for the Execute package task for my parent package but it was showing me the msdb database content when I created the connection to the SQL server instance with catalog as SSISDB so that i could use the deployed packages as my child packages.

Actually  my denali msdb doesnt have any packages deployed to it.

My questions are:

  1. What is the purpose of msdb database in denali if the packages are going to be stored in SSISDB?
  2. What is the purpose of the SQL Server as external reference if we cannot deploy the packages to MSDB database as package configurations seems to be deprecated in denali due to project deployment feature and parameter feature?
  3. If I want to follow the best practices and use the packages deployed in SSISDB database as my child packages what should be my approach other than using a stored procedure? 

Can anybody help me on this?


Thanks, Franco.

SSIS SCRIPT COMPONENT ERROR

$
0
0

I have a Code that extracts the Active Directory User information from various Domains. It works fine for the most part but then it keeps failing with output buffer error. If i remove one column then the pacakge runs fine. I have few columns i need to extract data from . Any suggestion or help to get the data from n-number of columns will be helpful

Here is the error i get

SSIS SCRIPT COMPONENT ERROR :  “The value is too large to fit in the column data area of the buffer”

I am assuming their should be some property to set that will extract the data .. I tried both String and integer , same issue.

Not sure if their is in limitation of number of columns i can extract

Imports System
Imports System.Data
Imports System.DirectoryServices    'You must Add This, Since I am not fully qualifying the Class names with the namespace.
Imports System.Math
Imports System.Text                 'namespace for the StringBuilder class
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper<Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute()> _<CLSCompliant(False)> _
Public Class ScriptMain
    Inherits UserComponent
    Public Overrides Sub CreateNewOutputRows()
        Dim de As New DirectoryEntry
        Dim searcher As New DirectorySearcher
        Dim search_result As SearchResultCollection
        Dim result As SearchResult
        Dim props As ResultPropertyCollection
        Dim MemberOfList As StringBuilder
        Dim PropertiesList, s As String
        Using (de)
            de.Path = Me.ReadOnlyVariables("gLDAPQuery").Value.ToString()
            Using (searcher)
                searcher.SearchRoot = de
                searcher.Filter = Me.ReadOnlyVariables("gLDAPFilter").Value.ToString()
                searcher.SearchScope = SearchScope.Subtree
                ' List of ActiveDirectory columns to retrieve
                searcher.PropertiesToLoad.Add("SamAccountName")
                searcher.PropertiesToLoad.Add("EmployeeID")
                searcher.PropertiesToLoad.Add("GivenName")
                searcher.PropertiesToLoad.Add("Mail")
                searcher.PropertiesToLoad.Add("SN")
                searcher.PropertiesToLoad.Add("Description")
                searcher.PropertiesToLoad.Add("DN")
                searcher.PropertiesToLoad.Add("createTimeStamp")
                searcher.PropertiesToLoad.Add("homeMDB")
                searcher.PropertiesToLoad.Add("mDBStorageQuota")
                searcher.PropertiesToLoad.Add("mDBOverHardQuotaLimit")
                searcher.PropertiesToLoad.Add("mDBOverQuotaLimit")
                searcher.PropertiesToLoad.Add("mDBUseDefaults")
                searcher.PropertiesToLoad.Add("msRTCSIP-UserEnabled")
                searcher.PropertiesToLoad.Add("extensionAttribute9")
                searcher.PropertiesToLoad.Add("Pwdlastset")
                searcher.PropertiesToLoad.Add("useraccountcontrol")
                ' limited to some threshold.
                searcher.PageSize = 2048
                'Retrieve the results from Active Directory
                search_result = searcher.FindAll()
                For Each result In search_result
                    props = result.Properties
                    'Create a placeholder to store the list of applicable properties 
                    ' for a given Active Directory record.
                    PropertiesList = ""
                    For Each s In props.PropertyNames
                        PropertiesList = PropertiesList & s & ","
                    Next
                    'remove last comma
                    PropertiesList = PropertiesList.Substring(0 _
                                    , PropertiesList.Length() - 1)
                    ' Add rows by calling AddRow method on member variable called "<Output Name>Buffer"
                    ' E.g. in our case it will be ActiveDirectoryOutputBuffer
                    ActiveDirectoryOutputBuffer.AddRow()
                    ActiveDirectoryOutputBuffer.PropertiesList = PropertiesList
                    'Need to check wheter the props collection does contain the property before retrieving the values
                    '  because some Active Directory Records may or may not contain some properties.
                    If props.Contains("SamAccountName") = True Then
                        ActiveDirectoryOutputBuffer.SamAccountName = props("SamAccountName")(0).ToString()
                    End If
                    If props.Contains("Mail") = True Then
                        ActiveDirectoryOutputBuffer.Mail = props("Mail")(0).ToString()
                    End If
                    If props.Contains("GivenName") = True Then
                        ActiveDirectoryOutputBuffer.GivenName = props("GivenName")(0).ToString()
                    End If
                    If props.Contains("EmployeeID") = True Then
                        ActiveDirectoryOutputBuffer.EmployeeID = props("EmployeeID")(0).ToString()
                    End If
                    If props.Contains("SN") = True Then
                        ActiveDirectoryOutputBuffer.SN = props("SN")(0).ToString()
                    End If
                    If props.Contains("Description") = True Then
                        ActiveDirectoryOutputBuffer.Description = props("Description")(0).ToString()
                    End If
                    If props.Contains("DN") = True Then
                        ActiveDirectoryOutputBuffer.DN = props("DN")(0).ToString()
                    End If
                    If props.Contains("createTimeStamp") = True Then
                        ActiveDirectoryOutputBuffer.createTimeStamp = props("createTimeStamp")(0).ToString()
                    End If
                    If props.Contains("homeMDB") = True Then
                        ActiveDirectoryOutputBuffer.homeMDB = props("homeMDB")(0).ToString()
                    End If
                    If props.Contains("mDBStorageQuota") = True Then
                        ActiveDirectoryOutputBuffer.mDBStorageQuota = props("mDBStorageQuota")(0).ToString()
                    End If
                    If props.Contains("mDBOverHardQuotaLimit") = True Then
                        ActiveDirectoryOutputBuffer.mDBOverHardQuotaLimit = props("mDBOverHardQuotaLimit")(0).ToString()
                    End If
                    If props.Contains("mDBOverQuotaLimit") = True Then
                        ActiveDirectoryOutputBuffer.mDBOverQuotaLimit = props("mDBOverQuotaLimit")(0).ToString()
                    End If
                    If props.Contains("mDBUseDefaults") = True Then
                        ActiveDirectoryOutputBuffer.mDBUseDefaults = props("mDBUseDefaults")(0).ToString()
                    End If
                    If props.Contains("msRTCSIP-UserEnabled") = True Then
                        ActiveDirectoryOutputBuffer.msRTCSIPUserEnabled = props("msRTCSIP-UserEnabled")(0).ToString()
                    End If
                    If props.Contains("Pwdlastset") = True Then
                        ActiveDirectoryOutputBuffer.Pwdlastset = props("Pwdlastset")(0).ToString()
                    End If
                    If props.Contains("useraccountcontrol") = True Then
                        ActiveDirectoryOutputBuffer.useraccountcontrol = props("useraccountcontrol")(0).ToString
                    End If
                Next
            End Using
        End Using
        de = Nothing
        searcher = Nothing
        search_result = Nothing
        result = Nothing
        props = Nothing
        MemberOfList = Nothing
    End Sub
End Class


ns100

String Column Issue with SSIS Wizard SP Source

$
0
0

When I use

USE [AdventureWorks2012]

EXEC	[dbo].[uspGetBillOfMaterials]
		@StartProductID = 800,
		@CheckDate = N'2008-02-01'

As source in SSIS Import/Export Wizard, it cannot map the string column. It shows 202 for source type. Same for other sp-s with string columns in results set.  When I specifically did a convert(varchar...) in the output, it showed 200 for type.


Kalman Toth Database & OLAP Architect sqlusa.com
New Book / Kindle: Pass SQL Exam 70-461 & Job Interview: Programming SQL Server 2012


Bulk Insert Errors (Unknown Cause)

$
0
0

I don't know if anybody already asked this before.

but what does this error means:

Msg 4832, Level 16, State 1, Line 1
Bulk load: An unexpected end of file was encountered in the data file.
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".

==============================================================================

I'm trying to upload a .csv file using "BULK INSERT" into mytable with datatype of nvarchar(max)

Here is my Bulk Insert Script:

BULK INSERT myTable
FROM 'D:\CSV Files\CLIENT\DATA.csv'
with
(
firstrow = 2,
fieldterminator = ',',
rowterminator = '\n',
tablock,
keepnulls
)

Thanks Everyone,



cannot open/find my ssis package

$
0
0

Hi all,

I created a package through BIDS export import wizard. I saved it on my local system and also saved a copy of the package on the SQL server. The final path it displayed while saving was /MySQLSERVERName/MySSISPackageName.

I am first of all not able to connect to Integration services, it gives a weird "access denied" message. Then I tried to remote desktop into the server, and connect to integration services via management studio - I am able to connect! But I don't see any ssis packages in the msdb folder or any other folders. Infact, I don't see any ssis packages inside stored/run packages at all.

Then, I thought I could open my stored ssis package through BIDS. I clicked Project -> Add Existing Package.. I gave my sql server information, I found my ssis package and clicked open. Nothing opened up. I don't know what is wrong and how to trouble shoot this issue. Please help.

Thanks

Need Bat file to delete file older than 7 Day

$
0
0

Hi All,

My file looks like this

Load201307250717.txt in the format YYYYMMDDHHMM.

Now I have to delete the files which are older than 7 days.

To create the above file my command looks like this

set hh=%time:~-11,2%
set /a hh=%hh%+100
set hh=%hh:~1%
Set TIMESTAMP=%date:~10,4%%date:~4,2%%date:~7,2%%hh%%time:~3,2%%time:~6,2%


copy/Y D:\FOCUS\logs\Load%date:~-4%%date:~4,2%%date:~7,2%.txt "D:\FOCUS\logs\Load%TIMESTAMP%.txt"

dtexec /file "D:\dtsx\LoadIRS.dtsx" /config "D:\config\Load.dtsConfig" >D:\logs\Load%date:~-4%%date:~4,2%%date:~7,2%.txt

Help Needed


Sri.Tummala

Automatically Create Dynamic SQL

$
0
0

Hi All,

I have many Source SQL for the SSIS Data flow source, that is current stored in SSIS variable, but now I want to make them configurable from Config Table which stores the SQL and use it in Data flow source, this way I benefit from saving time if there is any logic change in the source query (but no Column structure as they mapped in data flow) , as I dont need to redeploy the SSIS package, just a data correction scripts. 

Just wanted to ask if there is any quick way to autogenerate dynamic SQL stored in varchar(8000) from source SQL scripts. I Dont prefer to do it manually. Also I have once Web application that can update the values in config table, I can update the dynamic scripts from there, again saves time.

Want to add, I dont have permission to create views on data source DB Server

Thanks in advance.



SQL Linked Server vs SSIS Data Flow

$
0
0
Just wandering, what is the best practise to copy the data into staging table if I have options of both LInked server and  SSIS Data Flow ?

variable mapping and result set

$
0
0

this is frustrating.. I just thought of showing a sample variable declaration and result set to my friend but I don't know for some reason getting error. Please find as attached. Any reply is highly appreciated. 

steps i m following as this..


CREATE A TABLE DESTINATION OUPUT BASED ON THE CONDITION OF ANOTHER TABLE DATA

$
0
0

Hi

I am a newbie for ssis.

i would like to know,

 how would i create an output or cache transform  with a condition taking the data from another table.

An example

Let say i have two table

Employee table which consists of  name, department, dateofbirth

System processing date table which consists of branch, business date

i would like to display the information of the employee from the employee table which take the condition of the employee table dateofbirth > system processing date table business date.

If any kind people that could help on this

thank

Regards,bruce 


brucelim

SSIS 2012 - Error Output ColumnName

$
0
0

Hi,

I am trying to get error column name from my error output but am experiencing some difficulties on the way so I was wondering if you guys can help.

I tried to follow this article but as soon as I click on the .exe, CMD window opens up and disappears.

I am running Windows 7/8 and SS 2012.

Am I missing something?

Thank you


One critical requirement with For Each Loop container and File System Task - Please help!!!!

$
0
0
Hi,

This is one of the critical requirement given by my client.

   Assume there are 3 Files are available in a folder. They are 

a)file_july10.txt, 
b)File_july11.txt and 
c)File_july12.txt.

My package has to do the following

1) For each loop the the folder and all the file_*.txt files should be loaded into the table(data will be appended in the table).
2) Then all the three files should be archived.
3) Incase, next week , if they put 3 files in the shared path
    The files may be 
    a)File_july12.txt,
    b)File_July13.txt and 
    c)File_July15.txt.
  
 Please note - this File_july12.txt  is the same file we loaded  and archived during the last load, but this week it has come again)
   
4) So, this time , i should load the  File_July13.txt and File_July15.txt files, because they are new files and then i have to archive it.
But the File_July12.txt - I just need to delete it without loading, because we loaded it last time.


I am ok with loading and archiving the files (1 & 2 steps). But, i am not able to do the next ie - if the already loaded file (might be loaded last week, or last month), i have to delete it without loading. 

This is somehting like a case statement - if (file name is already there) - send it to File System Task for deletion. If not, send it to a DFT for loading and then archive.

I have lot of questions like
Where to store the loaded files name? How to compare the file name loaded this time to previous loaded file ? and then how to pass the file name to the File System Task ?

Can you please help me to do this -  I don't know much about Script task - it would be great if you help me with all the other tasks!


Thanks
Revathy
   

extract validation

$
0
0

Hi All,

I have this script in script task in SSIS.

string
Dts.Variables["InputPath"].Value;
{
if (Directory.Exists(strpath))
{
// Process the list of files found in the directory. 
string strfilenamewithext = "";
string[] fileEntries = Directory.GetFiles(strpath, "*.EXTRACT*");
foreach (string fileName in fileEntries)
{
strfilenamewithext = Path.GetFileName(fileName);
if (strfilenamewithext.Equals("ExtractToBeLoad.EXTRACT01"))
{
Dts.Variables["Extract01"].Value = strfilenamewithext;
Dts.TaskResult = (int)ScriptResults.Success;
}
else
{
Dts.Events.FireError(52, "File Validation", "Invalid File Name - " + strfilenamewithext, "", 0);
Dts.TaskResult = (int)ScriptResults.Success;
}
}
}

Script work fine until i place another .extract01 file but different file name to the path configured in connection string. I want the SSIS Package to ignore that file and continue loading file that has a correct file name.

Thanks

Script to Create Footprint ticket

$
0
0

Hello all,

I want help on below scenario....

Sp to Create Footprint ticket whenever file available in purticular folder..

Thanks in Advance-:)

I got an requirement that whenever files comes for purticular process, automate ticket should be created  for purticular user...

How can i achive this....

Releasing server memory in use

$
0
0

Hello - I am having problems running ANY SSIS packages lately.  After reseraching and looking around a bit, I found that I have 0 memory available because SQL Server has cached all available memory. 

I need to figure out how to "unlock" the memory AND change the maximum threshold so this does not keep happening. 

When I run this query in Management Studio on the master db:

SELECT

value,minimum,maximum,value_in_use

fromsys.configurations

wherename='max server memory (MB)'

I get these results :  value = 2147483647, minmum = 128, maximum =  2147483647, value_in_use: 2147483647


Jenna G

Loading set of text files into Table and then save the file names in a SQL table - Please help!

$
0
0

Hi,

   I have loaded a set of Flat files in to a table using For each Loop container and Archived the Files using File System Task.

Now, can you please tell me how can i save the loaded file names in a table - so that if the same source file comes again, i can just delete them without loading.

I have very little knowledge in Script task and trying to solve this without the help from script task..

Your help would be highly appreciated!

Viewing all 24688 articles
Browse latest View live


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