Skip to content

Instantly share code, notes, and snippets.

@bitsprint
Last active December 20, 2015 23:28
Show Gist options
  • Save bitsprint/6212187 to your computer and use it in GitHub Desktop.
Save bitsprint/6212187 to your computer and use it in GitHub Desktop.
Indexed Dictionary (User Defined Table Type)
/****** Object: UserDefinedTableType [dbo].[IndexedDictionary] ******/
IF EXISTS (SELECT * FROM sys.types st JOIN sys.schemas ss ON st.schema_id = ss.schema_id WHERE st.name = N'IndexedDictionary' AND ss.name = N'dbo')
DROP TYPE [dbo].[IndexedDictionary]
GO
/****** Object: UserDefinedTableType [dbo].[IndexedDictionary] ******/
CREATE TYPE [dbo].[IndexedDictionary] AS TABLE(
[Index] [int] NULL,
[Key] [nvarchar](255) NULL,
[Value] [nvarchar](255) NULL
)
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment