Showing posts with label task. Show all posts
Showing posts with label task. Show all posts

Friday, March 30, 2012

Regarding DTS

Hi,

I want to copy the data from Oracle table to excel file in DTS packages.
I have used transformation task, but it is asking for table but excel is a file.
please any body could tell em about this?

Thanks and Regards,
Purushotham,Use connection first.
In connection you will be able to find Excel files or Oracle.

Good Luck.

Monday, March 26, 2012

refresh SSIS pkg to get the change

Hi, all,

How do you refresh a SSIS pkg to get the latest table schema change?

I have this data flow task that will load data from a flat file into a table.

I got a Warning: Truncation may occur due to retrieving data from database column "txtSNumber" with a length of 50 to data flow column "txtSNumber" with a length of 20.

Then I went into Management Studio and changed the column size.
Now in my dev BID I got next:
[SQL Server 05[82]] Warning: The external metadata column collection is out of synchronization with the data source columns. The column "txt..." needs to be updated in the external metadata column collection.

I think this means my change on the table did not get into my ssis, and I could not find a way to refresh.

Thanks!It actually means the opposite. The change was detected by SSIS and it needs to update the metadata associated with the table in the data flow task (i.e. change the column width from 20 to 50). It does not automatically do this without some user interaction (hitting "OK") since you may need to know about the change and correct it if it is incorrect.|||

Thanks for the reply.

I am not looking for the automatic way to refresh if there is one.

I want to manually start the process in my design environment and click the OK as you have suggested, but I could not find out how or from where to make it happen.

I have tried right click on my .dtsx and select reload with upgrade, but that is not it. Where can tap into the megadata?

|||Look at the components in your data flow that have the yellow triangle with an exclamation mark in it. Start there by double clicking on that component to refresh the metadata.|||Double click on the yellow mark is the trick! Thanks!

Friday, March 23, 2012

Refresh data from production to development

Hi all, I've been assigned a task of refreshing data from the
production env to development env.

what i got is a backup file of a db in the prod env, i now need to
make that into the development env.

I can restore it to the dev env no problem, but the warnings i got are
that the tables owner in prod and dev env need to be different, that
is, owner is A in prod env and owner is B in dev env.

So I need to:
1) restore the db in dev env
2) change table owner from A to B
3) change related triggers
4) change related views

Can anyone suggest me an approach that is most efficient?

Thanks a lot.Hiya Bosco,

I'd create a script that dynamically builds a "sp_changeobjectowner"
statement for all objects that user A owns.. It'll simlify the steps
to this

1. Restore db in dev
2. Create and run permissions script

Syntax is as follows:

EXEC sp_changeobjectowner '<table_name>', 'B'|||Bosco

Here are some aricles that should help you.

http://www.support.microsoft.com/?id=314546 Moving DB's between Servers

http://www.support.microsoft.com/?id=224071 Moving SQL Server Databases
to a New Location with Detach/Attach

http://support.microsoft.com/?id=221465 Using WITH MOVE in a Restore

http://www.support.microsoft.com/?id=246133 How To Transfer Logins and
Passwords Between SQL Servers

http://www.support.microsoft.com/?id=298897 Mapping Logins & SIDs after
a Restore

http://www.dbmaint.com/SyncSqlLogins.asp Utility to map logins to users

http://www.support.microsoft.com/?id=168001 User Logon and/or
Permission Errors After Restoring Dump

http://www.support.microsoft.com/?id=240872 How to Resolve Permission
Issues When a Database Is Moved Between SQL Servers

Hope this helps

John

Monday, March 12, 2012

Referencing a CLR DLL in a Custom Task

Is there a way you can reference a prebuilt CLR function in a custom dataflow task?

The CLR and the custom dataflow task are one in the same. The reason that I'm designing the custom task is that I find that it's time consuming to make a call to the database to retrieve a function to work on something that's already in memory. Also, another reason is that if the code needs to be updated, it doesn't have to be done in 2 places allowing for less confusion.

I tried adding a reference to the CLR function in my SSIS dataflow task, but when I try running it in SSIS, I get the error saying it cannot use a SQL CLR defined task in the package which I believe is due to this reference in the CLR code:

[Microsoft.SqlServer.Server.SqlFunction]
public static string toCase(string text, string caseType)

Is there a way to circumvent the [...SqlFunction] line of code when the DLL is referenced by an SSIS dataflow task, or do I just have to deal with having 2 copies of the same code?

Thanks in advance!

Nevermind, I guess the only way to do it is to separate the function as a core class and then create a CLR wrapper and then an SSIS wrapper.

Reference variables with identical names but different scopes

Hi,
I have a script task that can "see" 2 variables with identical names. The only difference is that they are scoped differently.

As far as I know my script task will use the most locally scoped variable by default. Is there any way to make it use the other one?

-JamieHi it seems as tho I'm going to get much reply so I've submitted this at betaplace: 708844227

-Jamie|||

