Showing posts with label source. Show all posts
Showing posts with label source. Show all posts

Friday, March 23, 2012

Problems with remote SQL 2005 server and excel as an input source

Hello,

I am trying to write my first couple Integration Services packages using SQL 2005. My configuration is a workstation running windows xp professional, and a windows 2003 server that is running the SQL server.

Anytime I run a package that accesses the remote server from my workstation, the job fails with an error code. The workstation cannot seem to run a package to load data to the remote sql server. Why is this? Is there a service pack, or hotfix coming out soon to correct this problem?

Additionally, I also seem to be unable to update a database using excel as the data source from which information should be used. If I import my excel spreadsheet into an access table, I can update the sql database from Access using integration services. Why can't I use an excel spreadsheet as the source? Is there a a service pack or hotfix coming out soon for 2005 sql that will correct this problem?

Thanks!

Jim

I've been able to input an excel spreadsheet in the dataflow and then use an Oracle destination to update an oracle table - what errors are you getting?|||

Jim R wrote:

Is there a a service pack or hotfix coming out soon for 2005 sql that will correct this problem?

It would help if you told us what the problem was before anyone answers that question.

What errors are you getting?

|||What destination transform are you using?

If you are using the SQL Server Destination, then the package must run

on the destination server. The SQL Destination inserts data much

more efficiently than the OLE Destination.

If you are using the OLE DB Destination, then please post the error message you are receiving so that we help you debug.

Larry|||

I am using an SQL destination, but I don't understand why the package must run on the destination server for SQL server? That was never a requirement before with sql 2000's DTS services... Shouldn't I be able to develop, test, and even deploy packages to other servers?

Speaking of deploying. Once I have a package developed, how can I run it on the server machine? I don't intend to install the visual studio, etc. on the server....

Jim

|||

Jim,

the SQL Server desination is a special destination adapter for LOCAL SQL Servers only... If you want to connect to remote servers you have to use the OLE DB destination... This is by design...

|||

Why is the SQL server destination for LOCAL SQL servers only? Isn't there a significant performance increase in using the SQL server type versus the OLEDB one when accessing a SQL server?

I also read some articles that state that the SSIS service does not get installed in the workstation edition of SQL server 2005, unless you use the Developer Edition. Can someone also explain why that is?

Thanks!

|||

Hi,

to be honest: no idea. I only know that they did some "tricks" to make accessing local servers faster...

What do you mean with "workstation edition"? I'm not aware of this edition...

|||

The Service is indeed not part of Workgroup Edition, as noted in the matrix in "Features Supported by the Editions of SQL Server 2005." However unlike the SQL Server or Analysis Services services, for example, the Integration Services service is not crucial to building and running packages, but merely provides some extra services, like monitoring running packages.

-Doug

|||

Even i have taken excel spreadsheet as input in dataflow and use SQL server destination to update data. But iam not able to update data in database.

I have an excel source which has some columns with values(for ex column with values "yes" / "No"). Now i need to update particular column of a table in a sql server database depending on the column value in excel source.

There was no error in the package but i could not get the expected result could any one help me in this regard.

thanks in advance.

|||

You have not told us what unexpected results you obtained, or what errors you encountered.

You almost certainly need to add a Derived Column transformation to convert "yes" or "no" values to the appropriate Boolean values that a SQL database is probably expecting.

For relatively simple import and export scenarios, you'll usually save yourself some grief by using the Import and Export Wizard to create and save the initial package, then revise and enhance it as needed.

-Doug

|||

Jim R wrote:

Why is the SQL server destination for LOCAL SQL servers only?

Because of the way it works. It has a special mechanism for accessing the memory space of the SQL Server instance but of course in order to do that it needs to be on the same machine. It isn't a limitation that they have delierately put in - its just the way it is.

-Jamie

|||

The scenario goes on like this:

I have an excel source with 3 coulumns(sno,sname,status). The values for status column will be either "yes" or "no".

I have a student table in SQL Server datatase which contain some columns(stdsno,stdsname, stdstatus)

i need to update the stdstatus column of student table in sql server database if and only if the sno of excel source matches with stdsno of sqlserver table and also status column value of excel source is "no".

(for example i need to update the stdstatus column values in database only if the status column value of excel source is "no").

I have taken excel as input source and sqlserverdestination as destination. Which transformation should i use to achive the above said

