Functions SQL 2005 Adventure Works OLTP

dbo.ufnGetContactInformation

Object type: User defined function

Table value function returning the first name, last name, job title and contact type for a given contact.

Syntax

dbo.ufnGetContactInformation ( ContactID )

Parameters 

Variable  Data Type  Required  Description 
ContactID  int  Yes Input parameter for the table value function ufnGetContactInformation. Enter a valid ContactID from the Person.Contact table. 

Properties 

Output data type  Transactional  Uses cursors  Executes procedures  Dynamic content  Encrypted 
TABLE  No No No No No

Data Source Activity 

Accesses  Description 
HumanResources.Employee  Employee information such as salary, department, and title. 
Person.Contact  Names of each employee, customer contact, and vendor contact. 
Person.ContactType  Lookup table containing the types of contacts stored in Contact. 
Purchasing.VendorContact  Cross-reference table mapping vendors and their employees. 
Sales.Individual  Demographic data about customers that purchase Adventure Works products online. 
Sales.StoreContact  Cross-reference table mapping stores and their employees. 

Columns 

Name  Data type  Nullable  Description 
ContactID  int  No  
FirstName  nvarchar(50)  Yes  
LastName  nvarchar(50)  Yes  
JobTitle  nvarchar(50)  Yes  
ContactType  nvarchar(50)  Yes  

Constraints 

Name  Type  Columns  Description 
PRIMARY KEY #1  PRIMARY KEY  ContactID   

Applies to

Functions | Multi-value table
The AdventureWorks database sample was developed by Microsoft Corporation, copyright 2005. SQL Server is a trademark of Microsoft Corporation

Document was prepared on: Thursday, April 05, 2007
Help compiled by DBDocumentor, a Pikauba Software product. All rights reserved.