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

ÎÒÔÚ±±´óÇàÄñËùѧSQL֪ʶµÄС»ã×Ü

´´½¨Îļþ¼Ð£ºexec xp_cmdshell 'md ÅÌ·û:\Îļþ¼ÐÃû³Æ', no_output
ÀýÈ磺ÔÚDÅÌ´´½¨ÃûΪ£º“×ÊÁÏ”µÄÎļþ¼Ð£ºexec xp_cmdshell 'md d:\×ÊÁÏ', no_output
 
²é¿´Îļþ£ºexec xp_cmdshell 'dirÅÌ·û:\Îļþ¼ÐÃû³Æ'¡£ÀýÈ磺exec xp_cmdshell 'dir d:\×ÊÁÏ'
ÅжÏÊý¾Ý¿âÊÇ·ñ´æÔÚ£ºif exists(select * from sysdatabases where name='Êý¾Ý¿âÃû³Æ')
drop database Êý¾Ý¿âÃû³Æ
 
ÅжϱíÊÇ·ñ´æÔÚ——if exists(select * from sysobjects where name='±íÃû')   drop table ±íÃû
 
Ìí¼ÓÔ¼Êø£¨5ÖÖ£©——Óï·¨£ºalter table ±íÃû add constraint Ô¼ÊøÃûÔ¼ÊøÀàÐÍ ¾ßÌåµÄÔ¼ÊøËµÃ÷
1.Ö÷¼üÔ¼Êø£ºalter table ±íÃû add constraint pk_Ô¼ÊøÃû primary key(Ö÷¼üÔ¼Êø×Ö¶ÎÃû)
2.Íâ¼ü£ºalter table±íÃûadd constraint fk_Ô¼ÊøÃûforeign key(Íâ¼ü×Ö¶ÎÃû) references ¹ØÏµ±í(Ö÷¼üÃû)
3.Î¨Ò»Ô¼Êø£ºalter table ±íÃû add constraint uq_Ô¼ÊøÃû unique (Î¨Ò»Ô¼Êø×Ö¶ÎÃû)
4.¼ì²éÔ¼Êø£ºalter table ±íÃû add constraint ck_Ô¼ÊøÃû check (Ô¼Êø¼ì²é×Ö¶ÎÃû)   --±í´ïʽ
5.ĬÈÏÔ¼Êø£ºalter table ±íÃû add constraint df_Ô¼ÊøÃû default (ĬÈÏÖµ) for ĬÈÏÔ¼Êø×Ö¶ÎÃû
 
ɾ³ýÔ¼ÊøÓï·¨£ºalter table ±íÃû drop constraint Ô¼ÊøÃû
ÀýÈ磺ɾ³ýstuInfo±íÖеØÖ·µÄĬÈÏÔ¼Êø£ºalter table stuInfo drop constraint Ô¼ÊøÃû(df_stuAddress)
 
µÚÒ»µÀ´óÃÅ——´´½¨µÇ¼ÕÊ»§£¨2ÖÖ£©
µÚÒ»ÖÖ£ºSQLÕË»§£ºexec sp_addlogin 'Óû§Ãû','ÃÜÂë'
µÚ¶þÖÖ£ºWindowsÕË»§£ºexec sp_grantlogin 'windowsÓòÃû\ÓòÕË»§'
µÚ¶þµÀ´óÃÅ——´´½¨Êý¾Ý¿âÓû§ £ºexec sp_grantdbaccess 'µÇ¼ÕË»§','Êý¾Ý¿âÓû§' 
--“Êý¾Ý¿âÓû§”Ϊ¿ÉÑ¡²ÎÊý£¬Ä¬ÈÏΪµÇ¼ÕË»§£¬¼´Êý¾Ý¿âÓû§Ä¬ÈϺ͵ǼÕË»§Í¬Ãû¡£
ÀýÈ磺ÔÚÊý¾Ý¿âÖÐÌí¼ÓÒ»¸öÓû§£º
exec sp_grantdbaccess 'zhang','zhangUser'     --'zhangΪµÇ¼ÕË»§','zhangUserΪÊý¾Ý¿âÓû§'
 
µÚÈýµÀ´óÃÅ——ÏòÊý¾Ý¿âÓû§ÊÚȨ£ºgrant ȨÏÞ on ±íÃû to Êý¾Ý¿âÓû§
ÀýÈ磺ΪzhangsanUserÊÚÓè¶Ô±ístuInfoµÄÔöɾ¸Ã²éµÄȨÏÞ
grant select,update,delete,insert on stuInfo to zhangsanUser
½¨±íµÄȨÏÞ£ºgrant create table to zhangsanUser
 
