sql ·þÎñÆ÷½ÇÉ« Êý¾Ý¿â½ÇÉ«
sql ·þÎñÆ÷½ÇÉ« Êý¾Ý¿â½ÇÉ«
·þÎñÆ÷½ÇÉ«
ËùÓеķþÎñÆ÷½ÇÉ«¶¼ÊÇ“¹Ì¶¨µÄ”½ÇÉ«£¬²¢ÇÒ£¬´ÓÒ»¿ªÊ¼¾Í´æÔÚÓÚÄÇÀï——×Ô°²×°ÍêSQL ServerµÄÄÇÒ»¿ÌÆð£¬Ä㽫ӵÓеÄËùÓзþÎñÆ÷½ÇÉ«¾ÍÒѾ´æÔÚÁË¡£
½Ç¡¡¡¡É«
ÌØ¡¡¡¡ÐÔ
sysadmin
¸Ã½ÇÉ«Äܹ»Ö´ÐÐSQL ServerÉϵÄÈκβÙ×÷¡£±¾ÖÊÉÏ£¬ÈκξßÓÐÕâÖÖ½ÇÉ«³ÉÔ±Éí·ÝµÄÈ˶¼ÊÇÄǸö·þÎñÆ÷ÉϵÄsa¡£ÕâÖÖ·þÎñÆ÷½ÇÉ«µÄ´´½¨ÎªÎ¢ÈíÌṩÁËijһÌìÈ¥³ýsaµÇ¼µÄÄÜÁ¦——ʵ¼ÊÉÏ£¬Áª»ú´ÔÊé°Ñsa³Æ×÷±¾ÖÊÉÏΪÒÅÁôÎïµÄ¶«Î÷
Öµ
µÃ×¢ÒâµÄÊÇ£¬ÔÚSQL
ServerÉÏ£¬WindowsµÄAdministrators×é±»×Ô¶¯Ó³Éäµ½sysadmin½ÇÉ«ÖС£ÕâÒâζ×Å·þÎñÆ÷µÄAdministrators×é
ÖеÄÈκγÉԱͬʱҲ¾ßÓжÔSQLÊý¾ÝµÄsa¼¶±ðµÄ·ÃÎÊȨÏÞ¡£Èç¹ûÐèÒª£¬Äã¿ÉÒÔ´Ósysadmin½ÇÉ«ÖÐɾ³ýWindowsµÄadministrators
×飬ÒÔÌá¸ß°²È«ÐÔ¡¢·À·¶Â©¶´
serveradmin
¸Ã½ÇÉ«ÄÜÉèÖ÷þÎñÆ÷·¶Î§µÄÅäÖÃÑ¡Ïî»ò¹Ø±Õ·þÎñÆ÷¡£¾¡¹ÜËüÔÚ·¶Î§ÉÏÏ൱ÓÐÏÞ£¬µ«ÊÇ£¬ÓɸýÇÉ«µÄ³ÉÔ±Ëù¿ØÖƵŦÄܶÔÓÚ·þÎñÆ÷µÄÐÔÄÜ»á²úÉú·Ç³£ÖØ´óµÄÓ°Ïì
setupadmin
¸Ã½ÇÉ«½öÏÞÓÚ¹ÜÀíÁ´½Ó·þÎñÆ÷ºÍÆô¶¯¹ý³Ì
securityadmin
¶ÔÓÚרÃÅ´´½¨³öÀ´ÓÃÓÚ¹ÜÀíµÇ¼Ãû¡¢¶ÁÈ¡´íÎóÈÕÖ¾ºÍ´´½¨Êý¾Ý¿âÐí¿ÉȨÏ޵ĵǼÃûÀ´Ëµ£¬¸Ã½ÇÉ«·Ç³£±ãÀû¡£Ôںܶ෽Ã棬¸Ã½ÇÉ«ÊǵäÐ͵Äϵͳ²Ù×÷Ô±½ÇÉ«——ËüÄܹ»´¦Àí¶àÊýµÄÈÕ³£ÊÂÎñ£¬µ«ÊÇ£¬È´²»¾ß±¸Ò»¸öÕæÕýÎÞËù²»Äܵij¬¼¶Óû§ËùÓµÓеÄÄÇÖÖÈ«¾Ö·ÃÎÊ
processadmin
Äܹ»¹ÜÀíSQL ServerÖÐÔËÐеĽø³Ì——±ØÒªµÄ»°£¬¸Ã½ÇÉ«Äܹ»ÖÕÖ¹³¤Ê±¼äÔËÐеĽø³Ì
dbcreator
¸Ã½ÇÉ«½öÏÞÓÚ´´½¨ºÍ¸ü¸ÄÊý¾Ý¿â
diskadmin
¹ÜÀí´ÅÅÌÎļþ£¨Ö¸ÅɸøÁËʲôÎļþ×é¡¢¸½¼ÓºÍ·ÖÀëÊý¾Ý¿â£¬µÈµÈ£©
bulkadmin
¸Ã
½ÇÉ«ÓÐЩ¹ÖÒì¡£Ëü±»Ã÷È·´´½¨³öÀ´£¬ÓÃÓÚÖ´ÐÐBULK INSERTÓï¾äµÄȨÏÞ£¬·ñÔòµÄ»°£¬Ö»ÄÜÓɾßÓÐsysadminȨÏÞµÄÈËÀ´Ö´ÐÐBULK
INSERTÓï¾ä¡£Ì¹°×µØ˵£¬ÎÒ²»Ã÷°×Ϊʲô¸ÃÓï¾ä²»ÄÜÏñÆäËûÊÂÇéÄÇÑùͨ¹ýGRANTÃüÁîÀ´ÊÚÓèȨÏÞ£¬µ«ËüµÄȷûÓС£Òª¼Çס£¬¼´Ê¹°ÑÒ»¸öÓû§¼ÓÈëµ½ÁË
bulkadmin×éÖУ¬Ò²Ö»ÊǸøÁËËûÃÇ·ÃÎÊÄǸöÓï¾äµÄȨÏÞ£¬¶ÔÓÚÔËÐиÃÓï¾äµÄ±í£¬²¢Ã»ÓÐÊÚÓèÓû§·ÃÎÊÄǸö±íµÄȨÏÞ¡£ÕâÒâζ×Ų»½öÐèÒª°ÑÓû§Ìí¼Óµ½
bulkadminÖУ¬¶øÇÒ£¬¶ÔÓÚÏëÒªÓû§ÄÜÔÚÆäÉÏÖ´ÐÐBULK
INSERTµÄ±í£¬»¹ÒªÊÚÓ裨GRANT£©Óû§INSERTÐí¿ÉȨÏÞ¡£´ËÍ⣬¶ÔÓÚ½«ÔÚBULK
INSERTÓï¾äÖÐÒýÓõÄËùÓÐ±í£¬»¹ÒªÈ·±£Óû§ÓµÓÐÕýÈ·µÄµ½ÄÇЩ±íµÄSELECT·ÃÎÊȨÏÞ
¶ÔÓÚÔÚ·þÎñÆ÷Éϳе£¹
Ïà¹ØÎĵµ£º
ÅжÏÊý¾Ý¿âÀàÐÍ
(select count(*) fromsysobjects)>0 //sqlÊý¾Ý¿â
(select count(*) from msysobjects)>0 //accessÊý¾Ý¿â
µÃµ½SqlÓû§Ãû
user>0
Conversion failed when converting the nvarchar value 'dbo' to data type int.
Öع¹SQLÓï¾ä
ÕûÊýÐÍ
(A) ID=49 ID=49 And [ ²éѯÌõ¼þ] £¬¼´Ê ......
ÔÚ°²×°SQL Server 2005¿ª·¢°æʱ³öÏÖÎÊÌâ¡£°²×°»·¾³Îªwindows xp sp3£¬°²×°Óû§Ê¹Ó󬼶¹ÜÀíÔ±£¨Administrator£©¡£³öÏֵĴíÎóÊÇ
ÔÚ°²×°“Integration Services”²½Öèʱ³öÏÖ°²×°´íÎó£¬Ìáʾ“´íÎó: -2146233087”¡£
´íÎó¼Ç¼
±êÌâ:
Microsoft SQL Server 2005 °²×°³ÌÐò
ÎÞ·¨ÔÚ COM+ Ŀ¼Öа²×°ºÍÅäÖ ......
Ò»¸ö¼òµ¥µÄÀý×Ó£º
ÏȽ¨Ò»¸öC#Àࣺ
ÒýÓÃSystem.Data.Linq.dll³ÌÐò¼¯£¬
using System.Data.Linq.MappingºÍ
using System.Data.Linq Á½¸ö¿Õ¼ä¡£
[Table]
public class Inventory
{
[Column]
public string Make;
[Column]
public string Color;
&nbs ......
CONVERT
½«Ä³ÖÖÊý¾ÝÀàÐ͵ıí´ïʽÏÔʽת»»ÎªÁíÒ»ÖÖÊý¾ÝÀàÐÍ¡£ÓÉÓÚijЩÐèÇó¾³£Óõ½È¡ÈÕÆÚ¸ñʽµÄ²»Í¬.ÏÖÒÔÏ¿ÉÔÚ
SQL ServerÖÐ ½«ÈÕÆÚ¸ñʽ»¯.
SQL Server Ö§³ÖʹÓÿÆÍþÌØËã·¨µÄ°¢À²®ÑùʽÖеÄÊý¾Ý¸ñʽ¡£
ÔÚ±íÖУ¬×ó²àµÄÁ½Áбíʾ½« datetime »ò smalldatetime ת»»Îª×Ö·ûÊý¾ÝµÄ style Öµ¡£¸ø style Öµ¼Ó 100£¬¿É»ñµÃ°ü ......
ÓÃsql²Ù×÷oracleµÄblob×Ö¶Î
1¡¢²éѯ
select utl_raw.cast_to_varchar2(dlob),id from system.t_htinfo
2¡¢²åÈë
insert into system.t_htinfo values ('3',utl_raw.cast_to_raw('Äã'));
3¡¢¸üÐÂ
update system.t_htinfo set fld_value=utl_raw.cast_to_raw('1') where fh_nm=1820648 and form_index=52
......