title: SQL 2005 - Variant Parameter Question
body: <p>I am working on a function that will be used by no less than 10 SProc's, and will probably grow once it is ironed out.</p>
  
  <p>Problem i am running into is that i do not want to develop a function for each Data Type, which is why the <code>SQL_VARIANT</code> data type is looking pretty convenient for the action.  I know is can do the <code>ISNULL</code> check on the data type but i also want to check to see if the Value being passed is a valid Number but the <code>ISNUMERIC</code> function does not work with <code>SQL_VARIANT</code> and I'm not too sure about the <code>SQL_VARIANT_PROPERTY</code> function.</p>
  
  <p>Code so far:</p>
  
  <pre><code>CREATE FUNCTION dbo.mpt_Format_Number
  (
      @value SQL_VARIANT
      , @money BIT
  )
  RETURNS VARCHAR
  AS
  BEGIN
      --Check for NULL value
      IF ISNULL(@value) BEGIN
          -- Value IS NULL, return NULL
          RETURN NULL
      END ELSE BEGIN
          -- Value is NOT NULL
          DECLARE @TMP VARCHAR
      END 
  END
  </code></pre>