output.

|||

sanj_vam wrote:

The scenario goes on like this:

I have an excel source with 3 coulumns(sno,sname,status). The values for status column will be either "yes" or "no".

I have a student table in SQL Server datatase which contain some columns(stdsno,stdsname, stdstatus)

i need to update the stdstatus column of student table in sql server database if and only if the sno of excel source matches with stdsno of sqlserver table and also status column value of excel source is "no".

(for example i need to update the stdstatus column values in database only if the status column value of excel source is "no").

I have taken excel as input source and sqlserverdestination as destination. Which transformation should i use to achive the above said

output.

If you need to compare source with destination then Lookup is a good option. Merge Join also has cpabilities in this area.

-Jamie

Problems with remote SQL 2005 server and excel as an input source

Hello,

I am trying to write my first couple Integration Services packages using SQL 2005. My configuration is a workstation running windows xp professional, and a windows 2003 server that is running the SQL server.

Anytime I run a package that accesses the remote server from my workstation, the job fails with an error code. The workstation cannot seem to run a package to load data to the remote sql server. Why is this? Is there a service pack, or hotfix coming out soon to correct this problem?

Additionally, I also seem to be unable to update a database using excel as the data source from which information should be used. If I import my excel spreadsheet into an access table, I can update the sql database from Access using integration services. Why can't I use an excel spreadsheet as the source? Is there a a service pack or hotfix coming out soon for 2005 sql that will correct this problem?

Thanks!

Jim

I've been able to input an excel spreadsheet in the dataflow and then use an Oracle destination to update an oracle table - what errors are you getting?|||

Jim R wrote:

Is there a a service pack or hotfix coming out soon for 2005 sql that will correct this problem?

It would help if you told us what the problem was before anyone answers that question.

What errors are you getting?

|||What destination transform are you using?

If you are using the SQL Server Destination, then the package must run

on the destination server. The SQL Destination inserts data much

more efficiently than the OLE Destination.

If you are using the OLE DB Destination, then please post the error message you are receiving so that we help you debug.

Larry|||

I am using an SQL destination, but I don't understand why the package must run on the destination server for SQL server? That was never a requirement before with sql 2000's DTS services... Shouldn't I be able to develop, test, and even deploy packages to other servers?

Speaking of deploying. Once I have a package developed, how can I run it on the server machine? I don't intend to install the visual studio, etc. on the server....

Jim

|||

Jim,

the SQL Server desination is a special destination adapter for LOCAL SQL Servers only... If you want to connect to remote servers you have to use the OLE DB destination... This is by design...

|||

Why is the SQL server destination for LOCAL SQL servers only? Isn't there a significant performance increase in using the SQL server type versus the OLEDB one when accessing a SQL server?

I also read some articles that state that the SSIS service does not get installed in the workstation edition of SQL server 2005, unless you use the Developer Edition. Can someone also explain why that is?

Thanks!

|||

Hi,

to be honest: no idea. I only know that they did some "tricks" to make accessing local servers faster...

What do you mean with "workstation edition"? I'm not aware of this edition...

|||

The Service is indeed not part of Workgroup Edition, as noted in the matrix in "Features Supported by the Editions of SQL Server 2005." However unlike the SQL Server or Analysis Services services, for example, the Integration Services service is not crucial to building and running packages, but merely provides some extra services, like monitoring running packages.

-Doug

|||

Even i have taken excel spreadsheet as input in dataflow and use SQL server destination to update data. But iam not able to update data in database.

I have an excel source which has some columns with values(for ex column with values "yes" / "No"). Now i need to update particular column of a table in a sql server database depending on the column value in excel source.

There was no error in the package but i could not get the expected result could any one help me in this regard.

thanks in advance.

|||

You have not told us what unexpected results you obtained, or what errors you encountered.

You almost certainly need to add a Derived Column transformation to convert "yes" or "no" values to the appropriate Boolean values that a SQL database is probably expecting.

For relatively simple import and export scenarios, you'll usually save yourself some grief by using the Import and Export Wizard to create and save the initial package, then revise and enhance it as needed.

-Doug

|||

Jim R wrote:

Why is the SQL server destination for LOCAL SQL servers only?

Because of the way it works. It has a special mechanism for accessing the memory space of the SQL Server instance but of course in order to do that it needs to be on the same machine. It isn't a limitation that they have delierately put in - its just the way it is.

