Loading...

rhino-tools-dev@googlegroups.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: [rhino-tools-dev] Re: Rhino.Etl good practice Wayne Douglas Tue Aug 17 10:00:53 2010

you must have sent that just after i sent mine:)

On Tue, Aug 17, 2010 at 5:35 PM, Jason Meckley <[EMAIL PROTECTED]>wrote:

> try use.transaction then. it's in there somewhere :)
>
> On Aug 17, 11:28 am, Wayne Douglas <[EMAIL PROTECTED]> wrote:
> > i got that :)
> >
> > is there a way to run a single sql command against a table before I start
> > processing? i did try to create a SetIdentityInsert
> OutputCommandOperation:
> >
> > [code]
> >
> > public class SetIdentityInsert : OutputCommandOperation
> >     {
> >         public enum Switch
> >         {
> >             On, Off
> >         }
> >
> >         public string TableName { get; set; }
> >         public Switch OnOff { get; set; }
> >
> >         public SetIdentityInsert(string connectionStringName) :
> > base(connectionStringName)
> >         {
> >         }
> >
> >         protected override void PrepareCommand(System.Data.IDbCommand
> cmd,
> > Rhino.Etl.Core.Row row)
> >         {
> >             cmd.CommandText = string.Format("SET IDENTITY_INSERT {0}
> {1}",
> > TableName, OnOff == Switch.On ? "On" : "Off");
> >         }
> >     }
> >
> > [/code]
> >
> > But that gets called for every row! Jason hinted at Use.Command()
> >
> > BUt I can't find that anywhere...
> >
> >
> >
> > On Tue, Aug 17, 2010 at 4:25 PM, Stephen Bohlen <[EMAIL PROTECTED]>
> wrote:
> > > BTW, this is the link to the T-SQL that you need to invoke:
> > >http://msdn.microsoft.com/en-us/library/ms188059.aspx
> >
> > > You set IDENTITY_INSERT to ON before you begin to insert rows for which
> you
> > > will be providing pre-computed PK values and then set it back to OFF
> after
> > > you are done inserting such rows into the table.
> >
> > > Steve Bohlen
> > > [EMAIL PROTECTED]
> > >http://blog.unhandled-exceptions.com
> > >http://twitter.com/sbohlen
> >
> > > On Tue, Aug 17, 2010 at 11:06 AM, Wayne Douglas <
> > > [EMAIL PROTECTED]> wrote:
> >
> > >> I dont see Use.Command in my API?
> >
> > >> On Tue, Aug 17, 2010 at 4:02 PM, Jason Meckley <
> [EMAIL PROTECTED]>wrote:
> >
> > >>> Use.Command
> >
> > >> --
> > >>  Cheers,
> >
> > >> w://
> >
> > >> --
> > >> You received this message because you are subscribed to the Google
> Groups
> > >> "Rhino Tools Dev" group.
> > >> To post to this group, send email to [EMAIL PROTECTED]
> .
> > >> To unsubscribe from this group, send email to
> > >> [EMAIL PROTECTED]<[EMAIL PROTECTED]>
> <[EMAIL PROTECTED]<[EMAIL PROTECTED]>
> >
> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/rhino-tools-dev?hl=en.
> >
> > >  --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Rhino Tools Dev" group.
> > > To post to this group, send email to [EMAIL PROTECTED]
> > > To unsubscribe from this group, send email to
> > > [EMAIL PROTECTED]<[EMAIL PROTECTED]>
> <[EMAIL PROTECTED]<[EMAIL PROTECTED]>
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/rhino-tools-dev?hl=en.
> >
> > --
> > Cheers,
> >
> > w://
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino Tools Dev" group.
> To post to this group, send email to [EMAIL PROTECTED]
> To unsubscribe from this group, send email to
> [EMAIL PROTECTED]<[EMAIL PROTECTED]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rhino-tools-dev?hl=en.
>
>


-- 
Cheers,

w://

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en.