首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

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

2012-09-23 
在SQL中随机建立表的问题。我在SQL中想要根据情况不同,随机的建立不同列的表,怎么老是出错?declare @string

在SQL中随机建立表的问题。
我在SQL中想要根据情况不同,随机的建立不同列的表,怎么老是出错?

declare @stringx varchar(1000)

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

execute(@stringx)



[解决办法]
是不是你的@stringx 的长度不够 导致的 你的sql语句写的没有问题
[解决办法]

SQL code
-- 这样试试declare @stringx nvarchar(max);set @stringx=N'create table #temp (field01 int,field02 int ……)';execute(@stringx)
[解决办法]
出什么错?
是不是#temp已经存在?

热点排行