在ASP.NET中重命名SQL TABLE [英] RENAME SQL TABLE IN ASP.NET
本文介绍了在ASP.NET中重命名SQL TABLE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望能够通过在asp.net中的文本框输入中指定表名来重命名sql数据库表。
下面是我的查询语句但是它给出了错误(错误消息:语法附近不正确RENAME)
ALTER TABLE+ tbxoldname.Text +RENAME TO+ tbxnew.Text +
请帮帮我。
I want to be able to rename sql database table by specifying the table name from textbox input in asp.net.
below is my query statement but it gives error (error message : Incorrect syntax near RENAME)
"ALTER TABLE" + tbxoldname.Text + " RENAME TO" + tbxnew.Text + ""
please help me out.
推荐答案
在 RENAME TO
之后添加空格,同时阅读: http://stackoverflow.com/questions/886786/ how-do-i-rename-the-table-name-using-sql-query [ ^ ]
Add a space after RENAME TO
, read this also : http://stackoverflow.com/questions/886786/how-do-i-rename-the-table-name-using-sql-query[^]
甚至在Alter Table之后添加空格,即是,
Alter Table+ tbxoldname.Text +RENAME TO+ tbxnew.Text;
Even Add Space afer "Alter Table", that is,
"Alter Table "+ tbxoldname.Text + " RENAME TO " + tbxnew.Text;
这篇关于在ASP.NET中重命名SQL TABLE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文