Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 266 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
266
Dung lượng
1,5 MB
Nội dung
[...]... Specify a valid server name for @datasrc as 'server_ name' or 'server_ name\instance_name' EXEC sp_addlinkedserver @server = N'MyLinkServer', @srvproduct = N' ', @provider = N'SQLNCLI', @datasrc = N 'server_ name', @catalog = N'AdventureWorks2012'; GO Specify the remote data source using a four-part name in the form linked _server. catalog.schema.object DELETE MyLinkServer.AdventureWorks2012.HumanResources.Department... Map Table Columns to Data-File Fields See Also Bulk Import and Export of Data (SQL Server) bcp Utility Format Files for Importing or Exporting Data INSERT (Transact -SQL) OPENROWSET Preparing Data for Bulk Export or Import sp_tableoption 15 DELETE Removes one or more rows from a table or view in SQL Server 2012 Transact -SQL Syntax Conventions Syntax [ WITH [ , n ] ] DELETE... WITH common_table_expression (Transact -SQL) @@ROWCOUNT (Transact -SQL) FROM Specifies the tables, views, derived tables, and joined tables used in DELETE, SELECT, and UPDATE statements in SQL Server 2012 In the SELECT statement, the FROM clause is required except when the select list contains only constants, variables, and arithmetic expressions (no column names) Transact -SQL Syntax Conventions Syntax... Security Security Account Delegation (Impersonation) If a SQL Server user is logged in using Windows Authentication, the user can read only the files accessible to the user account, independent of the security profile of the SQL Server process When executing the BULK INSERT statement by using sqlcmd or osql, from one computer, inserting data into SQL Server on a second computer, and specifying a data_file... table exists on a different server or instance of SQL Server A Deleting data from a remote table by using a linked server The following example deletes rows from a remote table The example begins by creating a link to the remote data source by using sp_addlinkedserver The linked server name, MyLinkServer, is then specified as part of the four-part object name in the form server. catalog.schema.object... solution, and the second DELETE statement shows the TransactSQL FROM extension to join the two tables SQL- 2003 Standard subquery USE AdventureWorks2012; GO DELETE FROM Sales.SalesPersonQuotaHistory WHERE BusinessEntityID IN (SELECT BusinessEntityID FROM Sales.SalesPerson WHERE SalesYTD > 2500000.00); GO Transact -SQL extension USE AdventureWorks2012; GO DELETE FROM Sales.SalesPersonQuotaHistory FROM... information about table hints, see Table Hint (Transact -SQL) Returns deleted rows, or expressions based on them, as part of the DELETE operation The OUTPUT clause is not supported in any DML statements targeting views or remote tables For more information, see OUTPUT Clause (Transact -SQL) FROM table_source Specifies an additional FROM clause This Transact -SQL extension to DELETE allows specifying... is returned SQL Server returns errors when duplicate names appear in the FROM clause table_or_view_name Is the name of a table or view If the table or view exists in another database on the same instance of SQL Server, use a fully qualified name in the form database.schema.object_name If the table or view exists outside the instance of SQL Serverl, use a four-part name in the form linked _server. catalog.schema.object... information, see Managing FILESTREAM Data by Using Transact -SQL The FROM clause cannot be specified in a DELETE statement that references, either directly or indirectly, a view with an INSTEAD OF trigger defined on it For more information about INSTEAD OF triggers, see CREATE TRIGGER (Transact -SQL) Limitations and Restrictions When TOP is used with DELETE, the referenced rows are not arranged in any order... BULK INSERT statement can be executed within a user-defined transaction to import data into a table or view Optionally, to use multiple matches for bulk importing data, a transaction can specify the BATCHSIZE clause in the BULK INSERT statement If a multiple-batch transaction is rolled back, every batch that the transaction has sent to SQL Server is rolled back Interoperability Importing Data from a . (Transact -SQL) SELECT (Transact -SQL) DELETE (Transact -SQL) UPDATE (Transact -SQL) INSERT (Transact -SQL) UPDATETEXT (Transact -SQL) MERGE (Transact -SQL) WRITETEXT (Transact -SQL) READTEXT (Transact -SQL) . Microsoft SQL Server 2012 Transact -SQL DML Reference SQL Server Books Online Summary: Data Manipulation Language (DML) is a vocabulary used to retrieve and work with data in SQL Server. in SQL Server 2012. Use these statements to add, modify, query, or remove data from a SQL Server database. Category: Reference Applies to: SQL Server 2012 Source: SQL Server 2012 Books Online( link