--Creating xml Data Type Columns
CREATE TABLE dbo.Book
(BookID int IDENTITY(1,1) PRIMARY KEY,
ISBNNBR char(10) NOT NULL,
BookNM varchar(250) NOT NULL,
AuthorID int NOT NULL,
ChapterDESC XML NULL)
DECLARE @Book XML
SET @Book =
CAST('<Book name="SQL Server 2000 Fast Answers">
<Chapters>
<Chapter id="1"> Installation, Upgrades... </Chapter>
<Chapter id="2"> Configuring SQL Server </Chapter>
<Chapter id="3"> Creating and Configuring Databases </Chapter>
<Chapter id="4"> SQL Server Agent and SQL Logs </Chapter>
</Chapters>
</Book>' as XML)
CREATE PROCEDURE dbo.usp_INS_Book
@ISBNNBR char(10),
@BookNM varchar(250),
@AuthorID int,
@ChapterDESC xml
AS
INSERT dbo.Book
(ISBNNBR, BookNM, AuthorID, ChapterDESC)
VALUES (@ISBNNBR, @BookNM, @AuthorID, @ChapterDESC)
GO
--Inserting xml Data into a Column
INSERT dbo.Book
(ISBNNBR, BookNM, AuthorID, ChapterDESC)
VALUES ('570X000000',
'SQL Server 2005 T-SQL Recipes',
55,
CAST('<Book name="SQL Server 2005 T-SQL Recipes">
<Chapters>
<Chapter id="1"> SELECT </Chapter>
<Chapter id="2"> INSERT,UPDATE,DELETE </Chapter>
<Chapter id="3"> Transactions, Locking, Blocking, and Deadlocking </Chapter>
<Chapter id="4"> Tables </Chapter>
<Chapter id="5"> Indexes </Chapter>
<Chapter id="6"> Full-text search </Chapter>
</Chapters>
</Book>' as XML))
DECLARE @Book XML
SET @Book =
CAST('<Book name="SQL Server 2000 Fast Answers">
<Chapters>
<Chapter id="1"> Installation, Upgrades... </Chapter>
<Chapter id="2"> Configuring SQL Server </Chapter>
<Chapter id="3"> Creating and Configuring Databases </Chapter>
<Chapter id="4"> SQL Server Agent and SQL Logs </Chapter>
</Chapters>
</Book>' as XML)
INSERT dbo.Book
(ISBNNBR, BookNM, AuthorID, ChapterDESC)
VALUES ('1590591615',
±¾ÈËдÁËÒ»¸öSQL²éѯ·ÖÎöÆ÷À©Õ¹¹¤¾ß£¬¹¦ÄÜÀàËÆDelphiµÄToDo¡£¿ÉÒÔ·½±ã¿ª·¢ÕßÔÚ´óÁ¿µÄSQL½Å±¾ÖпìËÙÕÒµ½Ã¿¸öÄ£¿é¡¢To-Do£¬´Ó¶øÌá¸ß¿ª·¢¸ßÀûÂÊ¡£
ʹÓõÄʱºòÏÈÔËÐÐSQL²éѯ·ÖÎöÆ÷£¬È»ºóÔËÐб¾³ÌÐò¼´¿É£¨¿ÉÒÔ¹¤¾ß|×Ô¶¨ÒåÖÐÅäÖã©¡£°´F2ÏÔʾTo-Do List´°¿Ú£¬°´Alt+F2ÔÚµ±Ç°Î»ÖòåÈëTo-Do¡£
ÓÉÓÚʱ¼ä¹ØÏµ£¬±¾³ÌÐò²¢Î´ÍêÉÆ£¬ÔÚË« ......
ËäÈ»²»ÄÜÍêÈ«±ÜÃâËÀËø£¬µ«¿ÉÒÔʹËÀËøµÄÊýÁ¿¼õÖÁ×îÉÙ¡£½«ËÀËø¼õÖÁ×îÉÙ¿ÉÒÔÔö¼ÓÊÂÎñµÄÍÌÍÂÁ¿²¢¼õÉÙϵͳ¿ªÏú£¬ÒòΪֻÓкÜÉÙµÄÊÂÎñ£º
»Ø¹ö£¬¶ø»Ø¹ö»áÈ¡ÏûÊÂÎñÖ´ÐеÄËùÓй¤×÷¡£
ÓÉÓÚËÀËøÊ±»Ø¹ö¶øÓÉÓ¦ÓóÌÐòÖØÐÂÌá½»¡£
ÏÂÁз½·¨ÓÐÖúÓÚ×î´óÏ޶ȵؽµµÍËÀËø£º
°´Í¬Ò»Ë³Ðò·ÃÎʶÔÏó¡£
±ÜÃâÊÂÎñÖеÄÓû§½»»¥¡£
±£³ÖÊÂÎñ¼ò¶Ì ......