Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎÊ´ð£º

ÇómssqlºÍorcalÁ½ÌõÓï¾ä - Oracle / ¸ß¼¶¼¼Êõ

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 ,
×Ö¶Îà ......

phpÁ¬½ÓMSSQL Á¬²»ÉÏ - PHP / »ù´¡±à³Ì

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 MSSQL - Java / Java SE

ʹÓÃjavaÔÚwindows7 32λÏÂÁ¬½ÓMSSQL¡£
Á½Ì¨»úÆ÷£¬windows7 32룬ÔÚ¿ØÖÆÃæ°åÀïÃæÈ«²¿ÉèÖÃÓïÑÔºÍÇøÓòÑ¡Ïenglish-unitedstates
ΨһÇø±ðÖ»ÓÐÔÚ°²×°SQL server 2008µÄʱºò Ñ¡ÔñµÄ×Ö·û¼¯²»Ò»Ñù£¬
exec sp_helpsor ......

MSSQL ÐÐÊýͳ¼ÆµÄÎÊÌâ - MS-SQL Server / ÒÉÄÑÎÊÌâ

ÓÐÁ½¸ö±í£¬ÊýÁ¿¼¶ÔÚ3000w×óÓÒ£¬
Ïë²é¿´¾ßÌåµÄÊýÁ¿£¬ÓÃselect Count(*) ËÙ¶ÈÌ«Âý£¬
֮ǰ¿´µ½ËµÔÚsysindexesÖÐÓÐrows ÁУ¬ µ«ÊÇÎÒ·¢ÏÖ£¬ÕâÁ½¸öµÄÖµ²»Ò»Ñù£¬Ôõô»ØÊ°¡£¿
лл
ÓÐÈËÄܻشðÒ»ÏÂÂð? ²»ÊǺÜÃ÷°×°¡

Ò ......

¸´ÖÆmssqlÐеÄÎÊÌâ - Web ¿ª·¢ / ASP

ÈçÌâ
ÎÒʹÓÃ
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 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