Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : sql

´ÓExcelµ¼ÈëSQL SERVERÊý¾Ý¿â


Õâ´ÎÏîÄ¿ÊÇÒ»¸ö¾­·Ñ¹ÜÀíϵͳ£¬Éæ¼°µÄÊý¾Ý¿â¼Ç¼Êý³¬³öÁËÒÔÇ°×ö¹ýµÄ£¬Ã¿´Î×îÉÙ¶¼Òª´ÓEXCELµ¼ÈëÊý¾Ý¿â¼¸Ç§ÉÏÍòÌõÊý¾Ý£¬µÚÒ»´ÎʹÓÃÒ»°ãµÄ·½·¨£¬Ö´ÐÐSQLÓï¾ä£¬ÔËÓÃforÑ­»·Ò»ÌõÒ»ÌõµÄ²åÈ룬Öظ´Êý¾ÝҲʹÓóÌÐòÅжϣ¬ºóÀ´½»¸¶µÄʱºò³öÎÊÌâÁË£¬Ò»´Î³¬¹ýÒ»¶¨ÌõÊýµÄ¼Ç¼£¬Ö±½Óʧ°Ü£¬ÕâÃ÷ÏÔÊÇЧÂʵÄÎÊÌâ¡£´ÓÍøÂçÉÏÕÒÁËһϣ¬·¢ÏÖÁËÒ»¸ö´ÓÀ´Ã»ÓùýµÄÀàSqlBulkCopy   ÕâÀïÓÐÏêϸµÄ˵Ã÷£¬ÎҾͲ»ËµÁËhttp://msdn.microsoft.com/zh-cn/library/system.data.sqlclient.sqlbulkcopy(VS.80).aspx
 
½Ó×ÅÎÒʹÓÃÕâ¸ö·½·¨µ¼ÈëÊý¾Ý
 
