SQL判断字段类型
-->Title:Generating test data
-->Author:wufeng4552
-->Date :2009-09-25 09:56:07
if object_id('tb')is not null drop table tb
go
create table tb(ID int,name text)
insert tb select 1,'test'
go
--方法1
select sql_variant_property(ID,'BaseType') from tb
--方法2
select object_name(ID)表名,
c.name 字段名,
t.name 数据类型,
c.prec 长度
from syscolumns c
inner join systypes t
on c.xusertype=t.xusertype
where objectproperty(id,'IsUserTable')=1 and id=object_id('tb')
相关文档:
if exists(select 1 from sysobjects where name='char_index')
drop function char_index
create function char_index(@string varchar(8000),@char varchar(10),@index smallint)
--@string:待查找字符串,@index:查找位置
returns smallint
as
begin
declare
@i tinyint,--当前找到第@i个
  ......
==============================================
第01讲: Chapter 00--Oracle 11g SQL Fundamentals Training Introduction
在线观看: http://www.boobooke.com/v/bbk2003
视频下载: http://www.boobooke.com/v/bbk2003.zip
第02讲: Chapter 00--Oracle 11g SQL Fundamentals Training Introduction ......
一、 简单查询
简单的Transact-SQL查询只包括选择列表、from子句和WHERE子句。它们分别说明所查询列、查询的表或视图、以及搜索条件等。
例如,下面的语句查询testtable表中姓名为“张三”的nickname字段和email字段。
SELECT nickname,email
from testtable
WHERE name='张三'
......
CareGroup 医疗组织负责保护2TB 的病人信息和相关数据的隐私及完整性。该组织位于波士顿,是Beth Israel Deaconess 医学中心(哈佛医学院的教学医院)以及另外三家地区医院的母公司。CareGroup 采用Microsoft® SQL Server™ 2005,将其数据存储于30个实例的390个数据库中。该组织希望将数据库升级到SQL Server 200 ......
“经过测试我们发现SQL Server 2008当中的备份压缩功能可以1-3倍的压缩比,从而极大的减少备份所需的磁盘空间。”Alexey Yeltsov, 微软系统管理员主管。
微软在全世界共有6万多名员工,在2006年的财政收入超过了500亿美金,与此同时也产生了大量内部数据,公司希望对这些数据进行集中以便提供客户的集成化视图。 ......