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

sql server°²×°°æ±¾²é¿´


SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
productversion£º²úÆ·°æ±¾£¨ÀýÈ磬10.0.1600.22£©
productlevel£º²úÆ·¼¶±ð£¨ÀýÈ磬RTM£©
edition£º°æ±¾£¨ÀýÈ磬 Enterprise£¨ÆóÒµ°æ£©¡¢Developer Edition£¨¿ª·¢°æ£©£©
SELECT @@VERSION
΢Èí¾ßÌå˵Ã÷£º
http://support.microsoft.com/kb/321185


Ïà¹ØÎĵµ£º

[SQL]´æ´¢¹ý³ÌµÄʹÓÃ

1.ÔÚmssql´´½¨´æ´¢¹ý³Ì,ÔÚdb->´æ´¢¹ý³Ì->н¨´æ´¢¹ý³Ì(ÓÒ¼ü)
CREATE PROCEDURE user_logon_check @username varchar(45),@userpsw varchar(45)
 AS
select * from users where UserName = @username and PasswordCode = @userpsw
return 10
GO
2.ÔÚmysql´´½¨´æ´¢¹ý³Ì,ʹÓÃMysql Query Browser,ÔÚdb->±í ......

¹ØÓÚSQLʱ¼äÀàÐ͵ÄÄ£ºý²éѯ

½ñÌìÓÃtime Like '2008-06-01%'Óï¾äÀ´²éѯ¸ÃÌìµÄËùÓÐÊý¾Ý£¬±»ÌáʾÓï¾ä´íÎó¡£²éÁËһϲŷ¢ÏÖ¸ÃÄ£ºý²éѯֻÄÜÓÃÓÚStringÀàÐ͵Ä×ֶΡ£
×Ô¼ºÒ²²éÔÄÁËһЩ×ÊÁÏ¡£¹ØÓÚʱ¼äµÄÄ£ºý²éѯÓÐÒÔÏÂÈýÖÖ·½·¨£º
 
1.Convertת³ÉString,ÔÚÓÃLike²éѯ¡£
select * from table1   where c ......

SQL·ÖÒ³Óï¾ä

±àÂë¹ý³ÌÖÐÓöµ½µÄSQL·ÖÒ³Çé¿ö£¬×ܽ᣺
´ÓÊý¾Ý¿â±íÖеÚMÌõ¼Ç¼¿ªÊ¼¼ìË÷NÌõ¼Ç¼
MySQL£º
ÏȲéѯ·ÖÒ³£¬È»ºóÅÅÐò£º
select * from (select * from student  limit 5,2) pageTable order by id desc  ;
ÏÈÅÅÐò£¬È»ºó²éѯ·ÖÒ³£ºselect * from student order by id desc limit 5,2  ;
Oracle£º
SELECT * fro ......

¾­µäSQLÓï¾ä´óÈ«

Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database dbname
3¡¢ËµÃ÷£º±¸·Ýsql server
--- ´´½¨ ±¸·ÝÊý¾ÝµÄ device
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'
--- ¿ªÊ¼ ±¸·Ý
BACKUP DATABASE pubs TO testBack
4¡¢Ë ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