-Jamie

|||

The scenario goes on like this:

I have an excel source with 3 coulumns(sno,sname,status). The values for status column will be either "yes" or "no".

I have a student table in SQL Server datatase which contain some columns(stdsno,stdsname, stdstatus)

i need to update the stdstatus column of student table in sql server database if and only if the sno of excel source matches with stdsno of sqlserver table and also status column value of excel source is "no".

(for example i need to update the stdstatus column values in database only if the status column value of excel source is "no").

I have taken excel as input source and sqlserverdestination as destination. Which transformation should i use to achive the above said

output.

|||

sanj_vam wrote:

The scenario goes on like this:

I have an excel source with 3 coulumns(sno,sname,status). The values for status column will be either "yes" or "no".

I have a student table in SQL Server datatase which contain some columns(stdsno,stdsname, stdstatus)

i need to update the stdstatus column of student table in sql server database if and only if the sno of excel source matches with stdsno of sqlserver table and also status column value of excel source is "no".

(for example i need to update the stdstatus column values in database only if the status column value of excel source is "no").

I have taken excel as input source and sqlserverdestination as destination. Which transformation should i use to achive the above said

output.

If you need to compare source with destination then Lookup is a good option. Merge Join also has cpabilities in this area.

-Jamie

Wednesday, March 7, 2012

problems with codepage

How to convert a flat file source in 65001 codepage to 1252 OLE DB connection ?

You can try the following:

- Edit your flat file connection manager and set the code page to 65001.
- Define you flat file columns
- Go to the "Advanced" page and change data types in the columns you want to convert from "string [DT_STR]" to "Unicode string [DT_WSTR]".
- Define your Flat File Source to use the newly created connection manager.
- Drop a Data Conversion transform and connect it to the Flat File Source one.
- Select the columns you want to convert and set their data types to "String [DT_STR]" and their code pages to "1252 (ANSI - Latin I)".
- Add an OLE DB Destination adapter and map the destination columns to the converted ones.

HTH.

Thanks,

|||You should be able to specify the code page of 65001 when configuring the flat file connection.

You will likely have to use two data convert transforms downstream, one to convert the 65001 into unicode, and the other to convert the unicode into 1252.

jkh

Saturday, February 25, 2012

Problems while converting string to date.

Hi Guys,

Source Column Data type: Varchar

Destination Data Type: smalldatetime

We have 2 columns effective_Date and Expiration_Date:

the format of data in these columns is not consistent.

Sample values:

1/23/2006

Tuesday, June 21, 2005

1/0/1900

8-Mar-06,

NULL

Now, i want to convert to a standard date format like "2006-03-08 00:00:00".

please let me know the steps to do..

Thanks in Advance.

Sri

Use the Derived Column component. This is simply a string manipulation problem.

-Jamie

|||

Thanks Jamie,

Can you please eloborate the process with the same example.

|||

Hi Jamie,

As i told earlier the date column has different formats of date,

please help me in finding the solution.

how many derived column transformations i have to use..is it for every format of date i have to use one ?

for eg if date format is Wednesday, June 01, 2005 then can you please explain me how to write the code in derived column transformation?

I appreciate your help.

|||

That looks challenging....may be you can use a script component with Regular expressions to parse the date and split the rows according to their format; then you can have expressions to cast them accordingly...

This is just a thought...sorry I have not examples

Rafael Salas

|||

Thanks Rafael...atleast i have something to start..

Where can we implement case statement ..

can we do that in derived column transformation?

let me try this..

Thanks

Sri

|||

You could use a series of nested SSIS conditional operator inside of the derived columns; but the expression can get very large and hard to read/debug.

You can see an example of the conditional operator here:

http://msdn2.microsoft.com/en-us/library/ms141680.aspx


Rafael Salas

Monday, February 20, 2012

Problems when retrieving cubes schema using OleDb

Hello,

I'm using Analysis Service 9.0 OleDb provider to retrieve a schema from the data source as follows:

Code Snippet

olapConnection.GetOleDbSchemaTable(OLAPSchemaGuid.Cubes, new object[] { catalogName });

The problem is that I cannot get a cube list from some catalogs. For example, I can list cubes from the "OLAPTestCube" catalog, but I cannot do this from the "Adventure Works DW". It seems to me the problem appeared after upgrading SQL Server to SP2. What may cause this behavior?

