Deployment Data with a timestamp column (failed)


Author
Message
Tony Charpentier
Tony Charpentier
StrataFrame Beginner (44 reputation)StrataFrame Beginner (44 reputation)StrataFrame Beginner (44 reputation)StrataFrame Beginner (44 reputation)StrataFrame Beginner (44 reputation)StrataFrame Beginner (44 reputation)StrataFrame Beginner (44 reputation)StrataFrame Beginner (44 reputation)StrataFrame Beginner (44 reputation)
Group: StrataFrame Users
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 ?
Michel Levy
Michel Levy
Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
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?
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi guys.

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

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


Michel Levy
Michel Levy
Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
Hi Ivan,

do you mean that the real issue could be in some related FK, and not in the timestamp column?
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)Strategic Support Team Member (4.4K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
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.
Olivier
Olivier
StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)
Group: StrataFrame Users
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
==============================================
Michel Levy
Michel Levy
Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
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.
Olivier
Olivier
StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)StrataFrame User (390 reputation)
Group: StrataFrame Users
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
==============================================
Michel Levy
Michel Levy
Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)Advanced StrataFrame User (559 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
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.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search