sqlServerÖеÄ×ÔÔö×Ö¶Î
SQLÓï¾äÈçÏÂ:
CREATE TABLE [dbo].[test_table] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[NAME] [varchar] (80)
)
Éè¼ÆÊÓͼÏÂ,ÔÚÌí¼ÓÒ»¸öINTÐ͵Ä×Ö¶ÎÊÇ,Ñ¡ÖÐÏ·½µÄ"±êʶ"Ϊ"ÊÇ",ÏÂÃæÓÐ"±êʶÖÖ×Ó"ºÍ"±êʶ×ÔÔöÁ¿",¿ÉÒÔ×Ô¼ºÉèÖÃ,ĬÈ϶¼Îª1
µ«ÊDz»ÖªµÀΪʲô,ʹÓÃÈÎÎñÖеĵ¼ÈëÊý¾Ý½«AÊý¾Ý¿âÖеÄÊý¾Ýµ¼µ½BÊý¾Ý¿âÖеÄʱºò,Õâ¸ö×ֶεÄ×ÔÔöÉèÖþÍûÓÐÁË,WHY?
ÁíÍâ:¿ÉÒÔʹÓô¥·¢Æ÷ʵÏÖ×Ö·û´®µÄ×Ô¶¯Ôö¼ÓµÈ.
×Ô¼ºÕâ·½ÃæµÄ¶«Î÷ÖªµÀµÄÌ«ÉÙÁË.ÏëÀ´×Ô¼º¶ÔÊý¾Ý¿âµÄÁ˽âÒ²¾ÍÊǸöƤëµÄƤë!
Ïà¹ØÎĵµ£º
SQL ServerÊý¾Ý¿âÉè¼Æ±íºÍ×Ö¶Î
1. Ôʼµ¥¾ÝÓëʵÌåÖ®¼äµÄ¹Øϵ
¡¡¡¡¿ÉÒÔÊÇÒ»¶ÔÒ»¡¢Ò»¶Ô¶à¡¢¶à¶Ô¶àµÄ¹Øϵ¡£ÔÚÒ»°ãÇé¿öÏ£¬ËüÃÇÊÇÒ»¶ÔÒ»µÄ¹Øϵ£º¼´Ò»ÕÅÔʼµ¥¾Ý¶ÔÓ¦ÇÒÖ»¶ÔÓ¦Ò»¸öʵÌå¡£ÔÚÌØÊâÇé¿öÏ£¬ËüÃÇ¿ÉÄÜÊÇÒ»¶Ô¶à»ò¶à¶ÔÒ»µÄ¹Øϵ£¬¼´Ò»ÕÅÔʼµ¥Ö¤¶ÔÓ¦¶à¸öʵÌ壬»ò¶àÕÅÔʼµ¥Ö¤¶ÔÓ¦Ò»¸öʵÌå¡£ÕâÀïµÄʵÌå¿ÉÒÔÀí½âΪ»ù±¾±í¡£Ã ......
ÏÂÃæÊÇÎÒÔÚSQLServerÖÐÓõıȽ϶àµÄº¯Êý£¬Ä㻹ÓÃЩʲôº¯Êý£¿»òÕ߶ÔÄĸöº¯ÊýÓбȽϺÃÓ÷¨£¿»òÕßÄã²»ÓÃÄÄЩº¯Êý£¿
LEFT ( character_expression , integer_expression )
·µ»Ø´Ó×Ö·û´®×ó±ß¿ªÊ¼Ö¸¶¨¸öÊýµÄ×Ö·û¡£
Àý:
select left('my name is viwo',4)
my n
RIGHT ( character_expression , integer_expression )
·µ» ......
»·¾³£ºvs2005+sqlserver2005+PowerDesigner 12
´ò¿ªPowerDesigner 12(ÒÔϼò³Æpd)£¬Ð½¨pdm¹¤³Ì£¬ÈçͼËùʾ£º
×¢£ºdbmsÑ¡ÔñÄúÄ¿Ç°ÐèҪת»»µÄÀà±ð£¬ÎÒÓõÄÊÇsqlserver2005¡£
È»ºóÑ¡Ôñ²Ëµ¥¡¶Êý¾Ý¿â¡·¡¶ÏµÍ³DSN¡·£¬Ñ¡Ôñ»òÕßÌí¼ÓÄúÐèÒªµÄÊý¾Ý¿â£¬ÎÒÕâÀïÑ¡ÔñµÄÊÇsql server¡£ÈçͼËùʾ£º
½¨ºÃ ......
1¡¢ÊµÀýÒ»£º
public void SqlConnectionOpen()
{
SqlConnection myConn=new SqlConnection();
myConn.ConnectionString="server=(local);database=pubs;Trusted_Connection=yes";
......
ÒýÓÃ×Ôhttp://blog.163.com/xing_aixin/blog/static/3723550520088189201623/
ÍøÉÏÓкܶàSQL ServerÊý¾Ý¿â×ÖµäµÄSQLÓï¾ä£¬ÆßÁã°ËÂ䣬ÎÒÔÚ¹¤×÷ÕûÀíÁËÒ»ÏÂ˼·£¬×ܽáSQL´úÂëÈçÏ¡£Êý¾Ý¿â×Öµä°üÀ¨±í½á¹¹(·Ö2KºÍ2005)¡¢Ë÷ÒýºÍÖ÷¼ü. Íâ¼ü.Ô¼Êø.ÊÓͼ.º¯Êý.´æ´¢¹ý³Ì.´¥·¢Æ÷¡£¿ÉÒÔÔÚÆóÒµ¹ÜÀíÆ÷¡¢²éѯ·ÖÎöÆ÷Öмòµ¥Ö´ÐУ¬Ö±½ÓÁ˵±µ ......