Ê×ÏÈ´ÓEXCEL¶ÁÈ¡Êý¾Ý µ½dataset 
public DataSet GetXlsContent(string SheetName, string FileName)
{
            tbDataBaseModel tbdbModel = new tbDataBaseModel();
            DataSet ds = new DataSet();
            //string Path = File.Replace(@"\\", @"\");
            / ......

×÷ºÃSQLµÄ°²È«¹ÜÀí

exec sp_dropsrvrolemember N'aa', sysadmin
go
exec sp_addsrvrolemember N'aa', securityadmin
go
--×÷ºÃSQLµÄ°²È«¹ÜÀí
--×÷Õß:×Þ½¨
Ê×ÏÈ,×öºÃÓû§°²È«: 
--¼òµ¥µÄ,Ö»ÔÊÐísqlµÄÓû§·ÃÎÊsql(·ÀÖ¹ÀûÓÃadministrator×éÓû§·ÃÎÊ) 
1.ÆóÒµ¹ÜÀíÆ÷--ÓÒ¼üSQLʵÀý--ÊôÐÔ--°²È«ÐÔ--Éí·ÝÑéÖ¤--Ñ¡Ôñ"sql  serverºÍwindows"--È·¶¨ 
2.ÆóÒµ¹ÜÀíÆ÷--°²È«ÐÔ--µÇ½--ÓÒ¼üsa--ÉèÖÃÃÜÂë--ÆäËûÓû§Ò²ÉèÖÃÃÜÂë 
3.ɾ³ýÓû§: 
           BUILTIN\Administrators 
           <»úÆ÷Ãû>\Administrator  --Õâ¸öÓû§²»Ò»¶¨ÓР
   ÕâÑù¿ÉÒÔ·ÀÖ¹ÓÃwindowsÉí·ÝµÇ½SQL 
4.ÉèÖýøÈëÆóÒµ¹ÜÀíÆ÷ÐèÒªÊäÈëÃÜÂë 
ÔÚÆóÒµ¹ÜÀíÆ÷ÖР
           --ÓÒ¼üÄãµÄ·þÎñÆ÷ʵÀý(¾ÍÊÇÄǸöÓÐÂÌɫͼ±êµÄ) 
           --±à¼­SQL Server×¢²áÊôÐÔ 
      &nb ......

sqlÊý×ÖתӢÎÄ

create function decodehundred(@hundredstring varchar(300) )
returns  varchar(1000)
as
begin
declare  @tmp varchar(1000),@decodehundred varchar(1000)
set @decodehundred = ''
declare @strno1 varchar(1000)
select  @strno1 = 'One       Two       Three     Four      Five      ' +
                  'Six       Seven     Eight     Nine      Ten       ' +
                  'Eleven    Twelve    Thirteen  Fourteen  Fifteen   '+
              ......

mysql5µÄ×Ö·û¼¯ºÍsql modeÎÊÌâ

http://hi.baidu.com/gushu/blog/item/3e821c174eabec064a90a7d4.html
mysql5Ìí¼ÓÁËһЩÐµĹ¦ÄܵĹæÔò£¬ÆäÖжԿªÔ´³ÌÐòÓ°Ïì±È½Ï´óµÄÓÐÁ½¸ö£¬Ò»¸öÊÇ4.0.12+¿ªÊ¼µÄ4²ã´Î×Ö·û¼¯£¬Ò»¸öÊÇ5.0.18¿ªÊ¼µÄĬÈÏstrict mode¡£
¶ÔÓÚÕâÁ½¸öÎÊÌ⣬ЧÂÊ×îºÃµÄ½â¾ö·½°¸£¬¾ÍÊÇÖ±½ÓÐÞ¸Ämy.ini
# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=utf8
#ÕâÀï¸Ä³Éutf-8
# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES£¬ NO_AUTO_CREATE_USER£¬ NO_ENGINE_SUBSTITUTION"
#ÕâÀï¸Ä³É=""
µ±ÄãûÓÐȨÏÞ½øÐÐÐÞ¸Äʱ£¬¾ÍÖ»ºÃÔÚ³ÌÐòÖÐÅжÏÁËmysql5 й¦ÄÜ£¬±ØÐëÔÚÿ´ÎÁ¬½ÓÉÏÊý¾Ý¿âʱ½øÐÐÉ趨¡£ÔÚʹÓÃÁËÊý¾Ý¿â³éÏó²ãµÄ³ÌÐòÖÐÐÞ¸ÄÆðÀ´Ò²ºÜ¼òµ¥£º
if(mysql_get_server_info( $connect ) > '4.0.1')
{
mysql_query( "set names 'utf8'" £¬ $connect );
}
if(mysql_get_server_info( $connect ) > '5.0.1')
{
mysql_query("SET sql_mode=''" £¬ $connect );
}
......

mysql5µÄ×Ö·û¼¯ºÍsql modeÎÊÌâ

http://hi.baidu.com/gushu/blog/item/3e821c174eabec064a90a7d4.html
mysql5Ìí¼ÓÁËһЩÐµĹ¦ÄܵĹæÔò£¬ÆäÖжԿªÔ´³ÌÐòÓ°Ïì±È½Ï´óµÄÓÐÁ½¸ö£¬Ò»¸öÊÇ4.0.12+¿ªÊ¼µÄ4²ã´Î×Ö·û¼¯£¬Ò»¸öÊÇ5.0.18¿ªÊ¼µÄĬÈÏstrict mode¡£
¶ÔÓÚÕâÁ½¸öÎÊÌ⣬ЧÂÊ×îºÃµÄ½â¾ö·½°¸£¬¾ÍÊÇÖ±½ÓÐÞ¸Ämy.ini
# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=utf8
#ÕâÀï¸Ä³Éutf-8
# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES£¬ NO_AUTO_CREATE_USER£¬ NO_ENGINE_SUBSTITUTION"
#ÕâÀï¸Ä³É=""
µ±ÄãûÓÐȨÏÞ½øÐÐÐÞ¸Äʱ£¬¾ÍÖ»ºÃÔÚ³ÌÐòÖÐÅжÏÁËmysql5 й¦ÄÜ£¬±ØÐëÔÚÿ´ÎÁ¬½ÓÉÏÊý¾Ý¿âʱ½øÐÐÉ趨¡£ÔÚʹÓÃÁËÊý¾Ý¿â³éÏó²ãµÄ³ÌÐòÖÐÐÞ¸ÄÆðÀ´Ò²ºÜ¼òµ¥£º
if(mysql_get_server_info( $connect ) > '4.0.1')
{
mysql_query( "set names 'utf8'" £¬ $connect );
}
if(mysql_get_server_info( $connect ) > '5.0.1')
{
mysql_query("SET sql_mode=''" £¬ $connect );
}
......

sql serverÖÐ×Ö·û´®ÀàÐ͵ÄÈÕÆÚÈçºÎ±È½Ï´óС

Èç¹ûÔÚÊý¾Ý¿â£¨sql£©Öн«±£´æÈÕÆÚµÄ×ֶεÄÊý¾ÝÀàÐÍÉèÖÃΪvarchar£¬¶øÄãÓÖÐèÒª¶ÔÕâ¸öÈÕÆÚºÍÁíÍâÒ»¸öÈÕÆÚ½øÐбȽϣ¬ÄÇô¸ÃÔõô°ìÄØ£¿
1. µÚÒ»ÖÖ·½·¨ºÜÈÝÒ×Ïëµ½£¬¾ÍÊÇ´¿´âµØÀûÓÃ×Ö·û´®À´±È½Ï´óС£¬±ÈÈçÓÐÒ»¸ö×Ö¶ÎΪadddate,ÆäÊý¾ÝÀàÐÍΪvarchar£¬Òª±È½ÏÕâ¸öÈÕÆÚÊDz»ÊÇ´óÓÚij¸öÈÕÆÚ£¬±ÈÈç"2006-12-23",ÄÇô¿ÉÒÔÖ±½Óд£º
where adddate>'2006-12-23'£¬ÕâÖз½·¨ºÜÖ±¹Û£¬µ±È»Ò²ÐèÒªÔÚ¸ñʽÉÏÓÐËù¹æ·¶£¬±ÈÈ磬Èç¹ûÈÕÆÚÊÇ2006Äê3ÔÂ3ÈÕ£¬¾Í±ØÐ뽫ÈÕÆÚ±£´æΪ2006-03-03£¬·ñÔò±È½ÏµÄʱºòÈÝÒ׳ö´í¡£
2. µÚ¶þÖÖ·½·¨Ôò¿ÉÒÔÀûÓÃsqlÌṩµÄÈÕÆÚת»»º¯ÊýÁË¡£
CONVERT (<data_ type>[ length ]£¬ <expression> [£¬ style])
1£©data_typeΪSQL Serverϵͳ¶¨ÒåµÄÊý¾ÝÀàÐÍ£¬Óû§×Ô¶¨ÒåµÄÊý¾ÝÀàÐͲ»ÄÜÔÚ´ËʹÓá£
2£©lengthÓÃÓÚÖ¸¶¨Êý¾ÝµÄ³¤¶È£¬È±Ê¡ÖµÎª30¡£
3£©ÓÃCONVERT£¨£© º¯ÊýµÄstyle Ñ¡ÏîÄÜÒÔ²»Í¬µÄ¸ñʽÏÔʾÈÕÆÚºÍʱ¼ä¡£style Êǽ«DATATIME ºÍSMALLDATETIME Êý¾Ýת»»Îª×Ö·û´®Ê±ËùÑ¡ÓõÄÓÉSQL Server ϵͳÌṩµÄת»»Ñùʽ±àºÅ£¬²»Í¬µÄÑùʽ±àºÅÓв»Í¬µÄÊä³ö¸ñʽ¡£
Èç¹ûÓÃÕâÖÖ·½·¨À´ÅжÏijһ¸ö×ֶεĻ°£¬Ôò´æÈëµÄÈÕÆÚ×ֶεÄ×Ö·û´®¸ñʽֻҪÊÇÄÜÈÃsql serverÍê³É¶ÔÈÕÆÚµÄת»»¾Í¿ ......

SQL Server 2000°²×°¹ÒÆðµÄ´¦Àí

¹ØÓÚSQL°²×°±»¹ÒÆðµÄÐÞ¸´´ó¼Ò¿ÉÄܶ¼Óöµ½¹ýµ±SQL±»É¾³ýºóÐèÒªÖØа²×°Ê±£¬½øÈë°²×°½çÃæ¾Í»á³öÏÖSQL´íÎóÌáʾ£º ´ÓÇ°µÄ°²×°³ÌÐò²Ù×÷ʹ°²×°³ÌÐò²Ù×÷¹ÒÆð£¬ÐèÒªÖØÐÂÆô¶¯¼ÆËã»ú
È»¶øÕâЩ¶¼Êǰ׷Ѿ¢£¬²»¹ÜÄãÖØÐÂÆô¶¯¶àÉÙ´ÎÒ²¶¼ÎÞ¼ÃÓÚÊ£¬ÏÂÃæÎҾͽ²½²ÔõÑùÄܹ»½â³ý°²×°»òÉý¼¶Ê±Îļþ±»¹ÒÆðµÄ²Ù×÷¡£
µã»÷ ¿ªÊ¼ ÔËÐÐ ÊäÈ룺regedit ´ò¿ª×¢²á±íÕÒµ½ÈçÏÂĿ¼HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Managerɾ³ýPendingFileRenameOperations
ÔÙÀ´°²×°SQLÒ»ÇÐÕý³£Èç³õÁË£¡Ï£ÍûÕâЩÄÜÓÐÒ»µãµã°ïÖú£¬´Ó´ËÔÙÒ²²»ÓÃäĿµÄÖØа²×°ÏµÍ³ÁË¡£ ......
×ܼǼÊý:4346; ×ÜÒ³Êý:725; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [716] [717] [718] [719] [720] [721] [722] [723] 724 [725]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