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

һЩ¼òµ¥µÄSQLÓï¾ä×ܼÆ

--------¼ì²âÊý¾Ý¿âÊÇ·ñ´æÔÚ
use master
go
if exists(select * from sysdatabases where name='DBName')
drop database DBName
-----´´½¨Êý¾Ý¿â
create database DBName
on
(
 /*Êý¾ÝÎļþµÄ¾ßÌåÃèÊö*/
 name='DBName_data', -----Ö÷Êý¾ÝÎļþµÄÂß¼­Ãû³Æ
 filename='D:\project\DBName_data.mdf',   --Ö÷Êý¾ÝÎļþµÄÎïÀíÃû³Æ
 size=5mb,   --Ö÷Êý¾ÝÎļþµÄ³õʼ´óС
 maxsize=100mb,   --Ö÷Êý¾ÝÎļþµÄ×î´óÖµ
 filegrowth=15%  --Ö÷Êý¾ÝÎļþµÄÔö³¤ÂÊ
)
log on
(
 /*ÈÕÖ¾ÎļþµÄ¾ßÌåÃèÊö£¬¸÷²ÎÊýº¬ÒåͬÉÏ*/
 name='DBName_log',
 filename='D:\project\DBName_data.mdf',
 size=2mb,
 filegrowth=1mb
)
go
------------ɾ³ýÊý¾Ý¿â
drop database DBName
--------¼ì²â±íÊÇ·ñ´æÔÚ
use DBName
go
if exists(select * from sysobjects where name='tableName')
drop table tableName
-------´´½¨±í
use DBName
go
create table tableName
(
 clName int identity(1,1) not null,  ---±êʶÁУ¬×Ô¶¯Ôö³¤
 clName2 varchar(50) not null
)
go
--------ɾ³ý±í
drop table tableName
------´´½¨Ô¼Êø
alter table tableName add
constraint PK_clName primary key(clName),     ---Ö÷¼üÔ¼Êø
constraint UQ_clName unique (clName),    ----ΨһԼÊø
constraint CK_clName check(clName between 0 and 100),     ---¼ì²éÔ¼Êø
constraint DF_clName default(100) for clName,     ----ĬÈÏÔ¼Êø
constraint FK_clName foreign key(clName) references tbName(clName)   ---Íâ¼üÔ¼Êø£¬ºóÃæÊÇÖ÷±íÖ÷¼ü
----------ɾ³ýÔ¼Êø
alter table tableName
 drop constraint PK_clName
-------Ìí¼ÓWindowsµÇ½ÕË»§
exec sp_grantlogin 'jbtraining\s26301' -----------jbtraining±íʾÓò£¬s26301±íʾÓòÕË»§
-------Ìí¼ÓSQLµÇ¼ÕË»§
exec sp_addlogin 'zhangsan','1234'  -----------ÕË»§ÃûΪzhangsan,ÃÜÂëΪ1234
-------´´½¨Êý¾Ý¿âÓû§
exec sp_grantdbaccess 'zhangsan'    ---------µÇ¼ÕË»§Îªzhangsan,Êý¾Ý¿âÓû§Ä¬ÈϺ͵ǼÕË»§Í¬Ãû
------ΪÊý¾Ý¿âÓû§ÊÚȨ
grant select,insert,update


Ïà¹ØÎĵµ£º

SQL¶¯Ì¬¼ÆËã³ö±íÖй«Ê½Ê¾Àý

##################################################
#        ÉùÃ÷£º
#        ±¾ÎÄת×ÔCSDN£¬Óû§ID£ºhtl258
#        Ô­ÌûµØÖ·£ºhttp://blog.csdn.net/htl258/archive/2010/05/13/5588454.aspx
####### ......

SQL Server 2008ÖеıíÖµÐͲÎÊý

##################################################
#        ÉùÃ÷£º
#        ±¾ÎÄת×ÔCSDN£¬Óû§ID£ºhtl258
#        Ô­ÌûµØÖ·£ºhttp://blog.csdn.net/htl258/archive/2010/04/28/5537416.aspx
####### ......

°²×° SQL server2000ϵͳÌáʾÒÔÇ°µÄij¸öÎļþÒÔ¹ÒÆð

1¡¢¹ØÓÚSQL server 2000 ÔÚ°²×°¹ý³ÌÖÐÓöµ½Îļþ¹ÒÆðµÄ½â¾ö°ì·¨£º
ÔÚGhost °æ windows xp Öа²×° SQL server 2000 ʱ¾­³£»áÓöµ½°²×°³ÌÐòÔËÐе½µÚ¶þ²½£¨ÈçÏÂͼËùʾ£©Ê±µã»÷ÏÂÒ»²½ÏÔʾÓÐÎļþ¹ÒÆð²Ù×÷£¬ÌáʾÖØÐÂÆð
¶¯¼ÆËã»ú½â¾öÕâ¸öÎÊÌ⣬¿ÉÖØÐÂÆ𶯼ÆËã»úºó£¬°²×°³ÌÐò½øÐе½´ËÈÔÈ»ÏÔʾÓÐÎļþ¹ÒÆð²Ù×÷¡£Õâ¸öÎÊÌâµÄ²úÉúʵ¼Ê²¢ ......

ÔÚlinuxÉÏÅäÖÃunixODBCºÍFreeTDS·ÃÎÊMS SQL Server.

Ò», °²×° unixODBC
ÏÂÔØ°²×°°ü. ÔÚ RedHat °²×°¹âÅÌÉϾÍÓÐ
unixODBC-2.2.11-1.RHEL4.1.i386.rpm
unixODBC-devel-2.2.11-1.RHEL4.1.i386.rpm
unixODBC-kde-2.2.11-1.RHEL4.1.i386.rpm
°²×°
rpm -Uvh unixODBC-2.2.11-1.RHEL4.1.i386.rpm
rpm -Uvh unixODBC-devel-2.2.11-1.RHEL4.1.i386.rpm
Èç¹û°²×°ÖÐÌáʾÓжÔÆäËü° ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