Give people a chance, you only posted a few hours ago! Saying that from all we have learnt about the “precedence” behaviour of variables and scope, I certainly don’t think it can be done. Did you suggest a fully qualified syntax to access higher variables? I’d quite like that, but not a big deal for me (yet).

|||

DarrenSQLIS wrote:

Give people a chance, you only posted a few hours ago! Saying that from all we have learnt about the “precedence” behaviour of variables and scope, I certainly don’t think it can be done. Did you suggest a fully qualified syntax to access higher variables? I’d quite like that, but not a big deal for me (yet).

Yeah I know, sorry, but when I said I didn't think i was going to get a reply I meant because I'm convinced this can't be done so I wanted to get the bug in ASAP. Also Doug contacted me offline and as-near-as-makes-no-difference confirmed my suspicions.

A fully qualified syntax is what I had in mind but I didn't suggest it - better let the dev team come up with their own ideas I reckon. Besides, in my scenario that wouldn't work because it could be akin to hardcoding the scope and I want a generic event handler that works for all containers, but basically ignores the "most local" scope. Does that make sense?
A fully qualified syntax is a good idea though.

The more and more I look at this though the more I'm becoming convinced that this system variable that is scoped to the task in the event handler is something new in June CTP. I'm pretty sure that before then:

-there was only ever one occurence of System::ContainerStartTime
-it contained the start time of the container raising the event
-and it was scoped to the event handler

That is EXACTLY the same as System::SourceName, System::SourceDescription, System::SourceID, etc...

-Jamie

Friday, March 9, 2012

Reference for SSIS "C-like" script needed

Consider the Conditional Split task. I can use a C-like language to create statements such as

Ltrim ([Col1] =”A”) ||Ltrim([Col1] =”B”)

This sure ain’t VB-like and the list of functions in the upper right-hand pane of the task(“expression editor”) does not help me construct such statements.

Where is the reference manual describing this language?

TIA,

Barkingdog

P.S. I have found fragments in BOL but the info does not seem complete and the BOL topic fragmentation impedes learning.

P.P.S.Why MS uses this language instead of VB.NET, which they use in their Script tasks, is beyond me.

A few hours of looking around gave me this pointer:

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

|||

>P.P.S. Why MS uses this language instead of VB.NET, which they use in their Script tasks, is beyond me.

One of the key reasons is that languages such as VB.Net, or SQL for that matter, include flow of control and procedural constructs which would be unsuitable for use in an expression language. So does C, of course, but it is easier to create a subset of the C grammar without those constructs.

I used to worry that the expression syntax would be a real problem for folks, but I have to admit that (a) most people appear to be using very simple expressions and get the hang of it pretty quickly and (b) those that do need complex expressions are on the whole able to get to grips with the syntax, with the help of the reference you found.

I'd be interested to hear other opinions, of course ...

Donald

Wednesday, March 7, 2012

Re-Execution of For each Loop Container

I have a For each loop container and inside the same a group of text files are loading to a table using bulk insert task.If there are duplicate files i dont wish to load it into the table. Duplicate check can be done by script task but how do i skip the files and repeat the for loop for the next files.

That means i want to skip some files and load the other files in a for loop.
How do i do that.

Can anybody please help me.

So here is what you do

Loop container has inside a Script task that checks for a duplicate file

and a BULK INSERT task that does what it says on the tin.

The script task and the BI task are joined by workflow.

Declare a variable say something like FileAlreadyThere of type DT_BOOL

(boolean)

In the script task if the file is already there set the value of this

variable to TRUE and if not then FALSE.

The workflow now between the two tasks should be based on an expression

as well as outcome so have a look at this article and you want to set

your expression to something like

@.FileAlreadyThere == FALSE

http://wiki.sqlis.com/default.aspx/SQLISWiki/LogicalOrExample.html

Allan

"Raj Amb@.discussions.microsoft.com"

wrote in message

news:1b962d72-8a6d-4b3c-bdab-e86bfda3270b@.discussions.microsoft.com:

> I have a For each loop container and inside the same a group of text

> files are loading to a table using bulk insert task.If there are

> duplicate files i dont wish to load it into the table. Duplicate check

> can be done by script task but how do i skip the files and repeat the

> for loop for the next files.

>

> That means i want to skip some files and load the other files in a for

> loop.

> How do i do that.

>

> Can anybody please help me.|||Thank you very much for your post. I would like to know one more thing that in the same for loop if the bulk load of one file fails the whole package(For loop) fails.

but i want to continue/iterate the for loop till the last file , how do i do that.|||

Raj Amb wrote:

Thank you very much for your post. I would like to know one more thing that in the same for loop if the bulk load of one file fails the whole package(For loop) fails.

but i want to continue/iterate the for loop till the last file , how do i do that.


This is controlled by two properties:
1) FailPackageOnFailure on each task or container - set it to false to ignore errors.
2) Also, each task and container have MaxErrorCount - increase it to desired value.