Thank you,

I've got it. The solution was to call the OleDbConnection.ChangeDatabase method. It seems to me that GetOleDbSchema method works in scope of the current catalog.

Problems Using Temporary Tables

I am declaring a temp table in control flow via Execute SQL task. I then want to use that table as a source in a data task, keep it alive going back to control flow and use it as a destination in another data task following. I am having trouble just getting the first data flow to access that temp table.

In my Execute SQL task, I'm creating a simple temp table. After executing that task, I can head to the data task and change my OLE DB Source to point to that temp table, but I recieve an error about an invalid table name when I attempt to map columns or hit "OK."

Is there something else I need to do to use that temp table as a source or can I only reference it through SQL queries?

Thank you.

I have found them to be unreliable and problematic to use in SSIS. The meta-data issues during dev. for example are a real pain, and the difficulty of controlling the lifetime of the temp tables is another.

I am now using table variables where I previously used temp tables. Table variables are typically faster for small row counts but slower with greater row counts. Unfortunately, I am using them for greater row counts and my sql statement went from 5 1/2 minutes to 8 1/2 minutes for about 250,000 rows.

|||How would I go about doing that though? I would like to try it out even though I'm aware of the limited success.
|||

Well, you've been warned :)

It's my understanding that the only thing you can do to SSIS to specifically facilitate the use of temp tables is to set the "retain same connection" property to "true" for the connection that is used to create the temp table, and then use that connection for all references to the table.

Ken

|||

