求教sql语句问题
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了求教sql语句问题相关的知识,希望对你有一定的参考价值。
我在sqlserver2000查询分析器中输入以下语句
declare @name varchar(20)
set @name = 'roger'
运行后给出提示说“必须声明变量@name”,我若没声明变量那第一条语句干嘛吃了?求教!
这两个语言你都选择上再点“运行”
要么就不要选择任何一句
SQL语言,数据库基础电子资料:
SQL语法大全中文版
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=148128
SQL语言案头完全参考手册
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=146159
SQL - A Practical Introduction
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=148095
O'Reilly SQL Tuning
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=159156
O'Reilly The Art of SQL
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=163611
数据库综合资料库
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=146238
数据库设计指南
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=148082
Wrox Beginning Database Design
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=145206
SQL Puzzles and Answers
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=160834
SQL Queries for Mere Mortals
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=162978
SQL Puzzles and Answers
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=160834
Apress出版 The Berkeley DB Book
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=168290
数据库系统概论 浙江大学张军教授主讲(全32讲)
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=154299
MS SQL Server电子资料:
Transact-SQL Cookbook
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=163150
SQL Server 2005宝典
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=149644
Microsoft SQL Server 2005完全参考
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152872
O'Reilly Learning SQL on SQL Server 2005
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=163464
Beginning SQL Server 2005 Programming
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=153216
Pro SQL Server 2005 High Availability
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=162981
Beginning SQL Server 2005 Administration
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152863
SQL Server 2005 Unleashed
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152874
Pro SQL Server 2005
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152325
A Developer's Guide to SQL Server 2005
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=145565
Pro T-SQL 2005 Programmer's Guide
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=154245
Beginning Transact-SQL with SQL Server 2000 and 2005
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152868
SQL Server 2005报表服务
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=148376
Wrox Professional SQL Server 2005 Programming
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=151270
Scaling Out SQL Server 2005权威指南
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=162785
Sql Server 2005 Performance Optimiztion and Tuning Handbood
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=165048
Microsoft SQL Server 2005编程傻瓜书
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152864
Pro SQL Server 2005 Assemblies
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=151269
MS SQL Server 2005 Reporting Essentials
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=147862
SQL Server 2005工具箱内幕
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152321
SQL Server 2005管理员手册
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152347
SQL Server 2005工具箱内幕
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152321
SQL Server 2005数据挖掘
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=148099
Pro SQL Server 2005 Service Broker
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=159656
Pro SQL Server 2005 Replication
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=160606
Sql server 2005的XML最佳实施策略
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152278
Microsoft SQL Server Black Book
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=163457
MS SQL Server2000 宝典
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=145853
SQL Server 2000存储过程和XML编程
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152873
SQL Server 2005高级数据分析视频教程系列
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=162737
SQL Server 2005盛宴系列视频 全52讲
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=151642
mysql电子资料:
MySQL宝典
http://bbs.topsage.com/dispbbs_122_159157_1.html
SQL for MySQL Developers
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152862
MySQL教程
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=146824
Teach Yourself MySQL in 10 Minutes
http://bbs.topsage.com/dispbbs_122_174432_1.html
O'Reilly MySQL Pocket Reference 第二版 PDF
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=175014
MySQL 5 权威指南(第三版)
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=148867
MySQL培训经典教程
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=146795
MySQL Cookbook 第二版
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=175972
The Definitive Guide to MySQL
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=175382
O'Reilly MySQL Pocket Reference 第二版
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=175014
MySQL Essential Skills
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=146749
MySQL Administrators Guide
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=146580
MySQL权威指南 中文版+英文版
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=148870
MySQL 4.1.0 中文参考手册
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=148869
MySQL in a Nutshell
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=148868
Export MySQL
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152865
MySQL and php from Scratch
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=152162
其他数据库电子资料:
SQLite权威指南
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=146072
Microsoft Access 2007初学者指南 2007年6月
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=147856
Microsoft Access 2007宝典
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=157078
Microsoft Office Access 2007 VBA宝典
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=157113
Wrox出版 Expert Access 2007 Programming
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=165951
Access 2007 窗体、报表和查询
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=160519
Microsoft Acces 2007数据分析
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=160656
Oracle Automatic Storage Management
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=166808
Pro Oracle Spatial for Oracle Database 11g
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=165942
Oracle 9i 数据库管理员指南
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=146230
Wrox Professional Oracle 8i Programming
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=163479
O'Reilly Oracle Security
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=160137
PL/SQL Study Guide
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=148096
Sybase实用教程
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=146235
PostgreSQL 对象关系数据库开发
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=159286
PostgreSQL 必备参考手册
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=159298
PostgreSQL 7 数据库开发指南
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=159302
PostgreSQL 8 for Windows 2007年3月最新出版
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=159310
Crystal Reports 10 完全参考
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=147099
Crystal Reports 10 水晶报表10傻瓜书
http://bbs.topsage.com/dispbbs.asp?boardID=122&ID=156454 参考技术A 你运行的时候可能把下面一行筐住了,它只运行了下面一行,你这2句一起运行是没有问题的本回答被提问者采纳 参考技术B 如果两句一起运行是不会有问题的,应该是你运行的时候运行方式错了。 参考技术C 你最好编个存储过程,
这样第一句就有用了
sql server 2000 如何改变 default属性
ALTER TABLE LACRIMOSA ALTER COLUMN CHEN SET DEFAULT 'CHEN' 我的语句是这么写的,为什么会提示:
服务器: 消息 156,级别 15,状态 1,行 1
在关键字 'SET' 附近有语法错误。
求教 。在建立表是时候是可以添加的 ,但是我想改变default值,就说我有问题
alter table 表名 drop constraint [已有默认约束名称]
增加默认值约束语句:
alter table 表名 add constraint [默认约束名称] default 默认值 for 字段名 参考技术B ALTER TABLE 表名 add DEFAULT ( '修改后的默认值 ') for 字段名 WITH VALUES
如果之前有了约束的话,应该先删除。追问
如何删除表中列的默认default值 ALTER TABLE 表 ALTER COLUNM 列名 DROP DEFAULT 这样好像打进去是错的
追答ALTER TABLE dbo.t1
DROP CONSTRAINT DF_t1_fb
ALTER TABLE dbo.t1 ADD CONSTRAINT
DF_t1_fb DEFAULT (''b'') FOR fb
DF_t1_fb是自己随意取的
以上是关于求教sql语句问题的主要内容,如果未能解决你的问题,请参考以下文章