Request features

Coordinator
Jun 17, 2008 at 7:01 AM
Edited Jun 17, 2008 at 7:03 AM
Request features here
Oct 3, 2008 at 2:50 PM
Hi,
thank you for a great tool.

Just a suggestion, rather than doing an if exists prior to an update, why not just do the update? for example:

Update table
set column = new_value
where idcolumn = id

if @@rowcount = 0 -- no rows updated, so need to do an insert
insert into...
Coordinator
Oct 6, 2008 at 1:59 PM
Edited Oct 6, 2008 at 2:01 PM
Hi,

Thanks for your feedback. I guess the original idea was to avoid unnecessary updates where possible by using the exists clause, therefore keeping the size of the log file down. However I can see how this could work with your suggestion as well. It's certainly another way of achieving the same thing. One thing I thought of was allowing users to define their own templates for updating and inserting content. I may develop this further in the future.

Mike
Oct 28, 2008 at 10:19 AM
Hi Mike,

Another question I'm afraid!  Is there a way of excluding Identity columns from the generated code?  I don't want to update identity columns based on the primary key column as these may differ across databases.  eg

DB                       ID                              PK                                Desc
test                          1                               ABC                           Value1
dev                            1                               DEF                          Value2
dev                           2                               ABC                         

As you can see, I would be inserting/ updating on the basis of the PK but the code at the mo would try and update the value of the ID column, which I don't want.

Thanks again

GMB
Coordinator
May 18, 2010 at 3:04 PM
Hi GMB, Sorry for the VERY late reply, I originally missed your question and only just spotted it. I've done this in a number of iterations previously and it's fairly straight forward to implement. You just need to update the SqlScripter class and update the GetPrimaryKeys() implementation, as well as the HasPrimaryKey property to some point other values. I might revive the project and make it a configuration setting in the future. I'd also like to build a UI to it if I get time. Thanks, Mike