Most people know the formula for the total resistance of parallel resistors:

\$ \dfrac{1}{R_t} = \dfrac{1}{R_1} + \dfrac{1}{R_2} + {}...{} + \dfrac{1}{R_n} \$

If there are only 2 resistors, that can be easily rearranged to solve for Rt:

\$ {R_t} = \dfrac{(R_1 \cdot R_2)}{(R_1 + R_2)} \$

Is there a safe way to do that for n resistors?


Question: MS SQL Stored Procedure for counting Dynamic table items
Answer: You should use SYSNAME for object identifiers and Quotename rather than concatenating the square brackets yourself.

ALTER PROCEDURE dbo.[Counter] @TableName  SYSNAME,
                              @SchemaName SYSNAME = 'dbo'
AS
  BEGIN
      SET NOCOUNT ON;

      DECLARE @SQLQ NVARCHAR(1000)
      DECLARE @Counter INT;

      SET @SQLQ = 'SELECT @Counter = COUNT(*) FROM ' + 
       Quotename(@SchemaName) + '.' + Quotename(@TableName);

      EXEC sp_executesql
        @SQLQ ,
        N'@Counter INT OUTPUT',
        @Counter = @Counter OUTPUT

         SELECT @Counter
  END