Thank you Kevin Rafael
El jue., 6 sept. 2018 a las 12:03, Kevin J Cully (kjcully@cherokeega.com) escribió:
Take a look in the Downloads area for the Stru2PostgreSQL and Stru2MySQL_2 program. It should be pretty easy to modify those to get the structures generated.
http://leafe.com/download/stru2postgreSQL.PRG http://leafe.com/download/stru2mysql_2.prg
-Kevin
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Ted Roche Sent: Thursday, September 06, 2018 10:34 AM To: profox@leafe.com Subject: Re: alter column in sql server
Why not write the script in VFP and then cut-and-paste it into the SQL Server? Use AFIELDS to get the fieldlist, TEXTMERGE to write the script. Easy, peasy.
On Thu, Sep 6, 2018 at 10:28 AM Rafael Copquin rafael.copquin@gmail.com wrote:
I need to import a DBF table into SQL Server However, all the fields in the DBF table begin with the suffix ST (a previous programmer built the table in 1992, with the notion that all fields should have a specific suffix related to the table's purpose)
But I just want the sql server table to have all its fields without that suffix, ie: STACCT should become ACCT, STNAME should become NAME and so on,
The DBF table has 60 fields.
I would like to issue an ALTER TABLE statement directly in the SQL Server Management Studio to remove the ST suffix from all its fields.
But I have no idea on how to build a stored procedure with something similar to a DO WHILE loop in SQL Server, such that it would read a field name, remove the ST suffix and alter the name as desired. And then pass to the next field and do the same
In fact, I must do the same with all the DBF tables from the old DOS system, because I am converting it to a VFP9 app with a SQL Server back end.
Please show me a code snippet that would do that
Thank you in advance
Rafael Copquin
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]