Data Type Sizes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?R3JlZw==?=

    #1

    Data Type Sizes

    I'm using VB.Net 2005 and am defining parameters for a stored procedure using
    the following code snippet.

    MyBase.sqlAddPa rameter("@strEx tension", _
    SqlDbType.NVarC har, 4, _
    objEmployee.Tab les("tblEmploye es").Rows(0).It em("Extension") )

    In this case I know the length of my variable as 4 charactes long. But, I
    also have SQL Variable Types of Image and NText. NText has no defined size,
    nore does Image as far as I can tell. What values am I to put in these cases.
    Better, yet, where can I find the sizes for all the SQL Server Types for this
    statement.

    Thanks;.
  • WenYuan Wang [MSFT]

    #2
    RE: Data Type Sizes

    Hello AccessVBAnet,

    According to your description, you want to know how to define the size of
    SQLParameter when the underlying data type is Image/NText. If I
    misunderstood anything here, please correct me.

    My suggestion is you needn't to specify the size for Image parameter. If it
    is not explicitly set in the size parameters, the Size and Precision are
    inferred from the value of the dbType parameter

    By the way, you can also set it as "0" if it is necessary in your case.
    this._adapter.I nsertCommand.Pa rameters.Add(ne w
    global::System. Data.SqlClient. SqlParameter("@ Image",
    global::System. Data.SqlDbType. Image, 0,
    global::System. Data.ParameterD irection.Input, 0, 0, "Image",
    global::System. Data.DataRowVer sion.Current, false, null, "", "", ""));"

    Hope this helps. Please feel free to update here again, if you have any
    more concern. We are glad to assist you.

    Have a great day,
    Best regards,

    Wen Yuan
    Microsoft Online Community Support
    =============== =============== =============== =====
    This posting is provided "AS IS" with no warranties, and confers no rights.

    Comment

    • WenYuan Wang [MSFT]

      #3
      RE: Data Type Sizes

      Hello,

      This is Wen Yuan again. I just want to check if there is anything we can
      help with.
      Please feel free to update here again, if you have any more concern. We are
      glad to assist you.

      Have a great day,
      Best regards,

      Wen Yuan
      Microsoft Online Community Support
      =============== =============== =============== =====
      This posting is provided "AS IS" with no warranties, and confers no rights.

      Comment

      Working...