Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

sqlÓï¾ä¶à±í²éѯ

ÎÊÌâ¼°ÃèÊö£º
--1.ѧÉú±í
Student(S#,Sname,Sage,Ssex) --S# ѧÉú±àºÅ,Sname ѧÉúÐÕÃû,Sage ³öÉúÄêÔÂ,Ssex ѧÉúÐÔ±ð
--2.¿Î³Ì±í
Course(C#,Cname,T#) --C# --¿Î³Ì±àºÅ,Cname ¿Î³ÌÃû³Æ,T# ½Ìʦ±àºÅ
--3.½Ìʦ±í
Teacher(T#,Tname) --T# ½Ìʦ±àºÅ,Tname ½ÌʦÐÕÃû
--4.³É¼¨±í
SC(S#,C#,score) --S# ѧÉú±àºÅ,C# ¿Î³Ì±àºÅ,score ·ÖÊý
*/
--´´½¨²âÊÔÊý¾Ý
create table Student(S# varchar(10),Sname nvarchar(10),Sage datetime,Ssex nvarchar(10))
insert into Student values('01' , N'ÕÔÀ×' , '1990-01-01' , N'ÄÐ')
insert into Student values('02' , N'Ç®µç' , '1990-12-21' , N'ÄÐ')
insert into Student values('03' , N'Ëï·ç' , '1990-05-20' , N'ÄÐ')
insert into Student values('04' , N'ÀîÔÆ' , '1990-08-06' , N'ÄÐ')
insert into Student values('05' , N'ÖÜ÷' , '1991-12-01' , N'Å®')
insert into Student values('06' , N'ÎâÀ¼' , '1992-03-01' , N'Å®')
insert into Student values('07' , N'Ö£Öñ' , '1989-07-01' , N'Å®')
insert into Student values('08' , N'Íõ¾Õ' , '1990-01-20' , N'Å®')
create table Course(C# varchar(10),Cname nvarchar(10),T# varchar(10))
insert into Course values('01' , N'ÓïÎÄ' , '02')
insert into Course values('02' , N'Êýѧ' , '01')
insert into Course values('03' , N'Ó¢Óï' , '03')
create table Teacher(T# varchar(10),Tname nvarchar(10))
insert into Teacher values('01' , N'ÕÅÈý')
insert into Teacher values('02' , N'ÀîËÄ')
insert into Teacher values('03' , N'ÍõÎå')
create table SC(S# varchar(10),C# varchar(10),score decimal(18,1))
insert into SC values('01' , '01' , 80)
insert into SC values('01' , '02' , 90)
insert into SC values('01' , '03' , 99)
insert into SC values('02' , '01' , 70)
insert into SC values('02' , '02' , 60)
insert into SC values('02' , '03' , 80)
insert into SC values('03' , '01' , 80)
insert into SC values('03' , '02' , 80)
insert into SC values('03' , '03' , 80)
insert into SC values('04' , '01' , 50)
insert into SC values('04' , '02' , 30)
insert into SC values('04' , '03' , 20)
insert into SC values('05' , '01' , 76)
insert into SC values('05'


Ïà¹ØÎĵµ£º

SQL Server ErrorLog

תÖÁhttp://mbtk.blog.sohu.com/150003773.html £¬²¢²¹³äһЩÏà¹Ø֪ʶ¡£
DBCC ErrorLog £ºÈç¹ûºÜÉÙÖØÆðmssqlserver·þÎñ£¬ÄÇô·þÎñÆ÷µÄÈÕÖ¾»áÔö³¤µÃºÜ¿ì£¬¶øÇÒ´ò¿ªºÍ²é¿´ÈÕÖ¾µÄËÙ¶ÈÒ²»áºÜÂý¡£Ê¹ÓÃÕâ¸öÃüÁ¿ÉÒԽضϵ±Ç°µÄ·þÎñÆ÷ÈÕÖ¾£¬Ö÷ÒªÊÇÉú³ÉÒ»¸öеÄÈÕÖ¾¡£¿ÉÒÔ¿¼ÂÇÉèÖÃÒ»¸öµ÷¶ÈÈÎÎñ£¬Ã¿ÖÜÖ´ÐÐÕâ¸öÃüÁî×Ô¶¯½Ø¶Ï·þÎ ......

SQl Óï¾ä(³£¼û) н¨,ɾ³ý,Ð޸ıí½á¹¹

н¨±í£º
create table [±íÃû]
(
[×Ô¶¯±àºÅ×Ö¶Î] int IDENTITY (1,1) PRIMARY KEY ,
[×Ö¶Î1] nVarChar(50) default 'ĬÈÏÖµ' null ,
[×Ö¶Î2] ntext null ,
[×Ö¶Î3] datetime,
[×Ö¶Î4] money null ,
[×Ö¶Î5] int default 0,
[×Ö¶Î6] Decimal (12,4) default 0,
[×Ö¶Î7] image null ,
)
ɾ³ý±í£º
Drop table [±í ......

SQL°´ÕÕÈÕ¡¢ÖÜ¡¢Ô¡¢Äêͳ¼ÆÊý¾Ý

Èç: ±í:consume_record 
×Ö¶Î:consume (moneyÀàÐÍ)  date (datetimeÀàÐÍ) 
ÇëÎÊÔõôдËÄÌõsqlÓï¾ä·Ö±ð°´ÈÕ,°´ÖÜ,°´ÔÂ,°´¼¾Í³¼ÆÏû·Ñ×ÜÁ¿. 
Èç:1Ô 1200Ôª 
2Ô 3400Ôª 
3Ô 2800Ôª 
--°´ÈÕ 
select sum(consume),day([date]) from& ......

SQL Access´´½¨±í

Ò»¡¢´´½¨Ò»ÕÅ¿Õ±í£º
Sql="Create TABLE [±íÃû]"
¶þ¡¢´´½¨Ò»ÕÅÓÐ×Ö¶ÎµÄ±í£º
Sql="Create TABLE [±íÃû]([×Ö¶ÎÃû1] MEMO NOT NULL, [×Ö¶ÎÃû2] MEMO, [×Ö¶ÎÃû3] COUNTER NOT NULL, [×Ö¶ÎÃû4] DATETIME, [×Ö¶ÎÃû5] TEXT(200), [×Ö¶ÎÃû6] TEXT(200))
×Ö¶ÎÀàÐÍ£º
2 : "SmallInt", // ÕûÐÍ
3 : "Int", ......

SQL Server 2005/2008 °²È«¼à¿Ø£¨´ýÐø£©

-- ²é¿´µ±Ç°dbµÄµÇ½
select * from sys.sql_logins
-- ÉóºËµÇ½Êý¾Ý¿âµÄÓû§
sql server managerment studioÖУ¬ÓÒ¼üµã¿ª·þÎñÆ÷µÄÊôÐÔ£¬ÔÚ°²È«ÐÔҳǩÖУ¬ Ñ¡ÖÐÉóºË“³É¹¦ºÍʧ°ÜµÄµÇ½”£¬ËùÓеǽ¶¼»áÔÚ..MSSQL\Log\ERRORLOGÖмǼһÌõ¼Ç¼¡£
Èç¹û¹´Ñ¡“ÆôÓÃC2ÉóºË¸ú×Ù”£¬½«»áÔÚ..MSSQL\Log\Ŀ¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