Although you can use temporary tables in tempdb (#MyTempTable) by setting RetainSameConnection, you might prefer creating a temporary table in an ordinary database (MyTempTable), without setting RetainSameConnection:

Create the table ahead of time. Truncate it before using it on each invocation.

Cheers/Kristian

|||

kenambrose wrote:

Well, you've been warned :)

It's my understanding that the only thing you can do to SSIS to specifically facilitate the use of temp tables is to set the "retain same connection" property to "true" for the connection that is used to create the temp table, and then use that connection for all references to the table.

Ken

Right, I've seen this answer before, and actually did this. It allowed me to see the temp table after executing the task (as #TempTable_0283817, or something similar) but when I select it, I recieve an error.

I will reply later with the specific error in a few hours when I can get to the SQL box.
|||Here is the error message that pops up when I try to map columns to the temp table I chose from the drop down.

TITLE: Microsoft Visual Studio

Error at Data Flow Task [OLE DB Destination [340]]: An OLE DB error has occurred. Error code: 0x80040E37.

Error at Data Flow Task [OLE DB Destination [340]]: Opening a rowset for "[dbo].[#TestTable_000000002219]" failed. Check that the object exists in the database.

ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC02020E8 (Microsoft.SqlServer.DTSPipelineWrap)

BUTTONS:

OK

|||

Yes that works of course but then the SSIS user context needs "create object" and "write" permissions on the source data server (unless you are willing to suffer the performance disaster of heterogenerous joins). Bad and/or impossible for most extraction scenarios.....

Ken

|||That's what the staging database is for in most extract scenarios, I find that even creating tempdb tables on the source systems are seldom OK.

Either way, by having an authorized user creating the table before SSIS runs, it's enough to give the SSIS context insert/delete rights.

Cheers/Kristian|||

Kristian Wedberg wrote:

That's what the staging database is for in most extract scenarios, I find that even creating tempdb tables on the source systems are seldom OK.

Either way, by having an authorized user creating the table before SSIS runs, it's enough to give the SSIS context insert/delete rights.

Cheers/Kristian

When you say "staging database" are you referring to an object in the SSIS package or is that just a general term?

Basically, what I want to do is run through the entire input file, validate it, and record any errors I find before inserting any DB records.
|||

In my use of temp tables and the OLE DB Source or Destination I have resorted to using the Advanced Editor where you can create the columns and mappings "by hand". An easy way to see how to set them up is to create a table in your dev db that looks like your temp table. Set up the source or destination using that table and map your columns. Then open up the Advanced Editor.

One thing I found with temp tables. Of course you know about the RetainSameConnection setting. I was using the same connection to create the temp table, fill it, then open it so that I could write to another table on the same connection. Where I write to another table on the same connection I had to create a new separate connection and use it to write to the other table. Otherwise it seemed the viability of the temp table was uncertain when I run a second parallel data flow task where that temp table would be used as well.

Put another way, I use one connection to create the temp table, fill it and read from it. I do not use that same connection to write or read from any other tables. This may not be effecient but it was the only way I could get things to work in parallel.

Hope this helps,
David Martin

|||We are loading data from several source systems simultaneously. Each system generates a set of identical files using the Raw Data File destination. All extracts share common load procedures that pick up the generated Raw Data files through an expression variable. It's a pretty slick way around temp tables and seems to work pretty fast. Would be nicer if there was a Recordset source and we didn't have to create the file on the server but for now there isn't one. You may want to look at that approach as a way around temporary tables.|||

Martin is absolutely right. Raw files are akin to temp tables.

He is correct that there is no recordset source (and with good reason) but you can build one yourself as explined here: http://blogs.conchango.com/jamiethomson/archive/2006/01/04/2540.aspx

You can't append to a recordset destination unfortunately. If you think that would be nice functionality to have then vote for it here: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=6831c0b9-ef74-4132-a137-b073a950d3fd

-Jamie

|||I meant "staging database" as a general term, i.e. it's often useful for the SSIS part to have access to a database where it can write and read arbitrary tables, even if that database is different from both your source database and your target database.|||

<< we didn't have to create the file on the server >>

That's fine if:

a: Your package runs local to your source data (very rare I expect)

or

b: You do not need to reference temp data structures in the queries that populate the raw data files.

But when you need the functionality of temporary data structures when working with queries that reference remote source data, it's either heterogenerous joins (death to performance) or table variables.

Ken

Problems Using Temporary Tables

I am declaring a temp table in control flow via Execute SQL task. I then want to use that table as a source in a data task, keep it alive going back to control flow and use it as a destination in another data task following. I am having trouble just getting the first data flow to access that temp table.

In my Execute SQL task, I'm creating a simple temp table. After executing that task, I can head to the data task and change my OLE DB Source to point to that temp table, but I recieve an error about an invalid table name when I attempt to map columns or hit "OK."

Is there something else I need to do to use that temp table as a source or can I only reference it through SQL queries?

Thank you.

I have found them to be unreliable and problematic to use in SSIS. The meta-data issues during dev. for example are a real pain, and the difficulty of controlling the lifetime of the temp tables is another.

I am now using table variables where I previously used temp tables. Table variables are typically faster for small row counts but slower with greater row counts. Unfortunately, I am using them for greater row counts and my sql statement went from 5 1/2 minutes to 8 1/2 minutes for about 250,000 rows.

|||How would I go about doing that though? I would like to try it out even though I'm aware of the limited success.|||

Well, you've been warned :)

It's my understanding that the only thing you can do to SSIS to specifically facilitate the use of temp tables is to set the "retain same connection" property to "true" for the connection that is used to create the temp table, and then use that connection for all references to the table.

Ken

|||

Although you can use temporary tables in tempdb (#MyTempTable) by setting RetainSameConnection, you might prefer creating a temporary table in an ordinary database (MyTempTable), without setting RetainSameConnection:

Create the table ahead of time. Truncate it before using it on each invocation.

Cheers/Kristian

|||

kenambrose wrote:

Well, you've been warned :)

It's my understanding that the only thing you can do to SSIS to specifically facilitate the use of temp tables is to set the "retain same connection" property to "true" for the connection that is used to create the temp table, and then use that connection for all references to the table.

Ken

Right, I've seen this answer before, and actually did this. It allowed me to see the temp table after executing the task (as #TempTable_0283817, or something similar) but when I select it, I recieve an error.

I will reply later with the specific error in a few hours when I can get to the SQL box.|||Here is the error message that pops up when I try to map columns to the temp table I chose from the drop down.

TITLE: Microsoft Visual Studio

Error at Data Flow Task [OLE DB Destination [340]]: An OLE DB error has occurred. Error code: 0x80040E37.

Error at Data Flow Task [OLE DB Destination [340]]: Opening a rowset for "[dbo].[#TestTable_000000002219]" failed. Check that the object exists in the database.

ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC02020E8 (Microsoft.SqlServer.DTSPipelineWrap)

BUTTONS:

OK|||

Yes that works of course but then the SSIS user context needs "create object" and "write" permissions on the source data server (unless you are willing to suffer the performance disaster of heterogenerous joins). Bad and/or impossible for most extraction scenarios.....

Ken

|||That's what the staging database is for in most extract scenarios, I find that even creating tempdb tables on the source systems are seldom OK.

Either way, by having an authorized user creating the table before SSIS runs, it's enough to give the SSIS context insert/delete rights.

Cheers/Kristian|||

Kristian Wedberg wrote:

That's what the staging database is for in most extract scenarios, I find that even creating tempdb tables on the source systems are seldom OK.

Either way, by having an authorized user creating the table before SSIS runs, it's enough to give the SSIS context insert/delete rights.

Cheers/Kristian

When you say "staging database" are you referring to an object in the SSIS package or is that just a general term?

Basically, what I want to do is run through the entire input file, validate it, and record any errors I find before inserting any DB records.|||

In my use of temp tables and the OLE DB Source or Destination I have resorted to using the Advanced Editor where you can create the columns and mappings "by hand". An easy way to see how to set them up is to create a table in your dev db that looks like your temp table. Set up the source or destination using that table and map your columns. Then open up the Advanced Editor.

One thing I found with temp tables. Of course you know about the RetainSameConnection setting. I was using the same connection to create the temp table, fill it, then open it so that I could write to another table on the same connection. Where I write to another table on the same connection I had to create a new separate connection and use it to write to the other table. Otherwise it seemed the viability of the temp table was uncertain when I run a second parallel data flow task where that temp table would be used as well.

Put another way, I use one connection to create the temp table, fill it and read from it. I do not use that same connection to write or read from any other tables. This may not be effecient but it was the only way I could get things to work in parallel.

Hope this helps,
David Martin

|||We are loading data from several source systems simultaneously. Each system generates a set of identical files using the Raw Data File destination. All extracts share common load procedures that pick up the generated Raw Data files through an expression variable. It's a pretty slick way around temp tables and seems to work pretty fast. Would be nicer if there was a Recordset source and we didn't have to create the file on the server but for now there isn't one. You may want to look at that approach as a way around temporary tables.|||

Martin is absolutely right. Raw files are akin to temp tables.

He is correct that there is no recordset source (and with good reason) but you can build one yourself as explined here: http://blogs.conchango.com/jamiethomson/archive/2006/01/04/2540.aspx

You can't append to a recordset destination unfortunately. If you think that would be nice functionality to have then vote for it here: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=6831c0b9-ef74-4132-a137-b073a950d3fd

-Jamie

|||I meant "staging database" as a general term, i.e. it's often useful for the SSIS part to have access to a database where it can write and read arbitrary tables, even if that database is different from both your source database and your target database.|||

<< we didn't have to create the file on the server >>

That's fine if:

a: Your package runs local to your source data (very rare I expect)

or

b: You do not need to reference temp data structures in the queries that populate the raw data files.

But when you need the functionality of temporary data structures when working with queries that reference remote source data, it's either heterogenerous joins (death to performance) or table variables.

Ken

Problems Using Temporary Tables

I am declaring a temp table in control flow via Execute SQL task. I then want to use that table as a source in a data task, keep it alive going back to control flow and use it as a destination in another data task following. I am having trouble just getting the first data flow to access that temp table.

In my Execute SQL task, I'm creating a simple temp table. After executing that task, I can head to the data task and change my OLE DB Source to point to that temp table, but I recieve an error about an invalid table name when I attempt to map columns or hit "OK."

Is there something else I need to do to use that temp table as a source or can I only reference it through SQL queries?

Thank you.

I have found them to be unreliable and problematic to use in SSIS. The meta-data issues during dev. for example are a real pain, and the difficulty of controlling the lifetime of the temp tables is another.

I am now using table variables where I previously used temp tables. Table variables are typically faster for small row counts but slower with greater row counts. Unfortunately, I am using them for greater row counts and my sql statement went from 5 1/2 minutes to 8 1/2 minutes for about 250,000 rows.

|||How would I go about doing that though? I would like to try it out even though I'm aware of the limited success.|||

Well, you've been warned :)

It's my understanding that the only thing you can do to SSIS to specifically facilitate the use of temp tables is to set the "retain same connection" property to "true" for the connection that is used to create the temp table, and then use that connection for all references to the table.

Ken

|||

Although you can use temporary tables in tempdb (#MyTempTable) by setting RetainSameConnection, you might prefer creating a temporary table in an ordinary database (MyTempTable), without setting RetainSameConnection:

Create the table ahead of time. Truncate it before using it on each invocation.

Cheers/Kristian

|||

kenambrose wrote:

Well, you've been warned :)

It's my understanding that the only thing you can do to SSIS to specifically facilitate the use of temp tables is to set the "retain same connection" property to "true" for the connection that is used to create the temp table, and then use that connection for all references to the table.

Ken

Right, I've seen this answer before, and actually did this. It allowed me to see the temp table after executing the task (as #TempTable_0283817, or something similar) but when I select it, I recieve an error.

I will reply later with the specific error in a few hours when I can get to the SQL box.|||Here is the error message that pops up when I try to map columns to the temp table I chose from the drop down.

TITLE: Microsoft Visual Studio

Error at Data Flow Task [OLE DB Destination [340]]: An OLE DB error has occurred. Error code: 0x80040E37.

Error at Data Flow Task [OLE DB Destination [340]]: Opening a rowset for "[dbo].[#TestTable_000000002219]" failed. Check that the object exists in the database.

ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC02020E8 (Microsoft.SqlServer.DTSPipelineWrap)

BUTTONS:

OK|||

Yes that works of course but then the SSIS user context needs "create object" and "write" permissions on the source data server (unless you are willing to suffer the performance disaster of heterogenerous joins). Bad and/or impossible for most extraction scenarios.....

Ken

|||That's what the staging database is for in most extract scenarios, I find that even creating tempdb tables on the source systems are seldom OK.

Either way, by having an authorized user creating the table before SSIS runs, it's enough to give the SSIS context insert/delete rights.

Cheers/Kristian|||

Kristian Wedberg wrote:

That's what the staging database is for in most extract scenarios, I find that even creating tempdb tables on the source systems are seldom OK.

Either way, by having an authorized user creating the table before SSIS runs, it's enough to give the SSIS context insert/delete rights.

Cheers/Kristian

When you say "staging database" are you referring to an object in the SSIS package or is that just a general term?

Basically, what I want to do is run through the entire input file, validate it, and record any errors I find before inserting any DB records.|||

In my use of temp tables and the OLE DB Source or Destination I have resorted to using the Advanced Editor where you can create the columns and mappings "by hand". An easy way to see how to set them up is to create a table in your dev db that looks like your temp table. Set up the source or destination using that table and map your columns. Then open up the Advanced Editor.

One thing I found with temp tables. Of course you know about the RetainSameConnection setting. I was using the same connection to create the temp table, fill it, then open it so that I could write to another table on the same connection. Where I write to another table on the same connection I had to create a new separate connection and use it to write to the other table. Otherwise it seemed the viability of the temp table was uncertain when I run a second parallel data flow task where that temp table would be used as well.

Put another way, I use one connection to create the temp table, fill it and read from it. I do not use that same connection to write or read from any other tables. This may not be effecient but it was the only way I could get things to work in parallel.

Hope this helps,
David Martin

|||We are loading data from several source systems simultaneously. Each system generates a set of identical files using the Raw Data File destination. All extracts share common load procedures that pick up the generated Raw Data files through an expression variable. It's a pretty slick way around temp tables and seems to work pretty fast. Would be nicer if there was a Recordset source and we didn't have to create the file on the server but for now there isn't one. You may want to look at that approach as a way around temporary tables.|||

Martin is absolutely right. Raw files are akin to temp tables.

He is correct that there is no recordset source (and with good reason) but you can build one yourself as explined here: http://blogs.conchango.com/jamiethomson/archive/2006/01/04/2540.aspx

You can't append to a recordset destination unfortunately. If you think that would be nice functionality to have then vote for it here: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=6831c0b9-ef74-4132-a137-b073a950d3fd

-Jamie

|||I meant "staging database" as a general term, i.e. it's often useful for the SSIS part to have access to a database where it can write and read arbitrary tables, even if that database is different from both your source database and your target database.|||

<< we didn't have to create the file on the server >>

That's fine if:

a: Your package runs local to your source data (very rare I expect)

or

b: You do not need to reference temp data structures in the queries that populate the raw data files.

But when you need the functionality of temporary data structures when working with queries that reference remote source data, it's either heterogenerous joins (death to performance) or table variables.

Ken