SQl Code表设计
在Asp.net后有很多常用的表结构 membership就是一个典型,除此还有code表
CREATE TABLE [dbo].[CodeTables](
[CodeTableID] [uniqueidentifier] NOT NULL,
[ParentCodeTableID] [uniqueidentifier] NULL,
[Name] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Alias] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Description] [varchar](1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ItemCodeMinLength] [int] NULL,
[ItemCodeMaxLength] [int] NULL,
[CreatedBy] [varchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreatedDate] [datetime] NOT NULL,
[LastUpdatedBy] [varchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LastUpdatedDate] [datetime] NULL,
[RecordStatus] [char](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [PK_CodeTables] PRIMARY KEY CLUSTERED
(
[CodeTableID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
CREATE TABLE [dbo].[CodeItems](
[CodeItemID] [uniqueidentifier] NOT NULL,
[CodeTableID] [uniqueidentifier] NOT NULL,
[ParentCodeItemID] [uniqueidentifier] NULL,
[Description] [varchar](1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Code] [varchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreatedBy] [varchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreatedDate] [datetime] NOT NULL,
[LastUpdatedBy] [varchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LastUpdatedDate] [datetime] NULL,
[RecordStatus] [char](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [PK_CodeItems] PRIMARY KEY CLUSTERED
(
相关文档:
(
8)
SELECT
(
9)
DISTINCT
(
11)
<
TOP_specification>
<
select_list>
(
1)
from
<
left_table>
(
3)
<
join_type>
JOIN
<
right_table>
(
2)
ON
<
join_codition>
(
4)
WHERE
<
where_condition>
(
5)
GROUP
BY
& ......
导入
如果表已存在,SQL语句为:
insert into aa select * from OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=D:\OutData.xls;Extended Properties=Excel 8.0')...[sheet1$]
其中,aa是表名,D:\OutData.xls是excel的全路径 sheet1后必须加上$
如果表不存在,SQL语句为:
SELECT * INTO aa from OPENDAT ......
X锁即是我们常说的排它锁,U锁很少见,只在更新时会出现。U锁其实是X锁的一种,当数据更新时,U锁首先加到要更新的数据上(即使目标上面有S锁,U锁还是可以加上),等目标可以被更新时,U锁即转变为X锁。 如需转载,请注明本文原创自CSDN TJVictor专栏:http://blog.csdn.net/tjvictor ......
开放性 SQL Server
只能在Windows 上运行,没有丝毫的开放性,操作系统的系统的稳定对数据库是十分重要的。Windows9X系列产品是偏重于桌面应用,NT server只适合中小型企业。而且Windows平台的可靠性,安全性和伸缩性是非常有限的。它不象Unix那样久经考验,尤其是在处理大数据量的关键业务时。
Oracle
......