Deployment Data with a timestamp column (failed)

Author Message
 Posted 8/28/2012 5:17:15 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 11/4/2014 3:08:48 AM
Posts: 10, Visits: 81
Hello,

i would like to use a Deployment Data on DDT,
to copy a reference table source on destination table.

But i have timestamp column and i can't choose each column i want .

Have you an idea to force the export ?
Post #31406
Add to Twitter Add to Facebook
 Posted 8/28/2012 6:17:45 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/7/2018 2:37:04 AM
Posts: 193, Visits: 9,066
Salut Tony,

je ne vois que la possibilité de supprimer cette colonne TimeStamp avant le déploiement (avec un script pre-Deploy dans ton projet DDT), et de la recréer après avoir déployé les data (script post-deploy).

Attention, je n'ai pas testé!

Au fait, si tu as essayé avec la colonne Timestamp, est-ce que tu as levé une erreur? si oui, laquelle?




Hi Tony,

I can see only one way in this case: delete this Timestamp column before data deployment, using a pre-deploy script in your DDT project, and create it after data deployment (with a post-deply script).

Be aware I've not tested!

BTW, it you attempt to deploy with the timestamp column, did you throw an error? if yes, wich one?
Post #31407
Add to Twitter Add to Facebook
 Posted 8/28/2012 9:33:29 AM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 2/26/2021 10:30:31 PM
Posts: 1,920, Visits: 21,166
Hi guys.

Check the thread from this post and see if it helps:

http://forum.strataframe.net/FindPost13440.aspx

Post #31408
Add to Twitter Add to Facebook
 Posted 8/28/2012 11:16:09 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/7/2018 2:37:04 AM
Posts: 193, Visits: 9,066
Hi Ivan,

do you mean that the real issue could be in some related FK, and not in the timestamp column?
Post #31411
Add to Twitter Add to Facebook
 Posted 8/29/2012 4:24:29 AM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 2/26/2021 10:30:31 PM
Posts: 1,920, Visits: 21,166
According to those posts, there could be an issue if the TimeStamp were a field in a table being deployed which had children related to it.
Have a look at the 2 last posts from George and Trent.
Post #31420
Add to Twitter Add to Facebook
 Posted 8/30/2012 5:07:35 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 11/23/2016 4:33:03 AM
Posts: 96, Visits: 805
Hello Ivan

i work with tony in same the entreprise, you think that Trent give us a good solution ?

Cause i don't understand the best issues to resolve our problem ?

We want to insert in all table "reference" , the good ID pk and the text.

We have 2 way :

1- Use the deployment data, if we get to resolve timestam column
2- Or use the aspx with bo to insert the good value in the table,
but with stratra we can't : "Set indentity_insert ON" before and the same session.

thanks
olivier,


==============================================
Asp.net C# - Strataframe - telerik
==============================================
Post #31427
Add to Twitter Add to Facebook
 Posted 8/30/2012 5:41:18 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/7/2018 2:37:04 AM
Posts: 193, Visits: 9,066
Hi Olivier,

for the 1st way, let's wait for a solution by Ivan or Trent, I've not yet experimented this way

But for the 2nd way, for sure you can SET IDENTITY_INSERT in the same connection as your sql command from within a BO. In your sqlcommand text, you begin by your SET Identiyt..., don't forget to put a semicolumn ( ; ) and then all the stuff you nedd (some update sql command in your case). And you send all by an ExecuteNonQuery method.

You could try a 3rd way, write a Store Procedure on your SQL server, accepting a table as parameter, the SP will do the job with a MERGE (parameter will hold the old value and the corresponding new value)

another way would be a dedicated table, with some trigger on update.




Salut Olivier,

en ce qui concerne la première solution, attendons les réponses de Ivan et de Trent, je n'ai pas fait de tests dans ce sens.

Mais en ce qui concerne ta 2ème piste, alors bien sur que oui, tu peux passer un SET IDENTITY_INSERT dans la même connexion qu'une commande SQL depuis un BO. Dans le texte de ton SqlCommand, tu commence par définir ton SET identity_ etc.., et tu conclus ta ligne par un point virgule ( ; ), ensuite tu rajoute tout ce que tu veux faire (des commandes update dans ton cas). Et tu envoies le tout par une méthode ExecuteNonQuery.

tu peux aussi explorer une 3ème possibilité, écrire une procédure stockée SQL qui accepterait une table en paramètre, la SP ferait le boulot avec un MERGE (la table en paramètre contiendrait les valeurs anciennes et les nouvelles leur correspondant)

et il y a aussi une autre soluce, qui serait une table dédiée, avec un trigger on update.
Post #31428
Add to Twitter Add to Facebook
 Posted 8/30/2012 10:00:52 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 11/23/2016 4:33:03 AM
Posts: 96, Visits: 805
Thanks Michel

I don't understand the solution from trent and Ivan.

So, if for the strata 2.0, they can add the functionnality in the session (Set_identity_insert) with a property in BO, it ll be great.

I test to start a sql command with ExecutenonQuery and it's work.

But it's more easy with Bo, cause we can find if the Pk exists or not with seekprimarykey
and insert or update my text in the table.

So if i use Sql, i must to check with Strata and Sql. It's dirty code ? didn't it ?


ps : why i don't receive a mail, when you reply on my question ? it's work on your side ?

thanks
olivier


==============================================
Asp.net C# - Strataframe - telerik
==============================================
Post #31429
Add to Twitter Add to Facebook
 Posted 8/31/2012 12:50:12 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 11/7/2018 2:37:04 AM
Posts: 193, Visits: 9,066
Olivier,

dans les options du sujet (Topic Options) en haut à droite du message, tu t'abonnes aux réponses si tu le demandes.

Pour le ExecuteNonQuery, tu peux utiliser celui qui est "embarqué" dans le BO par la classe BusinessLayer. Comme ça tu peux écrire ta méthode (ou fonction) dans ta classe de base de BO, en utilisant le SeekToPrimaryKey, et en traitant tes insert et update de ton executenonquery à cet endroit.

Mais je pense que le code le plus propre, c'est une SP sur SQL à laquelle tu envoies une table en paramètre, et tu envoies cette table depuis une méthode écrite dans ta classe de base de BO. Comme ça il y a juste la table paramètre qui est traitée coté client, et le travail sur les données elles-mêmes est effectué coté serveur.




Olivier

If you want, you may susbcript to an immediate notification in the Topic Options (top right).

For the ExecuteNonQuery, you may use this which is "embedded" in the BO through the BusinessLayer class. Then you write your method (or function) in your BO base class using the SeekToPrimaryKey, and you'll manage your insert and update in your executenonquery here.

But IMHO, it is cleaner to write a SQL SP receiving a table as a parameter. the parameter is sent to the SP from a method you write in your BO base class. On client side you'll have only the treatment of the table as parameter, and the full real job on data is done on server side.
Post #31430
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.