Generic TVP tradeoffs?Do I need a separate Id column for this “mapping” table?With MS SQL Server are the generated constraint names predictable?Create a table dynamically in SQL Serverdeteriorating stored procedure running timesUpdate all rows from a table with random foreign key from another tableSelect Into removes IDENTITY property from target tableWhy am I getting “Snapshot isolation transaction aborted due to update conflict”?What is a “Partial Matching Index”?Insert statement on one table blocking delete on another unrelated table on sql serverWindowed IDENTITY column definition?

Do I need to consider instance restrictions when showing a language is in P?

How is the partial sum of a geometric sequence calculated?

HP P840 HDD RAID 5 many strange drive failures

Is honey really a supersaturated solution? Does heating to un-crystalize redissolve it or melt it?

In Aliens, how many people were on LV-426 before the Marines arrived​?

Describing a chess game in a novel

Constant Current LED Circuit

What is the relationship between relativity and the Doppler effect?

Would it be believable to defy demographics in a story?

Geography in 3D perspective

Pronounciation of the combination "st" in spanish accents

What are substitutions for coconut in curry?

What is the term when voters “dishonestly” choose something that they do not want to choose?

Calculate the frequency of characters in a string

If "dar" means "to give", what does "daros" mean?

Help prove this basic trig identity please!

Probably overheated black color SMD pads

Help rendering a complicated sum/product formula

How to terminate ping <dest> &

Worshiping one God at a time?

How difficult is it to simply disable/disengage the MCAS on Boeing 737 Max 8 & 9 Aircraft?

PTIJ: Do Irish Jews have "the luck of the Irish"?

Can a wizard cast a spell during their first turn of combat if they initiated combat by releasing a readied spell?

Is it possible to stack the damage done by the Absorb Elements spell?



Generic TVP tradeoffs?


Do I need a separate Id column for this “mapping” table?With MS SQL Server are the generated constraint names predictable?Create a table dynamically in SQL Serverdeteriorating stored procedure running timesUpdate all rows from a table with random foreign key from another tableSelect Into removes IDENTITY property from target tableWhy am I getting “Snapshot isolation transaction aborted due to update conflict”?What is a “Partial Matching Index”?Insert statement on one table blocking delete on another unrelated table on sql serverWindowed IDENTITY column definition?













5















Is there a best practice or strategy for table types used in TVPs? For instance, given the following:



CREATE TABLE dbo.Colors (
Id int identity PRIMARY KEY,
Name nvarchar(100),
);

CREATE TABLE dbo.Shapes (
Id int identity PRIMARY KEY,
Name nvarchar(100),
);

CREATE TABLE dbo.Materials (
Id int identity PRIMARY KEY,
Name nvarchar(100),
);

CREATE TABLE dbo.Items (
Id int identity PRIMARY KEY,
Name nvarchar(100),
ColorId int FOREIGN KEY REFERENCES dbo.Colors (ID),
ShapeId int FOREIGN KEY REFERENCES dbo.Shapes (ID),
MaterialId int FOREIGN KEY REFERENCES dbo.Materials (ID),
);


If you implemented a stored procedure for searching items that needed to support selecting multiple colors, multiple shapes, and multiple materials via TVPs (think checkbox lists in the UI), would you create three separate table types, one for every TVP, or would you create a single type for using it across all three?



In other words, this:



CREATE TYPE dbo.ColorIds AS TABLE (Id int);
CREATE TYPE dbo.ShapeIds AS TABLE (Id int);
CREATE TYPE dbo.MaterialIds AS TABLE (Id int);
GO

CREATE PROCEDURE dbo.SearchItems
@ColorIds ColorIds READONLY,
@ShapeIds ShapeIds READONLY,
@MaterialIds MaterialIds READONLY
AS
BEGIN
PRINT 'Do something here'
END
GO


Versus this:



CREATE TYPE dbo.Ids AS TABLE (Id int);
GO

