Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ProperCase SQL using database metadata
#1
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
Code:
Copy      Help
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


Forum Jump:


Users browsing this thread: 1 Guest(s)