What Is SQL?
What Is SQL?
SQL (pronounced as the letters S-Q-L or as sequel) is an abbreviation for Structured Query Language. SQL is a language designed specifically for communicating with databases.
Unlike other languages (spoken languages like English, or programming languages like Java or Visual Basic), SQL is made up of very few words. This is deliberate. SQL is designed to do one thing and do it well—provide you with a simple and efficient way to read and write data from a database.
What are the advantages of SQL?
SQL is not a proprietary language used by specific database vendors. Almost every major DBMS supports SQL, so learning this one language will enable you to interact with just about every database you'll run into.
SQL is easy to learn. The statements are all made up of descriptive English words, and there aren't that many of them.
Despite its apparent simplicity, SQL is actually a very powerful language, and by cleverly using its language elements you can perform very complex and sophisticated database operations.
And with that, let's learn SQL.
SQL Extensions : Many DBMS vendors have extended their support for SQL by adding statements or instructions to the language. The purpose of these extensions is to provide additional functionality or simplified ways to perform specific operations. And while often extremely useful, these extensions tend to be very DBMS specific, and they are rarely supported by more than a single vendor.
Standard SQL is governed by the ANSI standards committee, and is thus called ANSI SQL. All major DBMSs, even those with their own extensions, support ANSI SQL. Individual implementations have their own names (PL-SQL, Transact-SQL, and so forth).
相关文档:
1.字符串函数
长度与分析用
datalength(Char_expr) 返回字符串包含字符数,但不包含后面的空格
substring(expression,start,length) 不多说了,取子串
right(char_expr,int_expr) 返回字符串右边int_expr个字符
字符操作类
upper(char_expr) 转为大写
lower(char_expr) 转为小写
space(int_expr) 生成int_expr个空格 ......
作业管理
自动处理一个任务的第一步是创建对应的作业,作业可以使用两种工具来创建,即创建作业向导和SQL Server 企业管理器。创建作业最容易的方法是使用创建作业向导,一般来说,如果要创建作业,必须执行以下三个步骤:
(1)定义作业步;
(2)如果该作业不是用户指定执行,创建作业执行的调度时间;
(3)通知操作员作业 ......
win7 下 配置 SQL Server 2005 允许远程访问
2010年2月2日 bibiQ
本来一直不愿意配置远程访问SQL server,但今天一狠心把它配好了。
参考了网上的帖子http://www.cnblogs.com/sukiwqy/archive/2009/11/11/1601381.html
step1: 配置SQL Server 外围应用配置器(为 SQL Server 2005 启用远程连接、启用 SQL Server Brow ......
错误提示,有一个文件已经挂起,必须重新启动计算机。重新启动,再次安装仍然是同样的问题。
注册表键值的问题。解决方法:
只要删除\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\下的PendingFileRenameOperations键值,就可以重新安装了。
删除后安装,不必重新启动计算机。 ......
---一个月的第一天
SELECT DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)
--- 本周的星期一
SELECT DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)
---一年的第一天
SELECT DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)
----季度的第一天
SELECT DATEADD(qq, DATEDIFF(qq,0,getdate()), 0)
----上个月的最后一天
......