| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 538 人关注过本帖
标题:.sql文件问题
只看楼主 加入收藏
lyffly
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-7-10
收藏
 问题点数:0 回复次数:2 
.sql文件问题

我有一个.sql文件,该怎么导入SQL SERVER数据库?内容是

CREATE TABLE [Info] (
[ID] [bigint] IDENTITY (1, 1) NOT NULL ,
[areaId] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[townId] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[schoolId] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[classroomId] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[classroomName] [varchar] (2000) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[description] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
[seats] [int] NULL ,
[hasBeenExported] [tinyint] NULL
)
GO

/* 修改数据表 userInfo_student */
alter table userInfo_student
add item_multiSel [real] NULL
alter table userInfo_student
add item_descript [real] NULL
alter table userInfo_student
add item_discuss [real] NULL
alter table userInfo_student
add icc_item_multiSel [tinyint] NULL
alter table userInfo_student
add icc_item_descript [tinyint] NULL
alter table userInfo_student
add icc_item_discuss [tinyint] NULL
GO

/* 存储过程 */
CREATE proc sp_saveAnswer_multisel
@userId varchar(50),
@paperId bigint,
@itemId bigint,
@itemtype varchar(50),
@answer varchar(50),
@rt tinyint output
as
declare @reactCount int
select @rt =0
select @reactCount = (select count(*) as c from stuReactDetail where userId = @userId and paperId = @paperId and itemId = @itemId and itemType = @itemtype)
if (@reactCount > 0)
begin
update stuReactDetail set
stuReact = @answer
where
userId = @userId and paperId = @paperId and
itemId = @itemId and itemType = @itemtype
select @rt = 1
end
else
begin
insert into stuReactDetail (userId, paperId, itemId, itemType, stuReact) values
(@userId, @paperId, @itemId, @itemtype, @answer)
select @rt = 2
-- if (@itemtype = 'item_singlesel')
update userinfo_student set icc_item_singlesel = icc_item_singlesel + 1 where cardId = @userId
-- if (@itemtype = 'item_judge')
-- update userinfo_student set icc_item_judge = icc_item_judge + 1 where cardId = @userId
end
GO

搜索更多相关主题的帖子: sql 文件 
2007-07-10 21:53
棉花糖ONE
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:32
帖 子:2987
专家分:0
注 册:2006-7-13
收藏
得分:0 

直接拷贝到查询分析器运行下


26403021 sql群 博客 blog./user15/81152/index.shtml
2007-07-11 08:41
lyffly
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-7-10
收藏
得分:0 
回复:(lyffly).sql文件问题

谢谢!问题已经解决.

2007-07-11 09:04
快速回复:.sql文件问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027050 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved