当前位置: 代码迷 >> Sql Server >> 在SQL中随机建立表的有关问题
  详细解决方案

在SQL中随机建立表的有关问题

热度:70   发布时间:2016-04-27 11:19:10.0
在SQL中随机建立表的问题。
我在SQL中想要根据情况不同,随机的建立不同列的表,怎么老是出错?

declare @stringx varchar(1000)

set @stringx='create table #temp (field01 int,field02 int ……)'

execute(@stringx)



------解决方案--------------------
[email protected] 的长度不够 导致的 你的sql语句写的没有问题
------解决方案--------------------
SQL code
-- 这样试试declare @stringx nvarchar(max);set @stringx=N'create table #temp (field01 int,field02 int ……)';execute(@stringx)
------解决方案--------------------
出什么错?
是不是#temp已经存在?
  相关解决方案