2

在下面的 sql 代码中,T(C) 是什么意思?什么是T,什么是C?

declare @employeeData xml --this would be your XML input parameter
set @employeeData = '<employeeData>
<employee LastName="Smith" FirstName="Randolph" EmployeeID="1234567"/>
</employeeData>'

declare @xmlTable table (LastName nvarchar(255), FirstName nvarchar(255), EmployeeID int)

insert into @xmlTable (LastName, FirstName, EmployeeID)
select 
C.value('@LastName','nvarchar(255)') as LastName,
C.value('@FirstName','nvarchar(255)') as FirstName,
C.value('@EmployeeID','int') as EmployeeID
from
@employeeData.nodes('/employeeData/employee') T(C)

select * from @xmlTable
4

1 回答 1

2

查看 MSDN:http: //msdn.microsoft.com/en-us/library/ms188282.aspx

T - 表 C - 列

于 2013-05-10T18:14:43.710 回答