----------------------------------µÚÈýÕ T—SQL±à³Ì--------


Ïà¹ØÎĵµ£º

½«accessµ¼ÈëSQL server

Ò»¡¢SQL SERVER ºÍACCESSµÄÊý¾Ýµ¼Èëµ¼³ö
³£¹æµÄÊý¾Ýµ¼Èëµ¼³ö£º
ʹÓÃDTSÏòµ¼Ç¨ÒÆÄãµÄAccessÊý¾Ýµ½SQL Server£¬Äã¿ÉÒÔʹÓÃÕâЩ²½Öè:
¡¡¡¡¡ð1ÔÚSQL SERVERÆóÒµ¹ÜÀíÆ÷ÖеÄTools£¨¹¤¾ß£©²Ëµ¥ÉÏ£¬Ñ¡ÔñData Transformation
¡¡¡¡¡ð2Services£¨Êý¾Ýת»»·þÎñ£©£¬È»ºóÑ¡Ôñ  czdImport Dat ......

AccessºÍSQL2000ÖÐÓï¾äµÄÇø±ð

1 £¬¶ÔÓÚÈÕÆÚ×Ö¶Î×Ö¶Î
access±íʾΪ£º#1981-28-12#
SQLSERVER2000±íʾΪ£º''1981-02-12''
2,SQLÓï¾äÇø±ð£¬select ,update ÔÚ¶Ôµ¥±í²Ù×÷ʱ¶¼²î²»¶à£¬
µ«¶à±í²Ù×÷ʱupdateÓï¾äµÄÇø±ðACCESSÓëSQLSERVERÖеÄUpdateÓï¾ä¶Ô±È:
SQLSERVERÖиüжà±íµÄUpdateÓï¾ä:
Update Tab1
SET a.Name = b.Name
from Tab1 a,Tab2 b
Whe ......

[ÊÕ£] ÓÃsqlite Ö´Ðбê×¼ sql Óï·¨

http://www.umgr.com/blog/PostView.aspx?bpId=36294
 1. Ö´ÐÐsqlÓï¾ä
int sqlite3_exec(sqlite3*£¬ const char *sql£¬ sqlite3_callbacksql Óï·¨
£¬ void *£¬  char **errmsg );
Õâ¾ÍÊÇÖ´ÐÐÒ»Ìõ sql Óï¾äµÄº¯Êý¡£
µÚ1¸ö²ÎÊý²»ÔÙ˵ÁË£¬ÊÇÇ°Ãæopenº¯ÊýµÃµ½µÄÖ¸Õ롣˵ÁËÊǹؼüÊý¾Ý½á¹¹¡£
µÚ2¸ö²ÎÊýconst char ......

SQLSERVER SQLÐÔÄÜÓÅ»¯

1.Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)¡¡¡¡
¡¡¡¡ SQLSERVERµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬Òò´Ëfrom×Ó¾äÖÐдÔÚ×îºóµÄ±í£¨»ù´¡±ídriving table£©½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏ£¬±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í£¬µ±SQLSERVER´¦Àí¶à¸ö±íʱ£¬»áÔËÓÃÅÅÐò¼°ºÏ²¢µÄ·½Ê½Á ......

SQLÍêÈ«¼òÃ÷ÊÖ²á


¹ØÓÚÎÒÃÇ | ¼ÓÈëÎÒÃÇ | ÍøÕ¾½á¹¹ | ½»»»Á¬½Ó | ÁªÏµÎÒÃÇ
Ê×Ò³
¼¼ÊõÎÄÕª
°²È«Â©¶´
²ËÄñÀÖÔ°
ºÚ¿Í½ø½×
×ÊÁÏÎÄ¿â
Ô­´´×÷Æ·
Èí¼þÏÂÔØ
¼¼ÊõÂÛ̳
SQLÍêÈ«¼òÃ÷ÊÖ²á
תÌû
SQLÊÇStructured Quevy Language(½á¹¹»¯²éѯÓïÑÔ)µÄËõд¡£SQLÊÇרΪÊý¾Ý¿â¶ø½¨Á¢
µÄ²Ù×÷ÃüÁ£¬ÊÇÒ»ÖÖ¹¦ÄÜÆëÈ«µÄÊý¾Ý¿âÓïÑÔ¡£ÔÚÊ¹Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