create table tablename(...) 怎么使tablename是一个参数?

比如,创建一个richEdit控件,使tablename关联到richEdit.Text?
但是我用的时候sql间的表名总是参数名?
---------------------------------------------------------------

用动态SQL语句,
execute ('create table '+tablename+'(...) ')
---------------------------------------------------------------

declare @c_tmp varchar(255)
select @c_tmp = 'create table '+@tablename+'(...) '
execute(@c_tmp)
---------------------------------------------------------------

agree

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus