SQL²Ù×÷È«¼¯
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database dbname
3¡¢ËµÃ÷£º±¸·Ýsql server
--- ´´½¨ ±¸·ÝÊý¾ÝµÄ device
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'
--- ¿ªÊ¼ ±¸·Ý
BACKUP DATABASE pubs TO testBack
4¡¢ËµÃ÷£º´´½¨Ð±í
create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..)
¸ù¾ÝÒÑÓÐµÄ±í´´½¨ÐÂ±í£º
A£ºcreate table tab_new like tab_old (ʹÓÃ¾É±í´´½¨Ð±í)
B£ºcreate table tab_new as select col1,col2… from tab_old definition only
5¡¢ËµÃ÷£ºÉ¾³ýбídrop table tabname
6¡¢ËµÃ÷£ºÔö¼ÓÒ»¸öÁÐ
Alter table tabname add column col type
×¢£ºÁÐÔö¼Óºó½«²»ÄÜɾ³ý¡£DB2ÖÐÁмÓÉϺóÊý¾ÝÀàÐÍÒ²²»Äܸı䣬ΨһÄܸıäµÄÊÇÔö¼ÓvarcharÀàÐ͵ij¤¶È¡£
7¡¢ËµÃ÷£ºÌí¼ÓÖ÷¼ü£º Alter table tabname add primary key(col)
˵Ã÷£ºÉ¾³ýÖ÷¼ü£º Alter table tabname drop primary key(col)
8¡¢ËµÃ÷£º´´½¨Ë÷Òý£ºcreate [unique] index idxname on tabname(col….)
ɾ³ýË÷Òý£ºdrop index idxname
×¢£ºË÷ÒýÊDz»¿É¸ü¸ÄµÄ£¬Ïë¸ü¸Ä±ØÐëɾ³ýÖØн¨¡£
9¡¢ËµÃ÷£º´´½¨ÊÓͼ£ºcreate view viewname as select statement
ɾ³ýÊÓͼ£ºdrop view viewname
10¡¢ËµÃ÷£º¼¸¸ö
Ïà¹ØÎĵµ£º
oracleµÄodbcÍø¹Ø£¨gateway£©¼¸ºõÌṩһ¸öÎÞÏßµÄÊý¾ÝÕûºÏƽ̨£¬ÔÚoracleºÍÆäËüRDBMSÖ®¼ä£¬ÎÒÔÚÕâ²»Ïë˵ËüµÄ£¬²Ù×÷£¬ÏÞÖÆÒÔ¼°Ïà¹ØÐÔ£¬Ëü½â¾öÁËÒ»¸öСÎÊÌ⣬°ÑËü½¨Á¢ÆðÀ´ÄãÄÜ£¬ÀýÈ磬´´½¨Ò»¸ö database link ÔÚoracle ºÍoracleÖ®¼ä£¬±Ï¾¹£¬ÕâÑù²»ÊǺܺÃô£¬ÀýÈçÄãÄÜÔËÐÐÏÂÃæµÄsqlÓï¾ä£¬
select o.col1, m.col1 from or ......
SELECT LEFT(RTRIM('20080927p1058'),LEN('20080927p1058')-2)
SELECT SUBSTRING('20080927p1058',1,LEN('20080927p1058')-2)
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*whit ......
SQL Server 2005
±¾Æª½éÉÜÈçºÎÁ´½Óµ½Sql Server 2005.
²ÉÓÃSQL ±¾µØ¿Í»§ ODBCÇý¶¯
²ÉÓÃSqlÉí·ÝÑéÖ¤
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
ÄãÕýÔÚʹÓÃSQL Server 2005 Express£¿±ðÍü¼ÇÁË£¬ServernameµÄÓï·¨ÊÇServername\SQLEXPRESS£¬Äã¿ÉÒÔÓÃÄã°²× ......
ÖÕÓڸ㶨JSPÁ¬½ÓSQL Server 2000Êý¾Ý¿âµÄÎÊÌâÁË
2008Äê01ÔÂ29ÈÕ ÐÇÆÚ¶þ 15:54
Ç°¼¸Ì죬ƽƽͬѧһֱÔÚ¸ãJSP Á¬½ÓSQL Server 2000Êý¾Ý¿âµÄÎÊÌ⣬һֱÁ¬²»ÉÏ£¬È»ºó½ÐÎÒÈ¥°ïËû¿´¿´£¬Æ¾×ÅÒÔÇ°µÄ¾Ñ飬¸ãÁËÒ»¸öÏÂÎ磬ºÙºÙ£¡ÖÕÓÚ°ïËûÁ¬½ÓÉÏÁË£¬Ö÷Òª²½ÖèÈçÏ£º
1¡¢ÐèÒªµÄ¶«Î÷´ó¼Ò¿ÉÒÔµ½Î ......