Menu

#834 [mssql] Column rename works incorrectly resulting in glitched column names.

4.8.1
closed-works-for-me
nobody
None
5
2025-02-22
2022-03-03
AJas
No

From "Alter Table" menu, if you change the name of the column, saved name has square brackets included as part of the name.
When checked in SQL Management Studio it looked like:

[[NewColumn]]]

I've checked Adminer's history and found following code:

EXEC sp_rename '[Schema].[Table].[OldColumn]', '[NewColumn]', 'COLUMN';

According to documentation of Microsoft, square brackets not to be used for input parameters.
Correct statement is:

EXEC sp_rename 'Schema.Table.OldColumn', 'NewColumn', 'COLUMN';

Discussion

  • rtfm

    rtfm - 2023-02-14

    That's a deadly bug, as there is now way to rename the column to an acceptable name.

     
  • Jakub Vrána

    Jakub Vrána - 2025-02-22
    • status: open --> closed-works-for-me
     
  • Jakub Vrána

    Jakub Vrána - 2025-02-22

    I don't see how this could happen. https://github.com/vrana/adminer/commit/8ec7178

     
  • Jakub Vrána

    Jakub Vrána - 2025-02-22

    Oh, it was fixed by b8c5eec.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.