HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

View Existing Table-valued Parameters

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
valuedviewexistingparameterstable

Problem

I have seen many tutorials on how to create a table-valued parameter - but how do you view a table-valued parameter after it has been created?

I would prefer a way of using the GUI in SSMS but T-SQL would suffice as well.

Solution

Please use this code to create a table value Parameter.

--create a new database
USE [master]
GO
CREATE DATABASE DemoTVP
GO

--Change context to the new databse
USE [DemoTVP]
GO

--creating table-Valued Parameters
CREATE TYPE LocationTableType AS TABLE   
( LocationName VARCHAR(50)  
, CostRate INT );  
GO


Then you see the above created table value parameter in SSMS.

Using TSQL you can see the same.

USE [DemoTVP]
GO
SELECT * FROM [sys].[objects]
WHERE [type] ='TT'
ORDER BY create_date DESC

Code Snippets

--create a new database
USE [master]
GO
CREATE DATABASE DemoTVP
GO


--Change context to the new databse
USE [DemoTVP]
GO

--creating table-Valued Parameters
CREATE TYPE LocationTableType AS TABLE   
( LocationName VARCHAR(50)  
, CostRate INT );  
GO
USE [DemoTVP]
GO
SELECT * FROM [sys].[objects]
WHERE [type] ='TT'
ORDER BY create_date DESC

Context

StackExchange Database Administrators Q#170562, answer score: 5

Revisions (0)

No revisions yet.