Let’s assume that we’ve received a request to create XML data from relevant fields in the Person.Person table, for the person having BusinessEntityID 10 0 01. One common requirement is to create an XML structure that is based on the schema of an existing table. Let’s examine some of these tasks that require XML manipulation, using the sample AdventureWorks2012 database (Other AdventureWorks versions should work OK, but there may be variations in the data and/or table schemas). SQL Server provides plenty of XML-related tools, but how can we know which ones to use, and when? Sometimes, XML Data must be created directly from existing tables. Sometimes business requirements dictate that XML fragments should be merged, while other requests call for XML documents or fields to be shredded and their values imported into tables. While all reports aren’t listed here, they’re an excellent resource and one of the most underused features of Management Studio.It often becomes necessary to create, shred, combine, or otherwise reconstitute XML data, in order to make it fit a specific purpose. You can find these reports in the context menus of server, database, and security ? login nodes. No section on Object Explorer would be complete without mentioning the dozens of great reports hidden within, one of which is shown in Figure 5. You can use the Query Designer to edit data directly in the results pane - a quick-and-dirty way to correct or mock up data. Table and column names can’t be dragged from the Object Explorer to the SQL pane. Nor can it execute SQL statements using F5. Unlike Query Editor, it cannot perform batches or non-DML commands. However, the Query Designer is no substitute for the Query Editor. The Change Type drop-down list in the Query Designer toolbar offers to change the query from a default select query to an Insert Results, Insert Values, Update, Delete, or Make Table query. The Query Designer can perform Data Manipulation Language ( DML) queries - ( SELECT, INSERT, UPDATE, DELETE) besides SELECT.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |