Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, June 20, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: New customizations to DB.. Now need help on SQL on how to move old data to new tables.
Mario
Posts: 6
 
New customizations to DB.. Now need help on SQL on how to move old data to new tables.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Oct 07 3:34 PM
This problem has been solved Thanks for all your help.

I am using SalesLogix (on SQL db ) and am about to push out a new sales engine I created. My only problem now is I have created a new table structure and need to move all the old data into the new tables. I am fairly sure I am going to have to write SQL statements for this import (don't have money for Scribe).

Here are the tables I currently have in a sort of tree view based on joins.
'OLD TABLE LAYOUT
-SALE
-Mailing (there is really only one record per sale) <-- I know it was pointless but...
-Repeat Mailing
-Shipping (Same with the mailing - only one shipping record)
-Tracking Info

'NEW TABLE LAYOUT
-SALE (which includes mailing and shipping now)
-Repeat Mailings
-Tracking Info

So you can see I consolidated the Shipping and Mailing tables into the Sale table. How would I even go about starting to write a script to Copy the data over to my new tables? I have also tried the importer.
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: New customizations to DB.. Now need help on SQL on how to move old data to new tables.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Oct 07 7:51 PM
We need a bit more info before we can help much on this.

If you are looking only for a fancy piece of SQL, you'll need to provide table structures, fields etc and intended data movements.

If you are looking for something more, please describe in more detail what you want. Do the data movements need to be synchronised out to remotes?

Phil
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: New customizations to DB.. Now need help on SQL on how to move old data to new tables.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Oct 07 12:31 AM
Mario,

It appears that you want to move existing rows from the Mailing and Shipping tables into the Sales table which has been expanded to included the appropriate columns. Does this need to sync?

Sync or not, I believe we can help you with the SQL. Since the Sales records exist in the remote database, so should the Mailing and Shipping records. Because they do, you can issue an update statement that utilizes this assumption to your benefit. Its not a "best practice" to assume that sibling rows exist but since you are rolling out a new feature, it is acceptable to make this one time leap of faith

Of course, I could be misunderstanding your needs. My apologies if that is the case...

Timmus
[Reply][Quote]
RJ Palombo
Posts: 43
 
Re: New customizations to DB.. Now need help on SQL on how to move old data to new tables.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Oct 07 9:43 AM
Hi I'm RJ, Mario and I are working on this together. I may have some more helpfull info to try and clear this up.

There will be some merging of certain fields. Some column names have changed and other new colums may be accepting up to 3 fields of data from the old table. Basically we just need an easy way to get started as I have no clue where to begin.

I tried using the Import tool in SLX yesterday and thought I was on the right path though when viewing the import it was trying to import Contacts and Accounts as well.

It seems my best way is to use SQL.
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: New customizations to DB.. Now need help on SQL on how to move old data to new tables.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Oct 07 10:38 AM
What version of SLX? Do you have remote users/offices?

Timmus
[Reply][Quote]
RJ Palombo
Posts: 43
 
Re: New customizations to DB.. Now need help on SQL on how to move old data to new tables.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Oct 07 10:40 AM
No remotes, so were good lol

We are migrating from 7 to 7.2 with new customizations.
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: New customizations to DB.. Now need help on SQL on how to move old data to new tables.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Oct 07 10:51 AM
Without remotes, the version of SLX becomes a moot point .

Here is an example of moving the Account field from the Account into its children Contact records. Hopefully the syntax example will help you figure out the rest.

UPDATE
C
SET
C.Account = A.Account
FROM
Contact C
INNER JOIN Account A ON A.AccountID = C.AccountID


For concatenating fields you will want to use + and Coalesce. Use Coalesce because Anything + NULL = NULL. I would also Trim the new values to remove leading and trailing spaces. For example:

UPDATE
T1
SET
T1.TargetColumn = LTRIM(RTRIM(LEFT(Coalesce(T2.SourceColumn1,'') + ' ' + Coalesce(T2.SourceColumn2,''), [Length of Target Column])))
FROM
TargetTable T1
INNER JOIN SourceTable T2 ON T2.ID = T1.ID


I hope this helps!

Timmus
[Reply][Quote]
RJ Palombo
Posts: 43
 
Re: New customizations to DB.. Now need help on SQL on how to move old data to new tables.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Oct 07 9:55 AM
This will work however it seems very tedious cause we have so much data in those tables. Would it be easier just to use a program and if so what would be good to use?
[Reply][Quote]
Darren Savery
Posts: 51
 
Re: New customizations to DB.. Now need help on SQL on how to move old data to new tables.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Oct 07 9:29 AM
If you can afford it, I would highly recommend Scribe Insight. I know it's a decent chunk of money but it's well worth it.

We initially got it for data migration but are now using it multiple integration processes between our e-commerce system/ERP system/website and of course SLX. It's great to know it's handling all of the data transactions, allowing me to get on with better things.
[Reply][Quote]
Kevin Henry
Posts: 7
 
Re: New customizations to DB.. Now need help on SQL on how to move old data to new tables.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Oct 07 2:53 PM
In the past I have made DTS (Data Transformation Services) packages to move the data between old and new tables. They give you a little more flexibility if the data needs to be manipulated in some way. Also you can create a lookup to call the Saleslogix stored procedure to create new ID's for your tables. If you are using SQL 2005 the name DTS changed to Integration Services.
[Reply][Quote]
Mario
Posts: 6
 
Re: New customizations to DB.. Now need help on SQL on how to move old data to new tables.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Oct 07 3:05 PM
Thanks for all your help this problem has been sloved.
Thanks
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/20/2025 4:43:38 PM