12-28-2010, 08:18 PM
This macro will propercase all table, column, and object names in your selected sql statement by comparing them to the names in your database.
Macro ProperCase SQL Identifiers
Macro ProperCase SQL Identifiers
str s.getsel
Database db.Open("Provider=sqloledb;Data Source=MySqlHost;Initial Catalog=MySqlDb;Integrated Security=SSPI;")
ARRAY(str) a
int r
db.QueryArr("select distinct name from (select name from sys.objects where is_ms_shipped=0 union all select name from sys.columns) as x order by 1" a)
for r 0 a.len(2)
,s.replacerx(a[0 r],a[0 r],3)
s.setsel