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]<rhino-tools-dev%[email protected]> > <rhino-tools-dev%[email protected]<rhino-tools-dev%[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]<rhino-tools-dev%[email protected]> > <rhino-tools-dev%[email protected]<rhino-tools-dev%[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]<rhino-tools-dev%[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.
