asked on
ASKER
alter table tablename change oldname newname varchar (10)
Set @SQL = 'Alter table ''' + @table_name + ''' change ''' + @column_name + ''' ''' + @column_name_new + ' ''varchar (250)'''
ASKER
ASKER
SQL (Structured Query Language) is designed to be used in conjunction with relational database products as of a means of working with sets of data. SQL consists of data definition, data manipulation, and procedural elements. Its scope includes data insert, query, update and delete, schema creation and modification, and data access control.
TRUSTED BY
don't believe so, not in raw SQL. There might be add-ons or IDEs that do this sort of thing but I'm not familiar with any that would do this. (I'm not familiar with many I hasten to add.)
here's an idea for discussion purposes...
There's a way in MySQL to dump objects etc to a text file.
recent example
open that (could be big) file into a worthy UTF8 editor
(I use notepad++ it's good and free, you may already have one, I'll use this as an example)
before starting make sure it is setup to use UTF8 by default.
then with care
Start by searching for things like: `cust new`
(in n++ you can "list all occurrences in current file" and scan that)
once you identify that this isn't going to cause pain later "good to go" replace `cust new` with `custnew`
this can be done one at a time or - if certain - replace all
save versions frequently
proceed with this until you believe it's worth testing.
& for testing you may want to do it in "chunks" rather than "all at once"
You could certainly look at the feasibility of this without committing yourself to it i.e. try a few edits and see what problems it might cause.