CREATE PROCEDURE dbo.SearchItems
@ColorIds Ids READONLY,
@ShapeIds Ids READONLY,
@MaterialIds Ids READONLY
AS
BEGIN
PRINT 'Do something here'
END
GO


The sample is deliberately contrived; the real use case consists of a lot more tables which although have different columns, all have a ID int primary key. Because of this, I personally am much more inclined to do the latter. It's far less overhead, but I'm curious to know if there are any cons I should be aware of in doing this. This is of course for TVPs and TVPs only (I would never mix different entities in a real table, or any other structure of a more permanent nature.)



While at it, what is your naming convention for naming table types and TVPs?










share|improve this question









New contributor




Daniel Liuzzi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    5















    Is there a best practice or strategy for table types used in TVPs? For instance, given the following:



    CREATE TABLE dbo.Colors (
    Id int identity PRIMARY KEY,
    Name nvarchar(100),
    );

    CREATE TABLE dbo.Shapes (
    Id int identity PRIMARY KEY,
    Name nvarchar(100),
    );

    CREATE TABLE dbo.Materials (
    Id int identity PRIMARY KEY,
    Name nvarchar(100),
    );

    CREATE TABLE dbo.Items (
    Id int identity PRIMARY KEY,
    Name nvarchar(100),
    ColorId int FOREIGN KEY REFERENCES dbo.Colors (ID),
    ShapeId int FOREIGN KEY REFERENCES dbo.Shapes (ID),
    MaterialId int FOREIGN KEY REFERENCES dbo.Materials (ID),
    );


    If you implemented a stored procedure for searching items that needed to support selecting multiple colors, multiple shapes, and multiple materials via TVPs (think checkbox lists in the UI), would you create three separate table types, one for every TVP, or would you create a single type for using it across all three?



    In other words, this:



    CREATE TYPE dbo.ColorIds AS TABLE (Id int);
    CREATE TYPE dbo.ShapeIds AS TABLE (Id int);
    CREATE TYPE dbo.MaterialIds AS TABLE (Id int);
    GO

    CREATE PROCEDURE dbo.SearchItems
    @ColorIds ColorIds READONLY,
    @ShapeIds ShapeIds READONLY,
    @MaterialIds MaterialIds READONLY
    AS
    BEGIN
    PRINT 'Do something here'
    END
    GO


    Versus this:



    CREATE TYPE dbo.Ids AS TABLE (Id int);
    GO

    CREATE PROCEDURE dbo.SearchItems
    @ColorIds Ids READONLY,
    @ShapeIds Ids READONLY,
    @MaterialIds Ids READONLY
    AS
    BEGIN
    PRINT 'Do something here'
    END
    GO


    The sample is deliberately contrived; the real use case consists of a lot more tables which although have different columns, all have a ID int primary key. Because of this, I personally am much more inclined to do the latter. It's far less overhead, but I'm curious to know if there are any cons I should be aware of in doing this. This is of course for TVPs and TVPs only (I would never mix different entities in a real table, or any other structure of a more permanent nature.)



    While at it, what is your naming convention for naming table types and TVPs?










    share|improve this question









    New contributor




    Daniel Liuzzi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      5












      5








      5








      Is there a best practice or strategy for table types used in TVPs? For instance, given the following:



      CREATE TABLE dbo.Colors (
      Id int identity PRIMARY KEY,
      Name nvarchar(100),
      );

      CREATE TABLE dbo.Shapes (
      Id int identity PRIMARY KEY,
      Name nvarchar(100),
      );

      CREATE TABLE dbo.Materials (
      Id int identity PRIMARY KEY,
      Name nvarchar(100),
      );

      CREATE TABLE dbo.Items (
      Id int identity PRIMARY KEY,
      Name nvarchar(100),
      ColorId int FOREIGN KEY REFERENCES dbo.Colors (ID),
      ShapeId int FOREIGN KEY REFERENCES dbo.Shapes (ID),
      MaterialId int FOREIGN KEY REFERENCES dbo.Materials (ID),
      );


      If you implemented a stored procedure for searching items that needed to support selecting multiple colors, multiple shapes, and multiple materials via TVPs (think checkbox lists in the UI), would you create three separate table types, one for every TVP, or would you create a single type for using it across all three?



      In other words, this:



      CREATE TYPE dbo.ColorIds AS TABLE (Id int);
      CREATE TYPE dbo.ShapeIds AS TABLE (Id int);
      CREATE TYPE dbo.MaterialIds AS TABLE (Id int);
      GO

      CREATE PROCEDURE dbo.SearchItems
      @ColorIds ColorIds READONLY,
      @ShapeIds ShapeIds READONLY,
      @MaterialIds MaterialIds READONLY
      AS
      BEGIN
      PRINT 'Do something here'
      END
      GO


      Versus this:



      CREATE TYPE dbo.Ids AS TABLE (Id int);
      GO

      CREATE PROCEDURE dbo.SearchItems
      @ColorIds Ids READONLY,
      @ShapeIds Ids READONLY,
      @MaterialIds Ids READONLY
      AS
      BEGIN
      PRINT 'Do something here'
      END
      GO


      The sample is deliberately contrived; the real use case consists of a lot more tables which although have different columns, all have a ID int primary key. Because of this, I personally am much more inclined to do the latter. It's far less overhead, but I'm curious to know if there are any cons I should be aware of in doing this. This is of course for TVPs and TVPs only (I would never mix different entities in a real table, or any other structure of a more permanent nature.)



      While at it, what is your naming convention for naming table types and TVPs?










      share|improve this question









      New contributor




      Daniel Liuzzi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      Is there a best practice or strategy for table types used in TVPs? For instance, given the following:



      CREATE TABLE dbo.Colors (
      Id int identity PRIMARY KEY,
      Name nvarchar(100),
      );

      CREATE TABLE dbo.Shapes (
      Id int identity PRIMARY KEY,
      Name nvarchar(100),
      );

      CREATE TABLE dbo.Materials (
      Id int identity PRIMARY KEY,
      Name nvarchar(100),
      );

      CREATE TABLE dbo.Items (
      Id int identity PRIMARY KEY,
      Name nvarchar(100),
      ColorId int FOREIGN KEY REFERENCES dbo.Colors (ID),
      ShapeId int FOREIGN KEY REFERENCES dbo.Shapes (ID),
      MaterialId int FOREIGN KEY REFERENCES dbo.Materials (ID),
      );


      If you implemented a stored procedure for searching items that needed to support selecting multiple colors, multiple shapes, and multiple materials via TVPs (think checkbox lists in the UI), would you create three separate table types, one for every TVP, or would you create a single type for using it across all three?



      In other words, this:



      CREATE TYPE dbo.ColorIds AS TABLE (Id int);
      CREATE TYPE dbo.ShapeIds AS TABLE (Id int);
      CREATE TYPE dbo.MaterialIds AS TABLE (Id int);
      GO

      CREATE PROCEDURE dbo.SearchItems
      @ColorIds ColorIds READONLY,
      @ShapeIds ShapeIds READONLY,
      @MaterialIds MaterialIds READONLY
      AS
      BEGIN
      PRINT 'Do something here'
      END
      GO


      Versus this:



      CREATE TYPE dbo.Ids AS TABLE (Id int);
      GO

      CREATE PROCEDURE dbo.SearchItems
      @ColorIds Ids READONLY,
      @ShapeIds Ids READONLY,
      @MaterialIds Ids READONLY
      AS
      BEGIN
      PRINT 'Do something here'
      END
      GO


      The sample is deliberately contrived; the real use case consists of a lot more tables which although have different columns, all have a ID int primary key. Because of this, I personally am much more inclined to do the latter. It's far less overhead, but I'm curious to know if there are any cons I should be aware of in doing this. This is of course for TVPs and TVPs only (I would never mix different entities in a real table, or any other structure of a more permanent nature.)



      While at it, what is your naming convention for naming table types and TVPs?







      sql-server table-valued-parameters






      share|improve this question









      New contributor




      Daniel Liuzzi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Daniel Liuzzi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 13 hours ago







      Daniel Liuzzi













      New contributor




      Daniel Liuzzi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 14 hours ago









      Daniel LiuzziDaniel Liuzzi

      1264




      1264




      New contributor




      Daniel Liuzzi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Daniel Liuzzi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Daniel Liuzzi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes


















          6














          I personally use the latter, more generic version in my systems. I have two tables that I can think of off the top of my head: UniqueIntegerTable and UniqueStringTable - as you can imagine, they are defined as follows:



          CREATE TYPE Utils.UniqueIntegerTable AS TABLE (
          [Value] INT NOT NULL PRIMARY KEY
          );
          CREATE TYPE Utils.UniqueStringTable AS TABLE (
          [Value] NVARCHAR(50) NOT NULL PRIMARY KEY
          );


          I prefer to have generic TVP's so that I don't clog up my schema's with multiple types that are basically the same. The performance is exactly the same as if you defined an explicit type as in your first example and it has the benefit that it creates less code for me to maintain.



          I know one argument that I have previously heard for using explicit types that are bound to tables is that it is easier to understand their usage. I personally don't agree with this. There is nothing preventing me from defining a stored procedure using the wrong type (but has the correct shape for my needs). Instead, I can give the variable a good name to infer usage and the contents of the table:



          CREATE PROCEDURE dbo.UpdateEmployees (
          @employeeIds Utils.UniqueIntegerTable READONLY
          )
          BEGIN
          SET NOCOUNT ON;

          -- Use table as needed.

          END
          GO


          In terms of naming conventions, I don't know of any official standard but the one I use is to append Table to the end of the type name. I know that this is not really all that different from prefixing things with tbl but I'm ok with it in this instance. As with all naming conventions, pick one that you feel is easy to work with it - but once you do, stick to it. Naming conventions are only useful if you are consistent.






          share|improve this answer




















          • 2





            Totally agree with the nothing stopping you from using the wrong type part. In fact, right before posting the question I was checking if there is anything like FK constraints for table types. Didn't find anything. If there was one argument to push me over to favoring specific types, that would have been it. I'm sort of glad it wasn't the case!

            – Daniel Liuzzi
            13 hours ago












          • Yeah, you definitely can't define a foreign key to a table type. I think if it was anything more than a glorified temp table and had a lot more functionality, then I would use explicit types. But as it stands, less maintenance means I can spend more time doing things that are important, rather than worrying about whether I have passed the right type to a stored procedure. ;-)

            – Mr.Brownstone
            13 hours ago










          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "182"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Daniel Liuzzi is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f232372%2fgeneric-tvp-tradeoffs%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          6














          I personally use the latter, more generic version in my systems. I have two tables that I can think of off the top of my head: UniqueIntegerTable and UniqueStringTable - as you can imagine, they are defined as follows:



          CREATE TYPE Utils.UniqueIntegerTable AS TABLE (
          [Value] INT NOT NULL PRIMARY KEY
          );
          CREATE TYPE Utils.UniqueStringTable AS TABLE (
          [Value] NVARCHAR(50) NOT NULL PRIMARY KEY
          );


          I prefer to have generic TVP's so that I don't clog up my schema's with multiple types that are basically the same. The performance is exactly the same as if you defined an explicit type as in your first example and it has the benefit that it creates less code for me to maintain.



          I know one argument that I have previously heard for using explicit types that are bound to tables is that it is easier to understand their usage. I personally don't agree with this. There is nothing preventing me from defining a stored procedure using the wrong type (but has the correct shape for my needs). Instead, I can give the variable a good name to infer usage and the contents of the table:



          CREATE PROCEDURE dbo.UpdateEmployees (
          @employeeIds Utils.UniqueIntegerTable READONLY
          )
          BEGIN
          SET NOCOUNT ON;

          -- Use table as needed.

          END
          GO


          In terms of naming conventions, I don't know of any official standard but the one I use is to append Table to the end of the type name. I know that this is not really all that different from prefixing things with tbl but I'm ok with it in this instance. As with all naming conventions, pick one that you feel is easy to work with it - but once you do, stick to it. Naming conventions are only useful if you are consistent.






          share|improve this answer




















          • 2





            Totally agree with the nothing stopping you from using the wrong type part. In fact, right before posting the question I was checking if there is anything like FK constraints for table types. Didn't find anything. If there was one argument to push me over to favoring specific types, that would have been it. I'm sort of glad it wasn't the case!

            – Daniel Liuzzi
            13 hours ago












          • Yeah, you definitely can't define a foreign key to a table type. I think if it was anything more than a glorified temp table and had a lot more functionality, then I would use explicit types. But as it stands, less maintenance means I can spend more time doing things that are important, rather than worrying about whether I have passed the right type to a stored procedure. ;-)

            – Mr.Brownstone
            13 hours ago















          6














          I personally use the latter, more generic version in my systems. I have two tables that I can think of off the top of my head: UniqueIntegerTable and UniqueStringTable - as you can imagine, they are defined as follows:



          CREATE TYPE Utils.UniqueIntegerTable AS TABLE (
          [Value] INT NOT NULL PRIMARY KEY
          );
          CREATE TYPE Utils.UniqueStringTable AS TABLE (
          [Value] NVARCHAR(50) NOT NULL PRIMARY KEY
          );


          I prefer to have generic TVP's so that I don't clog up my schema's with multiple types that are basically the same. The performance is exactly the same as if you defined an explicit type as in your first example and it has the benefit that it creates less code for me to maintain.



          I know one argument that I have previously heard for using explicit types that are bound to tables is that it is easier to understand their usage. I personally don't agree with this. There is nothing preventing me from defining a stored procedure using the wrong type (but has the correct shape for my needs). Instead, I can give the variable a good name to infer usage and the contents of the table:



          CREATE PROCEDURE dbo.UpdateEmployees (
          @employeeIds Utils.UniqueIntegerTable READONLY
          )
          BEGIN
          SET NOCOUNT ON;

          -- Use table as needed.

          END
          GO


          In terms of naming conventions, I don't know of any official standard but the one I use is to append Table to the end of the type name. I know that this is not really all that different from prefixing things with tbl but I'm ok with it in this instance. As with all naming conventions, pick one that you feel is easy to work with it - but once you do, stick to it. Naming conventions are only useful if you are consistent.






          share|improve this answer




















          • 2





            Totally agree with the nothing stopping you from using the wrong type part. In fact, right before posting the question I was checking if there is anything like FK constraints for table types. Didn't find anything. If there was one argument to push me over to favoring specific types, that would have been it. I'm sort of glad it wasn't the case!

            – Daniel Liuzzi
            13 hours ago












          • Yeah, you definitely can't define a foreign key to a table type. I think if it was anything more than a glorified temp table and had a lot more functionality, then I would use explicit types. But as it stands, less maintenance means I can spend more time doing things that are important, rather than worrying about whether I have passed the right type to a stored procedure. ;-)

            – Mr.Brownstone
            13 hours ago













          6












          6








          6







          I personally use the latter, more generic version in my systems. I have two tables that I can think of off the top of my head: UniqueIntegerTable and UniqueStringTable - as you can imagine, they are defined as follows:



          CREATE TYPE Utils.UniqueIntegerTable AS TABLE (
          [Value] INT NOT NULL PRIMARY KEY
          );
          CREATE TYPE Utils.UniqueStringTable AS TABLE (
          [Value] NVARCHAR(50) NOT NULL PRIMARY KEY
          );


          I prefer to have generic TVP's so that I don't clog up my schema's with multiple types that are basically the same. The performance is exactly the same as if you defined an explicit type as in your first example and it has the benefit that it creates less code for me to maintain.



          I know one argument that I have previously heard for using explicit types that are bound to tables is that it is easier to understand their usage. I personally don't agree with this. There is nothing preventing me from defining a stored procedure using the wrong type (but has the correct shape for my needs). Instead, I can give the variable a good name to infer usage and the contents of the table:



          CREATE PROCEDURE dbo.UpdateEmployees (
          @employeeIds Utils.UniqueIntegerTable READONLY
          )
          BEGIN
          SET NOCOUNT ON;

          -- Use table as needed.

          END
          GO


          In terms of naming conventions, I don't know of any official standard but the one I use is to append Table to the end of the type name. I know that this is not really all that different from prefixing things with tbl but I'm ok with it in this instance. As with all naming conventions, pick one that you feel is easy to work with it - but once you do, stick to it. Naming conventions are only useful if you are consistent.






          share|improve this answer















          I personally use the latter, more generic version in my systems. I have two tables that I can think of off the top of my head: UniqueIntegerTable and UniqueStringTable - as you can imagine, they are defined as follows:



          CREATE TYPE Utils.UniqueIntegerTable AS TABLE (
          [Value] INT NOT NULL PRIMARY KEY
          );
          CREATE TYPE Utils.UniqueStringTable AS TABLE (
          [Value] NVARCHAR(50) NOT NULL PRIMARY KEY
          );


          I prefer to have generic TVP's so that I don't clog up my schema's with multiple types that are basically the same. The performance is exactly the same as if you defined an explicit type as in your first example and it has the benefit that it creates less code for me to maintain.



          I know one argument that I have previously heard for using explicit types that are bound to tables is that it is easier to understand their usage. I personally don't agree with this. There is nothing preventing me from defining a stored procedure using the wrong type (but has the correct shape for my needs). Instead, I can give the variable a good name to infer usage and the contents of the table:



          CREATE PROCEDURE dbo.UpdateEmployees (
          @employeeIds Utils.UniqueIntegerTable READONLY
          )
          BEGIN
          SET NOCOUNT ON;

          -- Use table as needed.

          END
          GO


          In terms of naming conventions, I don't know of any official standard but the one I use is to append Table to the end of the type name. I know that this is not really all that different from prefixing things with tbl but I'm ok with it in this instance. As with all naming conventions, pick one that you feel is easy to work with it - but once you do, stick to it. Naming conventions are only useful if you are consistent.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 13 hours ago

























          answered 13 hours ago









          Mr.BrownstoneMr.Brownstone

          9,59432342




          9,59432342







          • 2





            Totally agree with the nothing stopping you from using the wrong type part. In fact, right before posting the question I was checking if there is anything like FK constraints for table types. Didn't find anything. If there was one argument to push me over to favoring specific types, that would have been it. I'm sort of glad it wasn't the case!

            – Daniel Liuzzi
            13 hours ago












          • Yeah, you definitely can't define a foreign key to a table type. I think if it was anything more than a glorified temp table and had a lot more functionality, then I would use explicit types. But as it stands, less maintenance means I can spend more time doing things that are important, rather than worrying about whether I have passed the right type to a stored procedure. ;-)

            – Mr.Brownstone
            13 hours ago












          • 2





            Totally agree with the nothing stopping you from using the wrong type part. In fact, right before posting the question I was checking if there is anything like FK constraints for table types. Didn't find anything. If there was one argument to push me over to favoring specific types, that would have been it. I'm sort of glad it wasn't the case!

            – Daniel Liuzzi
            13 hours ago












          • Yeah, you definitely can't define a foreign key to a table type. I think if it was anything more than a glorified temp table and had a lot more functionality, then I would use explicit types. But as it stands, less maintenance means I can spend more time doing things that are important, rather than worrying about whether I have passed the right type to a stored procedure. ;-)

            – Mr.Brownstone
            13 hours ago







          2




          2





          Totally agree with the nothing stopping you from using the wrong type part. In fact, right before posting the question I was checking if there is anything like FK constraints for table types. Didn't find anything. If there was one argument to push me over to favoring specific types, that would have been it. I'm sort of glad it wasn't the case!

          – Daniel Liuzzi
          13 hours ago






          Totally agree with the nothing stopping you from using the wrong type part. In fact, right before posting the question I was checking if there is anything like FK constraints for table types. Didn't find anything. If there was one argument to push me over to favoring specific types, that would have been it. I'm sort of glad it wasn't the case!

          – Daniel Liuzzi
          13 hours ago














          Yeah, you definitely can't define a foreign key to a table type. I think if it was anything more than a glorified temp table and had a lot more functionality, then I would use explicit types. But as it stands, less maintenance means I can spend more time doing things that are important, rather than worrying about whether I have passed the right type to a stored procedure. ;-)

          – Mr.Brownstone
          13 hours ago





          Yeah, you definitely can't define a foreign key to a table type. I think if it was anything more than a glorified temp table and had a lot more functionality, then I would use explicit types. But as it stands, less maintenance means I can spend more time doing things that are important, rather than worrying about whether I have passed the right type to a stored procedure. ;-)

          – Mr.Brownstone
          13 hours ago










          Daniel Liuzzi is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          Daniel Liuzzi is a new contributor. Be nice, and check out our Code of Conduct.












          Daniel Liuzzi is a new contributor. Be nice, and check out our Code of Conduct.











          Daniel Liuzzi is a new contributor. Be nice, and check out our Code of Conduct.














          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f232372%2fgeneric-tvp-tradeoffs%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to create a command for the “strange m” symbol in latex? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How do you make your own symbol when Detexify fails?Writing bold small caps with mathpazo packageplus-minus symbol with parenthesis around the minus signGreek character in Beamer document titleHow to create dashed right arrow over symbol?Currency symbol: Turkish LiraDouble prec as a single symbol?Plus Sign Too Big; How to Call adfbullet?Is there a TeX macro for three-legged pi?How do I get my integral-like symbol to align like the integral?How to selectively substitute a letter with another symbol representing the same letterHow do I generate a less than symbol and vertical bar that are the same height?

          Българска екзархия Съдържание История | Български екзарси | Вижте също | Външни препратки | Литература | Бележки | НавигацияУстав за управлението на българската екзархия. Цариград, 1870Слово на Ловешкия митрополит Иларион при откриването на Българския народен събор в Цариград на 23. II. 1870 г.Българската правда и гръцката кривда. От С. М. (= Софийски Мелетий). Цариград, 1872Предстоятели на Българската екзархияПодмененият ВеликденИнформационна агенция „Фокус“Димитър Ризов. Българите в техните исторически, етнографически и политически граници (Атлас съдържащ 40 карти). Berlin, Königliche Hoflithographie, Hof-Buch- und -Steindruckerei Wilhelm Greve, 1917Report of the International Commission to Inquire into the Causes and Conduct of the Balkan Wars

          Чепеларе Съдържание География | История | Население | Спортни и природни забележителности | Културни и исторически обекти | Религии | Обществени институции | Известни личности | Редовни събития | Галерия | Източници | Литература | Външни препратки | Навигация41°43′23.99″ с. ш. 24°41′09.99″ и. д. / 41.723333° с. ш. 24.686111° и. д.*ЧепелареЧепеларски Linux fest 2002Начало на Зимен сезон 2005/06Национални хайдушки празници „Капитан Петко Войвода“Град ЧепелареЧепеларе – народният ски курортbgrod.orgwww.terranatura.hit.bgСправка за населението на гр. Исперих, общ. Исперих, обл. РазградМузей на родопския карстМузей на спорта и скитеЧепеларебългарскибългарскианглийскитукИстория на градаСки писти в ЧепелареВремето в ЧепелареРадио и телевизия в ЧепелареЧепеларе мами с родопски чар и добри пистиЕвтин туризъм и снежни атракции в ЧепелареМестоположениеИнформация и снимки от музея на родопския карст3D панорами от ЧепелареЧепелареррр