ÈçºÎÐÞ¸ÄSQL SAÃÜÂë
1>ͨ¹ýÆóÒµ¹ÜÀíÆ÷½øÈë²éѯ·ÖÎöÖ´ÐУº
EXEC sp_password NULL, 'ÄãµÄÐÂÃÜÂë', 'sa'
Èç¹ûÄãÔÚNTÏÂ(°üÀ¨2000)×°µÄSQL Server£¬Ôò¿ÉÒÔÕâÑù×ö£º
Ö±½Ó´ò¿ª"²éѯ·ÖÎöÆ÷"(×¢Òâ²»ÊÇ´Ó"ÆóÒµ¹ÜÀíÆ÷"ÖнøÈë,¿ÉÒÔ´Ó¿ªÊ¼²Ëµ¥µÄ³ÌÐò×é½øÈ¥,Èç¹ûÕÒ²»µ½µÄ»°,Ö±½ÓÔÚ"ÔËÐÐ"ÖÐÊäÈë"isqlw.exe"Ò²¿É);
Ñ¡Ôñ"WindowsÉí·ÝÑéÖ¤"½øÈë,²»ÐèÒªÊäÈëÃÜÂë,Ö»ÒªÄãÊDZ¾»úµÄϵͳ¹ÜÀíÔ±»òÕßÓò¹ÜÀíÔ±,´Ëʱ×Ô¶¯³ÉΪSQL ServerµÄ¹ÜÀíÔ±;
ÔÚ²éѯ·ÖÎöÆ÷´°¿ÚÖÐÊäÈëÏÂÃæµÄÓï¾äÖ±½Ó¸ü¸ÄSAÃÜÂë:
EXEC sp_password Null,'','sa'
ÔËÐкósaµÄÃÜÂë±äΪ¿Õ¡£
×¢£ºsp_password´æ´¢¹ý³ÌµÄ¹¦ÄÜÊǸü¸ÄSQL ServerµÇ¼µÄÃÜÂë;
Óï·¨¸ñʽ:
sp_password [ [ @old = ] \'old_password\' , ]
{ [ @new =] \'new_password\' }
[ , [ @loginame = ] \'login\' ]
²ÎÊý˵Ã÷
[@old =] \'old_password\' : ¾ÉÃÜÂë;
[@new =] \'new_password\' : ÒªÖ¸¶¨µÄÐÂÃÜÂë
[@loginame =] \'login\' : ÒªÖ¸¶¨µÄÓû§
·µ»ØÖµ: 0£¨³É¹¦£©»ò 1£¨Ê§°Ü£©
ÒÔÉÏ·½·¨µÄ¹Ø¼üÔÀíÔÚÓÚ,´Ó"²éѯ·ÖÎöÆ÷"ÖÐÒÔ"WindowsÉí·ÝÑéÖ¤"Á¬½ÓSQL Server,Ö»ÒªÄãÊDZ¾»úµÄϵͳ¹ÜÀíÔ±»òÕßÓò¹ÜÀíÔ±,´Ëʱ×Ô¶¯³ÉΪSQL ServerµÄ¹ÜÀíÔ±.
2>ÐÞ¸ÄSQL Server 2000 ºÍ SQL Server 7.0¾ö¶¨SQL ServerÉí·ÝÑé֤ģʽµÄ×¢²á±í¼üÖµ¡£
ÔÚSQL Server 7.0ÖУ¬¸Ã¼üΪ£º HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft \MSSQLServer\MSSQLServer\LoginMode
ÔÚSQL Server 2000ÖУ¬¸Ã¼üΪ£º HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MicrosoftSQLServer\\MSSQLServer\LoginMode
“LoginMode”µÄֵΪ0±íʾֻ½øÐÐWindows µÄÉí·ÝÑéÖ¤£¬Îª1±íʾÑé֤ģʽΪ»ìºÏģʽ¡£ÔÚÄú°Ñ×Ô¼º¹ØÔÚÍâÃæÖ®ºó£¬Äú¿ÉÒÔ°Ñ“LoginMode”¸ÄΪ1£¬ÖØÐÂÆô¶¯SQL Server£¬È»ºóÒÔsa£¨system administrator£©Éí·ÝµÇ¼£¬ÊäÈëÄúÖªµÀµÄsaÃÜÂë¼´¿É¡£
×¢£ºÒÔϹØÓÚSQL ServerµÄ½ÇÉ«³ÉÔ±µÄÐÅÏ¢¿ÉÄÜ»á°ïÖúÄúÀí½âΪʲôÄú»á°Ñ×Ô¼º¹ØÔÚSQLServerÍâÃæ¡£ÔÚÄú°²×°SQL Server 2000 »ò 7.0µÄʱºò£¬°²×°½ø³Ì×Ô¶¯µØΪ“BUILTIN\Administrators”´´½¨Ò»¸öµÇ¼Õʺţ¬¸ÃÕʺÅΪ“sysadmin”½ÇÉ«³ÉÔ±¡£“BUILTIN\Administrators”µÇ¼ÕʺŴú±íÁËMicrosoft Windows 2000 »òMicrosoft Windows NT server ÉϵÄϵͳ¹ÜÀíÔ±±¾µØ×é¡£ Windows 2000 »ò Windows NTµÄ “Administrator”ÕÊ»§ÊÇϵͳ¹ÜÀíÔ±±¾µØ×éµÄ³ÉÔ±¡£´ËÍ⣬Èç¹ûÄúµÄ·þÎñÆ÷ÊÇÒ»¸öÓòµÄ³ÉÔ±£¨°üÀ¨Windows
Ïà¹ØÎĵµ£º
ÔÒò·ÖÎö:
SERVERPROPERTY º¯ÊýµÄ ServerName ÊôÐÔÓë@@SERVERNAME ·µ»ØÏàËƵÄÐÅÏ¢¡£ServerName ÊôÐÔÌṩWindows ·þÎñÆ÷ºÍʵÀýÃû³Æ£¬Á½Õß¹²Í¬¹¹³ÉΨһµÄ·þÎñÆ÷ʵÀý£»@@SERVERNAME Ìṩµ±Ç°ÅäÖõı¾µØ·þÎñÆ÷Ãû³Æ¡£
Èç¹û°²×°Ê±Î´¸ü¸ÄĬÈÏ·þÎñÆ÷Ãû³Æ£¬Ôò ServerName ÊôÐÔºÍ @@SERVERNAME ·µ»ØÏàͬµÄÐÅÏ¢¡£Èç¹ûÔÚ°²×°Ê±Òѽ«±¾µ ......
1£ºexec sp_addlinkedserver 'ITSV ', ' ', 'SQLOLEDB ', '192.168.*.12'
exec sp_addlinkedsrvlogin 'ITSV ', 'false ',null, 'sa ', 'F00000'
2£º
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', ......
SQL Server Ë÷Òý½á¹¹¼°ÆäʹÓ㨶þ£©
×÷Õߣºfreedk
Ò»¡¢ÉîÈëdz³öÀí½âË÷Òý½á¹¹
¸ÄÉÆSQLÓï¾ä
¡¡¡¡ºÜ¶àÈ˲»ÖªµÀSQLÓï¾äÔÚSQL SERVERÖÐÊÇÈçºÎÖ´Ðеģ¬ËûÃǵ£ÐÄ×Ô¼ºËùдµÄSQLÓï¾ä»á±»SQL SERVERÎó½â¡£±ÈÈ磺
select * from table1 where name=''zhangsan'' and tID > 10000
ºÍÖ´ÐÐ:
select * from table1 where tID ......
ÆÕͨÐÐÁÐת»»
ÎÊÌ⣺¼ÙÉèÓÐÕÅѧÉú³É¼¨±í(tb)ÈçÏÂ:
ÐÕÃû ¿Î³Ì ·ÖÊý
ÕÅÈý ÓïÎÄ 74
ÕÅÈý Êýѧ 83
ÕÅÈý ÎïÀí 93
ÀîËÄ ÓïÎÄ 74
ÀîËÄ Êýѧ 84
ÀîËÄ ÎïÀí 94
Ïë±ä³É(µÃµ½ÈçϽá¹û)£º
ÐÕÃû ÓïÎÄ Êýѧ ÎïÀí
---- ---- ---- ----
ÀîËÄ 74 84 94
ÕÅÈý 74 83 93
-------------------
*/
create table tb(ÐÕÃû varc ......
use test
go
if exists table student is not null
else
drop table student
go
create table database_name.schema_name.table_name
(ÊôÐÔ1 ×Ö·ûÀàÐÍ Ô¼Êø£¬
ÊôÐÔ2 ×Ö·ûÀàÐÍ Ô¼Êø....
)
go
insert into table_name values ('ÊôÐÔ1’£¬‘ÊôÐÔ2’£¬......£©
--²å ......