--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。
由于时间关系,本程序并未完善,在双 ......