view icon View: vAdditionalContactInfo

Properties

Property Value
Name vAdditionalContactInfo
ID 1787153412
Schema Person
Owner dbo
Encrypted false
Schema Bound false
With Check Option false
ANSI NULLS true
Uses Quoted Identifier true
Has Opaque Metadata false
Published false
Schema Published false
Replicated false
Has Replication Filter false
Has Unchecked Assembly Data false
Date Correlation View false
Uses Database Collation false
Tracked by CDC false
MS Shipped false
Modify Date 8/8/2010 5:23:44 PM
Create Date 8/8/2010 5:23:44 PM

Extended Properties

Name Value
MS_Description Displays the contact name and content from each element in the xml column AdditionalContactInfo for that person.

View Columns

Column Name Datatype Nullable Is Identity
BusinessEntityID int false false
FirstName Name false false
MiddleName Name true false
LastName Name false false
TelephoneNumber nvarchar(50) true false
TelephoneSpecialInstructions nvarchar(max) true false
Street nvarchar(50) true false
City nvarchar(50) true false
StateProvince nvarchar(50) true false
PostalCode nvarchar(50) true false
CountryRegion nvarchar(50) true false
HomeAddressSpecialInstructions nvarchar(max) true false
EMailAddress nvarchar(128) true false
EMailSpecialInstructions nvarchar(max) true false
EMailTelephoneNumber nvarchar(50) true false
rowguid uniqueidentifier false false
ModifiedDate datetime false false

Indexes

No view indexes defined.

Object Level Permissions

No object level permissions defined.

Column Level Permissions

No explicit column permissions granted to this object

Objects that depend on [vAdditionalContactInfo]

Objects on which [vAdditionalContactInfo] depends

SQL

Script
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE VIEW [Person].[vAdditionalContactInfo] AS SELECT [BusinessEntityID] ,[FirstName] ,[MiddleName] ,[LastName] ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; (act:telephoneNumber)[1]/act:number', 'nvarchar(50)') AS [TelephoneNumber] ,LTRIM(RTRIM([ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; (act:telephoneNumber/act:SpecialInstructions/text())[1]', 'nvarchar(max)'))) AS [TelephoneSpecialInstructions] ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; (act:homePostalAddress/act:Street)[1]', 'nvarchar(50)') AS [Street] ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; (act:homePostalAddress/act:City)[1]', 'nvarchar(50)') AS [City] ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; (act:homePostalAddress/act:StateProvince)[1]', 'nvarchar(50)') AS [StateProvince] ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; (act:homePostalAddress/act:PostalCode)[1]', 'nvarchar(50)') AS [PostalCode] ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; (act:homePostalAddress/act:CountryRegion)[1]', 'nvarchar(50)') AS [CountryRegion] ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; (act:homePostalAddress/act:SpecialInstructions/text())[1]', 'nvarchar(max)') AS [HomeAddressSpecialInstructions] ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; (act:eMail/act:eMailAddress)[1]', 'nvarchar(128)') AS [EMailAddress] ,LTRIM(RTRIM([ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; (act:eMail/act:SpecialInstructions/text())[1]', 'nvarchar(max)'))) AS [EMailSpecialInstructions] ,[ContactInfo].ref.value(N'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; declare namespace act="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"; (act:eMail/act:SpecialInstructions/act:telephoneNumber/act:number)[1]', 'nvarchar(50)') AS [EMailTelephoneNumber] ,[rowguid] ,[ModifiedDate] FROM [Person].[Person] OUTER APPLY [AdditionalContactInfo].nodes( 'declare namespace ci="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo"; /ci:AdditionalContactInfo') AS ContactInfo(ref) WHERE [AdditionalContactInfo] IS NOT NULL;
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Displays the contact name and content from each element in the xml column AdditionalContactInfo for that person.' , @level0type=N'SCHEMA',@level0name=N'Person', @level1type=N'VIEW',@level1name=N'vAdditionalContactInfo'

See also

List of Views