Showing posts with label distribution. Show all posts
Showing posts with label distribution. Show all posts

Tuesday, March 27, 2012

get % distribution of invalid data?

We've got the requirement where we need to load data (usually dirty of course) from a flat file, and for every column, if the value is invalid, I'm putting a -1 in the field as it flows through the data stream - no problem. (I'm converting all invalids to -1 so they'll go into my eventual int column)

My question though is - at the end of the data flow, is there any smooth way to capture the % invalid values in each column. An example: If my table is as follows...where the # 1 signifies "clean data" and -1 signifies dirty.

col1 col2 col3 col4

1 1 1 1

1 -1 -1 1

-1 1 -1 1

-1 1 -1 1

I would want my % distribution query/ssis result to return:

col1 col2 col3 col4

.5 .25 .75 0

I do not want to do a select/ssis process for each column. Any way to do this all in one shot?

You could write a script component to track the number of good and bad values, and output them to an asynchronous output. Or execute a SQL statement after the data flow to get the statistics.|||

jwelch wrote:

execute a SQL statement after the data flow to get the statistics.

That's what I would try first....just to keep it simpler

Wednesday, March 7, 2012

Generate sp_addsubscriber

Is there any way to generate a script for the subscribers of a publication? I
know you can generate scripts for the publication, the distribution database,
the replication jobs, but have not found anyplace where you can have EM
generate the SP_ADDSUBSCRIBER script.
Any help would be appreciated.
Thanks!
Add one subscriber, and then script out your publication. The required
commands will be at the end.
To add a new subscriber use sp_addsubscriber. You can't automatically
generate a new script for this, you have to manually add it.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"A. Robinson" <ARobinson@.discussions.microsoft.com> wrote in message
news:78C831D3-521B-49DF-9AB0-6301EEC5D97C@.microsoft.com...
> Is there any way to generate a script for the subscribers of a
> publication? I
> know you can generate scripts for the publication, the distribution
> database,
> the replication jobs, but have not found anyplace where you can have EM
> generate the SP_ADDSUBSCRIBER script.
> Any help would be appreciated.
> Thanks!
|||Hilary:
Would you have an example of an sp_addsubscriber stored procedure call? I've
tried to capture the SQL via Profiler, but because of the password coulmn,
SQL Server masks the output...
Thanks You!!
"Hilary Cotter" wrote:

> Add one subscriber, and then script out your publication. The required
> commands will be at the end.
> To add a new subscriber use sp_addsubscriber. You can't automatically
> generate a new script for this, you have to manually add it.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "A. Robinson" <ARobinson@.discussions.microsoft.com> wrote in message
> news:78C831D3-521B-49DF-9AB0-6301EEC5D97C@.microsoft.com...
>
>