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

Sql Êý¾Ýµ¼³öµ½XMl Óë ´ÓXMLµ¼Èëµ½Êý¾Ý¿â

1¡¢µ¼³öµ½XMl select * from Brand  for xml auto ,root('Brands')
<Brands>
  <Brand BrandID="E584596D-4D66-4F2F-B6F7-71C3BEB4CA21" Name="inganico" />
  <Brand BrandID="19B04451-DDC4-4CDF-BE30-CB4E703B27DA" Name="°²¸¶´ï" />
  <Brand BrandID="3C6C8E12-7C4A-4F19-B491-4C0A64A48303" Name="°²ÖÇ" />
  <Brand BrandID="BF6C361A-8993-4660-A89D-EB32CCC9CE49" Name="°Ù¸»" />
  <Brand BrandID="8E7FE420-3AE3-4017-80AB-B53CA29C80CA" Name="º£²©Í¨" />
  <Brand BrandID="505C5565-08C5-4EF5-9316-55CA76C1E9F3" Name="»Ý¶û·á" />
  <Brand BrandID="E5BA2A72-B1D1-457A-9AFD-A9D9B336E7C0" Name="ÀûÆÕÃÅ" />
  <Brand BrandID="1982A195-5263-45CC-B872-96F3C145FCCD" Name="ÁªµÏ" />
  <Brand BrandID="E460CDA6-4A83-4C62-B049-3B980516AD79" Name="Èð°Ø" />
  <Brand BrandID="06BACF99-BB7E-447C-B021-CD8C3FFAE85A" Name="Èø»ùÄ·" />
  <Brand BrandID="165510D9-342D-4402-882D-0A00DBFDAAE3" Name="дó½" />
  <Brand BrandID="2FA88654-2311-4C51-85B1-A39077C34C6D" Name="йú¶¼" />
</Brands>
2¡¢½«ÉϱßXMLÄÚÈݵ¼»Ø Êý¾Ý¿â
CreatePROCEDURE [dbo].[P_BrandSynchronization]
@xmlDocument NVARCHAR (MAX)
AS
BEGIN
 
 SET NOCOUNT ON;
 DECLARE @docHandle int
 set @xmlDocument='<Brands>'+@xmlDocument+'</Brands>'
 EXEC sp_xml_preparedocument @docHandle OUTPUT, @xmlDocument
 declare   @BrandID   uniqueidentifier
 declare   @Name   varchar(16)  ,  @message varchar(500)
 
 
 declare mycursor cursor for (SELECT   *  from   OPENXML   (@docHandle,'/Brands/Brand',1)  
 WITH  (
    BrandID   uniqueidentifier,
    Name   varchar(16)
    ))
 open mycursor
 FETCH NEXT from mycursor INTO @BrandID,@Name
 while(@@FETCH_S


Ïà¹ØÎĵµ£º

¹ØÓÚsqlÁ¬½ÓÓï¾äÖеÄIntegrated Security=SSPI

¹ØÓÚsqlÁ¬½ÓÓï¾äÖеÄIntegrated Security=SSPI
½â¾ö·½·¨£º
¼´£ºSecurity Support Provider Interface
ÉèÖÃIntegrated SecurityΪ True µÄʱºò£¬Á¬½ÓÓï¾äÇ°ÃæµÄ UserID, PW ÊDz»Æð×÷Óõģ¬¼´²ÉÓÃwindowsÉí·ÝÑé֤ģʽ¡£
Ö»ÓÐÉèÖÃΪ False »òÊ¡ÂÔ¸ÃÏîµÄʱºò£¬²Å°´ÕÕ UserID, PW À´Á¬½Ó¡£
Integrated Security ¿ÉÒÔÉèÖÃΪ: ......

SQLÂÒÂëµÄÎÊÌâ

ÔÚSQL   Server   Unicode×Ö·û´®³£Á¿ÐèҪǰ׺N  
   
  µ±ÔÚSQL  
SERVERÀï±ß´¦Àí×Ö·û´®³£Á¿µÄʱºòÄã±ØÐëÔÚ³£Á¿Ö®Ç°·ÅÒ»¸ö´óдµÄN,¾ÍÏñSQL  
SERVERÁ¬»úÎĵµ±êÌâΪ"²ÉÓÃUnicodeÊý¾Ý"Ëù˵Ã÷µÄÄÇÑù.Nǰ׺ÏóÕ÷×ÅÔÚSQL-92  
±ê×¼µÄ¹ú¼ÒÓïÑÔ,²¢ÇÒ±ØÐëÊÇ´óд×Öĸ.Èç¹ûÄãÔ ......

SQL SERVER 2008 ÐÂÊý¾Ý¿âÀàÐÍhierarchyid

/*
--2010-05-27(¶«Éý)
 
 
 
SQL SERVER 2008 ÐÂÊý¾Ý¿âÀàÐÍhierarchyid
      
    SQL SERVER 2008ÒýÈëÁËеÄhierarchyidÊý¾ÝÀàÐÍ,¿ÉÒÔÓÃËüÀ´×ö±¾µØ´æ´¢²¢ÇÒÔÚÊ÷²ã´Î
½á¹¹ÖйÜÀíÆäλÖÃ.Ö»ÓÃÕâ¸öº¯ÊýÄܼò½àµØ±íʾ²ã´Î½á¹¹ÖеÄλÖÃ.¸Ãº¯ÊýÌṩµÄһЩ ......

"SQL Server ²»´æÔÚ»ò·ÃÎʱ»¾Ü¾ø "

"SQL   Server   ²»´æÔÚ»ò·ÃÎʱ»¾Ü¾ø "
Õâ¸öÊÇ×ÔÓµÄ,´íÎó·¢ÉúµÄÔ­Òò±È½Ï¶à,ÐèÒª¼ì²éµÄ·½ÃæÒ²±È½Ï¶à.
Ò»°ã˵À´,ÓÐÒÔϼ¸ÖÖ¿ÉÄÜÐÔ:
1,SQL   ServerÃû³Æ»òIPµØַƴдÓÐÎó
2,·þÎñÆ÷¶ËÍøÂçÅäÖÃÓÐÎó
3,¿Í»§¶ËÍøÂçÅäÖÃÓÐÎó
Òª½â¾öÕâ¸öÎÊÌâ,ÎÒÃÇÒ»°ãÒª×ñÑ­ÒÔϵIJ½ÖèÀ´Ò»²½²½ÕÒ³öµ¼Ö´íÎóµÄÔ­Òò.
= ......

sql¹¤¾ß

×î½üÔÚÓÃsqlcmd¹¤¾ß½øÐÐÊý¾Ý±¸·Ý£¬½ñÌìÔÚ»»µ½sql2000ʱͻȻ²»ÄÜÓá£Ô­À´2000ÊÇûÓÐÕâ¸ö¹¤¾ßµÄ£º
sql2005:
sqlcmd -S ·þÎñÆ÷Ãû»ò·þÎñÆ÷µØÖ· -U Óû§ -P ÃÜÂë -i "ÒýÓõÄsqlÓï¾äÎļþ"
sql2000:¿ÉÒÔÓÃosql´úÌ棬¹¦ÄÜÒ»Ñù
osql -S ·þÎñÆ÷Ãû»ò·þÎñÆ÷µØÖ· -U Óû§ -P ÃÜÂë -i "ÒýÓõÄsqlÓï¾äÎļþ" ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