mssqlÔõôµÃµ½×Ô¶¯±àºÅidÖµ£¿
Çë´ó¼Ò¸ø¸öÀý×Ó¿´¿´£¬²»ÖªµÀÈçºÎÈ¥´¦Àí£¬ºÍmysql²»Ò»ÑùûÓÐרÃŵĺ¯Êý
SQL code: id INT AUTO_INCREMENT ? ÔÚ×öÒ»¸öÌí¼Ó¼Ç¼£¬½á¹û×Ô¶¯±àºÅµÄidÎÞ·¨´¦Àí£¬Â¥ÉϵÄÄÜÔÙÏêϸµãÂ𣿠ÎÞ·¨´¦ÀíÊÇʲôÒâ˼£¿²»»áÌí¼Ó±àºÅ£¿ÌùµãÊý¾Ý¿´¿´ ²»ÖªµÀ´úÂëÔõôд£¬ÓÖ²»ÄÜÓÃÀàËÆmysql_insert_idº¯ÊýÒýÓà ²»ÖªµÀ´úÂëÔõôд£¬ÓÖ²»ÄÜÓÃÀàËÆmysql_insert_idº¯Êý ÓÃÕâ¸ö·½·¨²»ÐÐÂ𣿠ÊÇ×ö²åÈë²Ù×÷Âð PHP code: insert into ºóÓà SELECT SCOPE_IDENTITY() »ò SELECT @@IDENTITY »òÕßÈÎÒâʱºòÓà SELECT IDENT_CURRENT('ij¸ö±íÃû³Æ') SQL code: »òÕßÔÙ±¿Ò»µãµÄ°ì·¨£º select max(id) from mytable ?lzÊÇʲôÒâ˼?Êý¾Ý¿âÀï±¾ÉíÓÐÒ»¸ö×ÔÔöµÄ×Ö¶Î,ÒªÔõôµÃµ½ËüµÄÖµ ? SQL code: create table t( id integer identity(1,1), //´Ó1¿ªÊ¼£¬Ã¿´Î²åÈëÔö¼Ó1,²åÈëµÄʱºòÒªÖ¸¶¨ÁÐÃû£¬ÕâÁв»Òª²åÈ룬×Ô¶¯µÄ . . . ) columnname int identity(1,1) ÊÔÒ»ÊÔ°É mysql_insert_id (PHP 3, PHP 4 , PHP 5
Ïà¹ØÎÊ´ð£º
SQL code: sql2005£¬sql2008 SELECT ±íÃû=CASE WHEN a.colorder = 1 THEN d.name ELSE '' END, ±í˵Ã÷=CASE WHEN a.colorder = 1 THEN isnull(f.value, '') ELSE '' END , ×Ö¶ÎÐòºÅ=a.colorder , ×Ö¶Îà ......
Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Çý¶¯³ÌÐò¹ÜÀíÆ÷] δ·¢ÏÖÊý¾ÝÔ´Ãû³Æ²¢ÇÒδָ¶¨Ä¬ÈÏÇý¶¯³ÌÐò, SQL state IM002 in SQLConnect in D:\0\msc\msc\tel.php on line 44 Í ......
ʹÓÃjavaÔÚwindows7 32λÏÂÁ¬½ÓMSSQL¡£ Á½Ì¨»úÆ÷£¬windows7 32룬ÔÚ¿ØÖÆÃæ°åÀïÃæÈ«²¿ÉèÖÃÓïÑÔºÍÇøÓòÑ¡Ïenglish-unitedstates ΨһÇø±ðÖ»ÓÐÔÚ°²×°SQL server 2008µÄʱºò Ñ¡ÔñµÄ×Ö·û¼¯²»Ò»Ñù£¬ exec sp_helpsor ......
ÓÐÁ½¸ö±í£¬ÊýÁ¿¼¶ÔÚ3000w×óÓÒ£¬ Ïë²é¿´¾ßÌåµÄÊýÁ¿£¬ÓÃselect Count(*) ËÙ¶ÈÌ«Âý£¬ ֮ǰ¿´µ½ËµÔÚsysindexesÖÐÓÐrows ÁУ¬ µ«ÊÇÎÒ·¢ÏÖ£¬ÕâÁ½¸öµÄÖµ²»Ò»Ñù£¬Ôõô»ØÊ°¡£¿ лл ÓÐÈËÄܻشðÒ»ÏÂÂð? ²»ÊǺÜÃ÷°×°¡ Ò ......
ÈçÌâ ÎÒʹÓà VBScript code: conn.execute("SET IDENTITY_INSERT [abc] On" & vbcrlf & "insert into [abc] (id,name,qq,msn) select (select top 1 id from [abc] order by id desc)+1 ......