SQL×Ö·û´®´¦Àíº¯Êý»ã×Ü
Ò»¡¢×Ö·ûת»»º¯Êý
1¡¢ASCII()
·µ»Ø×Ö·û±í´ïʽ×î×ó¶Ë×Ö·ûµÄASCII ÂëÖµ¡£ÔÚASCII£¨£©º¯ÊýÖУ¬´¿Êý×ÖµÄ×Ö·û´®¿É²»ÓÑ’À¨ÆðÀ´£¬µ«º¬ÆäËü×Ö·ûµÄ×Ö·û´®±ØÐëÓÑ’À¨ÆðÀ´Ê¹Ó㬷ñÔò»á³ö´í¡£
2¡¢CHAR()
½«ASCII Âëת»»Îª×Ö·û¡£Èç¹ûûÓÐÊäÈë0 ~ 255 Ö®¼äµÄASCII ÂëÖµ£¬CHAR£¨£© ·µ»ØNULL ¡£
3¡¢LOWER()ºÍUPPER()
LOWER()½«×Ö·û´®È«²¿×ªÎªÐ¡Ð´£»UPPER()½«×Ö·û´®È«²¿×ªÎª´óд¡£
4¡¢STR()
°ÑÊýÖµÐÍÊý¾Ýת»»Îª×Ö·ûÐÍÊý¾Ý¡£
STR (<float_expression>[£¬length[£¬ <decimal>]])
length Ö¸¶¨·µ»ØµÄ×Ö·û´®µÄ³¤¶È£¬decimal Ö¸¶¨·µ»ØµÄСÊýλÊý¡£Èç¹ûûÓÐÖ¸¶¨³¤¶È£¬È±Ê¡µÄlength ֵΪ10£¬ decimal ȱʡֵΪ0¡£
µ±length »òÕßdecimal Ϊ¸ºÖµÊ±£¬·µ»ØNULL£»
µ±length СÓÚСÊýµã×ó±ß£¨°üÀ¨·ûºÅ룩µÄλÊýʱ£¬·µ»Ølength ¸ö*£»
ÏÈ·þ´Ólength £¬ÔÙÈ¡decimal £»
µ±·µ»ØµÄ×Ö·û´®Î»ÊýСÓÚlength £¬×ó±ß²¹×ã¿Õ¸ñ¡£
¶þ¡¢È¥¿Õ¸ñº¯Êý
1¡¢LTRIM() °Ñ×Ö·û´®Í·²¿µÄ¿Õ¸ñÈ¥µô¡£
2¡¢RTRIM() °Ñ×Ö·û´®Î²²¿µÄ¿Õ¸ñÈ¥µô¡£
Èý¡¢È¡×Ó´®º¯Êý
1¡¢left()
LEFT (<character_expression>£¬ <integer_expression>)
·µ»Øcharacter_expression ×óÆð integer_expression ¸ö×Ö·û¡£
2¡¢RIGHT()
RIGHT (<character_expression>£¬ <integer_expression>)
·µ»Øcharacter_expression ÓÒÆð integer_expression ¸ö×Ö·û¡£
3¡¢SUBSTRING()
SUBSTRING (<expression>£¬ <starting_ position>£¬ length)
·µ»Ø´Ó×Ö·û´®×ó±ßµÚstarting_ position ¸ö×Ö·ûÆðlength¸ö×Ö·ûµÄ²¿·Ö¡£
ËÄ¡¢×Ö·û´®±È½Ïº¯Êý
1¡¢CHARINDEX()
·µ»Ø×Ö·û´®ÖÐij¸öÖ¸¶¨µÄ×Ó´®³öÏֵĿªÊ¼Î»Öá£
CHARINDEX (<’substring_expression’>£¬ <expression>)
ÆäÖÐsubstring _expression ÊÇËùÒª²éÕÒµÄ×Ö·û±í´ïʽ£¬expression ¿ÉΪ×Ö·û´®Ò²¿ÉΪÁÐÃû±í´ïʽ¡£Èç¹ûûÓз¢ÏÖ×Ó´®£¬Ôò·µ»Ø0 Öµ¡£
´Ëº¯Êý²»ÄÜÓÃÓÚTEXT ºÍIMAGE Êý¾ÝÀàÐÍ¡£
2¡¢PATINDEX()
·µ»Ø×Ö·û´®ÖÐij¸öÖ¸¶¨µÄ×Ó´®³öÏֵĿªÊ¼Î»Öá£
PATINDEX (<’%substring _expression%’>£¬ <column_ name>)ÆäÖÐ×Ó´®±í´ïʽǰºó±ØÐëÓаٷֺœ%”·ñÔò·µ»ØֵΪ0¡£
ÓëCHARINDEX º¯Êý²»Í¬µÄÊÇ£¬PATINDEXº¯ÊýµÄ×Ó´®ÖпÉÒÔʹÓÃͨÅä·û£¬ÇҴ˺¯Êý¿ÉÓÃÓÚCHAR¡¢ VARCHAR ºÍTEXT Êý¾ÝÀàÐÍ¡£
Îå¡¢×Ö·û´®²Ù×÷º¯Êý
1¡
Ïà¹ØÎĵµ£º
1.SQL SERVERµÄÊý¾ÝÀàÐÍ
¡¡¡¡Êý¾ÝÀàŪÊÇÊý¾ÝµÄÒ»ÖÖÊôÐÔ£¬±íʾÊý¾ÝËù±íʾÐÅÏ¢µÄÀàÐÍ¡£ÈκÎÒ»ÖÖ¼ÆËã»úÓïÑÔ¶¼¶¨ÒåÁË×Ô¼ºµÄÊý¾ÝÀàÐÍ¡£µ±È»£¬²»Í¬µÄ³ÌÐòÓïÑÔ¶¼¾ßÓв»Í¬µÄÌص㣬Ëù¶¨ÒåµÄÊý¾ÝÀàÐ͵ĸ÷ÀàºÍÃû³Æ¶¼»ò¶à»òÉÙÓÐЩ²»Í¬¡£SQLServer ÌṩÁË 25 ÖÖÊý¾ÝÀàÐÍ£º
¡¡¡¡·Binary [(n)]
¡¡¡¡·Varbinary [(n)]
¡¡ ......
SQL Server7.0Êý¾Ý¿â£ºÊý¾Ý²Ö¿â¡¢Êý¾Ý¸´ÖÆ¡¢·Ö²¼Ê½Êý¾Ý¿âÓ¦ÓóÌÐò¡¢IntelnetºÍIntranetÓ¦Óú͹ÜÀí¹¤¾ß£»
°²×°¼ì²â£º1¡¢net start mssqlsever;
2¡¢osql /usa /p ;
......
protected void Button1_Click(object sender, EventArgs e)
{
string strsql = "select * from TreeViewTemp where parentID=0";
DataTable dt = db.GetDataTable(strsql);
StringWriter sw = new StringWriter();
//StreamWriter sw = new Strea ......
--
SQL Server Splitº¯Êý
--
Author:zc_0101
--
˵Ã÷£º
--
Ö§³Ö·Ö¸î·û¶à×Ö½Ú
--
ʹÓ÷½·¨
--
Select * from DBO.F_SQLSERVER_SPLIT('1203401230105045','0')
--
select * from DBO.F_SQLSERVER_SPLIT('abc1234a12348991234',' ......
**************************************
**** sql ²éѯ±¸Íü &nb ......