Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 Server] ÈÕÖ¾¹ÜÀí(´ýÐø)

 --±¸·ÝÊÂÎñÈÕÖ¾ (×ÔÉÏÒ»´Î±¸·ÝÒÔÀ´£¬ÖÁµ±Ç°µÄÒÑÍê³ÉµÄÊÂÎñµÄÈÕÖ¾)
backup log MyDBName to disk='F:\dbbak\GamePoint\MyDBName_log_2010052709.bak';
 
--½Ø¶ÏÈÕÖ¾(½Ø¶Ïµôµ±Ç°µÄÒÑÍê³ÉµÄÊÂÎñµÄÈÕÖ¾), SQL Server 2005, 2008ûÓÐÕâ¸öÑ¡Ïî.
backup log MyDBName with no_Log;
 
--ÊÕËõÈÕÖ¾(ÖÁ1M,µ ......

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

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

SQL Server ÈÕÆÚºÍʱ¼äº¯Êý


 
1¡¢³£ÓÃÈÕÆÚ·½·¨(ÏÂÃæµÄGetDate() = '2006-11-08 13:37:56.233')
(1)DATENAME ( datepart ,date )
   ·µ»Ø±íʾָ¶¨ÈÕÆÚµÄÖ¸¶¨ÈÕÆÚ²¿·ÖµÄ×Ö·û´®¡£DatepartÏê¼ûÏÂÃæµÄÁбí.
SELECT DateName(day,Getdate()) –·µ»Ø8
(2)DATEPART ( datepart , date )
    ·µ»Ø±íʾָ¶¨ÈÕÆÚµÄÖ¸ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