·¢±íÒ»¿îSQL×Ö·û´®µÄ¼ò·±Ì庯Êý
簡體數據庫轉·±體數據庫µÄ問題 °ÝÍÐÁË
ALTER DATABASE DatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE DatabaseName COLLATE Chinese_Taiwan_Stroke_CI_AS
ALTER DATABASE DatabaseName SET MULTI_USER WITH ROLLBACK IMMEDIATE
執ÐÐÉÏÃæ語¾äÒÔáᣬËüÖ»ÊÇÐÂÔöµÄ±íĬ認ÊÇ·±體¶øÒÔ£¬Ô來¾ÍÓеıíËü沒轉換¡£
¶øÎÒÊÇÏë°ÑÒÔÇ°ËùÓеıíÒ»´Î轉換³É·±體µÄ£¬Ôõ麼辦£¿
-------------------
--·¢±íÒ»¿îSQL×Ö·û´®µÄ¼ò·±Ì庯Êý
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[f_GB2BIG]') and xtype in (N'FN', N'IF', N'TF'))
drop function [dbo].[f_GB2BIG]
GO
--Éú³ÉÂë±í
if exists (select * from dbo.sysobjects where id = object_id(N'[codetable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [codetable]
GO
declare @j nvarchar(2000),@f nvarchar(2000)
select @j='°¨°ª°°®°¿°À°Â°Ó°Õ°Ú°Ü°ä°ì°í°ï°ó°÷°ù°þ±¥±¦±¨±«±²±´±µ±·±¸±¹±Á±Ê±Ï±Ð±Ò±Õ±ß±à±á±ä±ç±è±ê±î±ð±ñ±ô±õ±ö±÷±ý²¢²¦²§²¬²µ²·²¹²Æ²Î²Ï²Ð²Ñ²Ò²Ó²Ô²Õ²Ö²×²Þ²à²á²â²ã²ï²ó²ô²õ²ö²÷²ø²ù²ú²û²ü³¡³¢³¤³¥³¦³§³©³®³µ³¹³¾³Á³Â³Ä³Å³Æ³Í³Ï³Ò³Õ³Ù³Û³Ü³Ý³ã³å³æ³è³ë³ì³ï³ñ³ó³÷³ø³ú³û´¡´¢´¥´¦´«´¯´³´´´¸´¿´Â´Ç´Ê´Í´Ï´Ð´Ñ´Ó´Ô´Õ´Ú´Ü´í´ï´ø´ûµ£µ¥µ¦µ§µ¨µ¬µ®µ¯µ±µ²µ³µ´µµµ·µºµ»µ¼µÁµÆµËµÐµÓµÝµÞµßµãµæµçµíµöµ÷µüµýµþ¶¤¶¥¶§¶©¶ª¶«¶¯¶°¶³¶·¶¿¶À¶Á¶Ä¶Æ¶Í¶Ï¶Ð¶Ò¶Ó¶Ô¶Ö¶Ù¶Û¶á¶é¶ì¶î¶ï¶ñ¶ö¶ù¶û¶ü·¡·¢·£·§·©·¯·°·³·¶···¹·Ã·Ä·É·Ì·Ï·Ñ·×·Ø·Ü·ß·à·á·ã·æ·ç·è·ë·ì·í·ï·ô·ø¸§¸¨¸³¸´¸º¸¼¸¾¸¿¸Ã¸Æ¸Ç¸É¸Ï¸Ñ¸Ó¸Ô¸Õ¸Ö¸Ù¸Ú¸Þ¸ä¸é¸ë¸ó¸õ¸ö¸ø¹¨¹¬¹®¹±¹³¹µ¹¹¹º¹»¹Æ¹Ë¹Ð¹Ø¹Û¹Ý¹ß¹á¹ã¹æ¹è¹é¹ê¹ë¹ì¹î¹ñ¹ó¹ô¹õ¹ö¹ø¹ú¹ýº§º«ºººÅºÒº×ºØºáºäºèºìºóºø»¤»¦»§»©»ª»»®»°»³»µ»¶»·»¹»º»»»½»¾»À»Á»Æ»Ñ»Ó»Ô»Ù»ß»à»á»â»ã»ä»å»æ»ç»ë»ï»ñ»õ»ö»÷»ú»ý¼¢¼¥¼¦¼¨¼©¼«¼¼¶¼·¼¸¼»¼Á¼Ã¼
Ïà¹ØÎĵµ£º
1.ÅжÏÒ»¸öÁÙʱ±íÊÇ·ñ´æÔÚ
if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tempcitys') and type='U')
drop table #tempcitys
×¢ÒâtempdbºóÃæÊÇÁ½¸ö. ²»ÊÇÒ»¸öµÄ
---ÁÙʱ±í
if exists(select * from tempdb..sysobjects where name like &lsqu ......
jspÁ¬½Ósql server2005
£¨¾²âÊÔÁ¬½Ó³É¹¦£©
½Ó´¥Java»òÕßJSP£¬ÄÑÃâ»áʹÓõ½Êý¾Ý¿â
SQL Server
2000/2005£¨ÎÒʹÓÃ2005±ê×¼°æ[9.0.3054]²âÊÔ£©£¬¾¹ý×Ô¼ºµÄËÑË÷ºÍÑо¿£¬Ê¹ÓÃJDBCÁ¬½ÓSQL
Server³É¹¦£¬ÌØ´ËÕûÀí·½·¨£¨Ê¹ÓÃEclipse 3.2£©ÈçÏ¡£
×¼±¸¹¤×÷
Ê×ÏÈ£¬²Ù×÷ϵͳ
Öа²×°ºÃSQL Server
2000/2005£¬È ......
ÔÚ´óÐ͵ÄÊý¾Ý¿âÓ¦ÓÃÖУ¬¾³£»áÓöµ½²¿·ÖÊý¾ÝµÄÍÑ»úºÍ¶à¸öÊý¾Ý¿âµÄºÏ²¢ÎÊÌâ¡£±ÈÈçÏÖÔÚÓÐÒ»¸öÈ«Ê¡·¶Î§Ê¹ÓõÄÓ¦ÓóÌÐò£¬Ã¿¸öÊж¼²¿ÊðÁ˵¥¶ÀµÄÏàͬµÄÓ¦ÓóÌÐò·þÎñÆ÷ºÍÊý¾Ý¿â·þÎñÆ÷£¬Ã¿¸öÔÂÐèÒª½«È«Ê¡ËùÓÐÊеÄÊý¾ÝÈ«²¿»ã×ÜÆðÀ´ÓÃÓÚ³öÈ«Ê¡µÄ±¨±í£¬ÕâÊÇÒ»Öֺܳ£¼ûµÄÊý¾Ý¿âºÏ²¢ÎÊÌâ¡£ÔÙ±ÈÈçÎÒÃÇ×öÁËÒ»¸öSmartClientµÄÓ¦ÓóÌÐò£¬Ã¿¸ö¿ ......
ÔÚËÑË÷Êý¾Ý¿âÖеÄÊý¾Ýʱ£¬SQL ͨÅä·û¿ÉÒÔÌæ´úÒ»¸ö»ò¶à¸ö×Ö·û¡£
SQL ͨÅä·û±ØÐëÓë LIKE ÔËËã·ûÒ»ÆðʹÓá£
ÔÚ SQL ÖУ¬¿ÉʹÓÃÒÔÏÂͨÅä·û£º
ͨÅä·ûÃèÊö
%
Ìæ´úÒ»¸ö»ò¶à¸ö×Ö·û
_
½öÌæ´úÒ»¸ö×Ö·û
[charlist]
×Ö·ûÁÐÖеÄÈκε¥Ò»×Ö·û
[^charlist]
»òÕß
[!charlist]
²»ÔÚ×Ö·ûÁÐÖеÄÈκε¥Ò»×Ö·û
ÔʼµÄ±í (ÓÃÔÚÀý×ÓÖ ......
ÔÚSQL ServerÖÐʹÓÃNewID()·½·¨²úÉúËæ»ú¼¯
ÀýÈ翼ÊÔϵͳÖеÄËæ»ú³öÌâ
¸Õ¿ªÊ¼Ïëµ½µÄÊÇRandomÀà
µ«ÊÇRandomЧÂÊÓеãµÍ
ºóÀ´Ïëµ½ÁËÔÚÊý¾Ý¿âÀïµÄnewid()
ÓÚÊDzÉÓÃÁËϱ߷½·¨£º
select top 5 * from tablename order by newid()
Ôڴ˱ê¼ÇһϠ......