User defined table types sometimes show up a unknown data type in Profiler

A couple of our users have a problem when using user defined table types. Calls are made using UDTT as variables and these are then passed to a stored procedure as parameters. Sometimes the application returns a timeout. In such situations a Profiler-Trace
shows the following:
declare @p4 unknown
whereas the correct trace (that is sometimes displayed) should be:
declare @p4 dbo.ReportFilterTableType
ReportFilterTableType is a UDTT. The users do have correct permissions for the UDTT (otherwise they would never be usable for the user). What could be the reason that the data types for the variable
@p4 in the example are sometimes returned as unknown and at other times are returned correctly as
ReportFilterTableType? Could this possibly be a network related issue?
Thank you.
Graham Goodwin Email: [email protected]

I know this is a old post, but i am also facing the same issue that too in my production server. Did you find any workarround for this issue. Please do reply. Critical problem we are facing.
Alka, Is your problem timeouts when passing TVP parameters, or is it that a Profiler Trace shows type "unknown" for the TVP data type name?
If your problem is timeouts, be aware that TVPs do not have statistics so the optimizer might not be able to generate an optimal plan for non-trivial queries. Declaring a primary key or unique constraint on the table type may help since that will provide
useful cardinality information.  You may need to resort to hints in some cases.
I suggest you start a new thread with details of your specific situation if the information in this thread doesn't help.
Dan Guzman, SQL Server MVP,

Similar Messages

  • Syntax error when creating a user-defined table type in SQL Server 2012

    Why am I getting a syntax error when creating a user-defined table type in SQL Server 2014?
    CREATE TYPE ReportsTableType AS TABLE 
    ( reportId INT
    , questionId INT
    , questionOrder INT );
    Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'AS'.

    Hope these posts could help,
    Regards, Dineshkumar,
    Please Mark as Answer if my post answers your question and
    Vote as Helpful if it helps you

  • User defined table type output not coming

    hi all,
    i have a userdefined type delcared as:
    create or replace TYPE SAMPLE_SEARCH AS OBJECT (
    i have a user defined table type defined as:
    I have a stored proc which has an output paramter of type SAMPLE_sEARCH_TABLE.
    that is,
    sp_sample_proc(sample_search_tb OUT SAMPLE_SEARCH_TABLE);
    When i invoke the above stored proc from an anonymous pl/sql block , how can i display the contents of the output parameter using dbms_Output statements?

    Try this.........This is just a sample code.
    (country VARCHAR2(1000),
    city VARCHAR2(1000),
    zip NUMBER,
    add1 VARCHAR2(4000),
    add2 VARCHAR2(4000));
    CREATE OR REPLACE PROCEDURE Sp_Address_Obj(Out_Add_Obj OUT t_Addobj) IS
    v_Addobj t_Addobj := t_Addobj();
    SELECT Address1(u.Object_Name,
    'Add01' || Rownum,
    'Add02' || Rownum) BULK COLLECT
    INTO v_Addobj
    FROM User_Objects u;
    Out_Add_Obj := v_Addobj;
    END Sp_Address_Obj;
    v_Addobj t_Addobj := t_Addobj();
    FOR i IN 1 .. v_Addobj.Count LOOP
    Dbms_Output.Put_Line(v_Addobj(i).Country || '-' ||
    v_Addobj(i).City || '-' ||
    v_Addobj(i).Zip || '-' ||
    v_Addobj(i).Add1 || '-' ||

  • How do i declare a user defined table type sproc parameter as a local variable?

    I have a procedure that uses a user defined table type.
    I am trying to redeclare the @accountList parameter into a local variable but it's not working and says that i must declare the scalar variable @accountList.this is the line that is having the issue: must declare the scalar variable @accountListSET @local_accountList = @accountListALTER PROCEDURE [dbo].[sp_DynamicNumberVisits] @accountList AS integer_list_tbltype READONLY
    ,@startDate NVARCHAR(50)
    ,@endDate NVARCHAR(50)
    DECLARE @local_accountList AS integer_list_tbltype
    DECLARE @local_startDate AS NVARCHAR(50)
    DECLARE @local_endDate AS NVARCHAR(50)
    SET @local_accountList = @accountList
    SET @local_startDate = @startDate
    SET @local_endDate = @endDate
    CREATE TYPE [dbo].[integer_list_tbltype] AS TABLE(
    [n] [int] NOT NULL,
    [n] ASC

    Why are you asking how to be an awful SQL programmer??  Your whole approach to SQL is wrong.
    We have a DATE data type so your insanely long NVARCHAR(50) of Chinese Unicode strings is absurd. Perhaps you can post your careful research on this? Can you post one example of a fifty character date in any language? 
    The use of the "sp_" prefix has special meaning in T-SQL dialect. Good SQL programmers do not use CREATE TYPE for anything. It is dialect and useless. It is how OO programmers fake it in SQL. 
    The design flaw of using a "tbl-" prefix on town names is called "tibbling" and we laugh at it. 
    There are no lists in RDBMS; all values are shown as scalar values. First Normal Form (1NF)? This looks like a set, which would have a name. 
    In any -- repeat any -- declarative programming language, we do not use local variables. You have done nothing right at any level. You need more help than forum kludges. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • User-Defined Table Types - Where is it in SQL Server 2008?

    I am having 2 issues:
    1.  I don't see a folder for 'User-Defined Table Types' under programmability-->Types
    2.  When I execute the following code to create a Type; I get an error 'Incorrect syntax near the keyword 'AS'.'
    USE Locations;
    /* Create a user-defined table type */
    CREATE TYPE LocationTableType AS TABLE
    ( LocationName VARCHAR(50)
    , CostRate INT );

    Hi Shayann,
    The  user-defined table type is a new
    feature from SQL Server 2008. If you want to use it you have to upgrade your database to SQL Server 2008 or above.
    In you scenario(SQL Server 2005),as a workaround, you can use the  local temporary table instead. 
    --in SQL Server 2005
    CREATE TABLE tblType(id INT,name VARCHAR(99))
    CREATE PROC proc1
    SELECT * FROM #temp;
    SELECT * INTO #temp FROM tblType; -- the #temp name is fixed
    INSERT INTO #temp VALUES(1,'Eric');
    EXEC proc1
    --In SQL Server 2008 or above
    CREATE TYPE LocationTableType AS TABLE
    ( id INT,
    name VARCHAR(99) );
    CREATE PROC proc1 @t LocationTableType READONLY
    SELECT * FROM @t
    DECLARE @t LocationTableType;
    INSERT INTO @t VALUES(1,'Eric');
    EXEC proc1 @t
    I still suggest you upgrade to higher SQL Server.
    If you have any question, feel free to let me know.
    Best regards,

  • What is the Object Type for User Define table ?

    Dear All Experts,
    I create one of the User Define Table with no. of UDF's
    I already register User Define Table with Unique ID.
    As per my knowledge, Unique ID is our Object type for that User Define Table.
    I want to add Transaction Notification Code for created Used Define Table.
    This Transaction Notification prevents user to must enter name in that form.
    IF (@object_type = 'Z_Roto' AND (@TRANSACTION_TYPE = 'A' or @TRANSACTION_TYPE = 'U'))
    If not Exists (Select T0.DocEntry from [@Z_ROTO] T0 Where ( T0.Name is null  OR  T0.Name = ' ' ) AND T0.Code  = @list_of_cols_val_tab_del )
    SET @error = 1
    SET @error_message = 'Name is NULL then So, Please enter ZERO Value i.e. 0 in Filed_Name'
    Please help me for this problem.
    Thanks & Regards,
    Nishit Makadia

    Hi All,
    Thanks for your replay.
    Below code is working for User Define Table's Transaction Notification
    IF (@transaction_type = 'A' OR @transaction_type = 'U') AND @object_type = 'Z_Roto'
    If Exists (Select T0.Code from [@Z_ROTO] T0 Where ( T0.Name is null  OR  T0.Name = ' ' ) AND T0.Code  = @list_of_cols_val_tab_del)
    select @error = 10
    select @error_message = 'Name is NULL then So, Please enter ZERO Value i.e. 0 in Filed_Name'
    Necessary to Remember 4 Things. That are mentioned below.
    1) Register User Define Table (UDT) with using "Object Registration Wizard". For Example : @object_type = 'Z_Roto'
    2) When you define selection criteria then it must be compulsory for use Code Field. For Example : Select T0.Code from [@Z_Roto]
    3) When you define selection criteria then it must be compulsory for use Code for @list_of_cols_val_tab_del.
    4) Use error code as 10 Number
    Thanks & Regards,
    Nishit Makadia

  • Item Code Auto Generation Based on User defined Tables

    I need the Item code like
    I created the following User define Tables and link to Item Master data
    U_PRO             - FOR PRODUCT TYPE
    U_GROUP        - FOR  ITEM GROUP
    U_BRD              - FOR BRAND NAME
    U_COLOR         - FOR COLOR
    i need a formatted search in Item code to fetch the codes from the user defined  table
    i tried with the following
    SELECT T5.[Code]'-'T2.[Code]'-'T3.[Code]'-'T4.[Code]'-'T0.[Code]'-'T1.[Code] FROM [dbo].[@BRD]  T0 , [dbo].[@COLOR]  T1, [dbo].[@GROUP]  T2, [dbo].[@ITEMCODE]  T3, [dbo].[@SUBITEM]  T4, [dbo].[@PRO]  T5 INNER JOIN OITM T6 ON T5.Code = T6.U_PRO WHERE
    T5.[Code] = T6.[$U_PRO] AND 
    T2.[Code] = T6.[$ U_GROUP] AND
    T3.[Code] = T6.[$U_ITEMCODE] AND
    T4.[Code] = T6.[$U_SUBITEM] AND
    T0.[Code]  = T6.[$U_BRD] AND
    T1.[Code]  = T6.[$U_COLOR]
    showing errors. Can any one help me regarding this. I badly need the query for Auto generation of Itemcode

    How can you assign those UDF value without ItemCode in the first place?

  • CR2008 - User-Defined Table

    What is the proper way to add a user-defined table in CR2008 that does not show up as a zero-version stored procedure in the Database Expert?  Thank you.

    Hi Tony,
    Thank you for the info. Now I know what you are referring to. CR has never supported functions and we don't support the native client.
    What CR does, if you add a real stored Procedure to the report what you'll see is the call SP:1. It's a default parameter that has always been there. I don't recall now why we do that but something MS required.
    Try using a Command Object, once you are connected the select Command. You can type in the SQL to call the function or possibly using a SQL Expression may work also.
    Thank you

  • Attach User define tables and view table need add to database into my add-o

    Hi there,
    I want to deploy an addon, there are User define tables and view table need add to database.
    I need some advice on some issues..
    1. Can I attach User define tables and view table need add to database into my addon.
    2. I wonder which chance is properly to add them, if add these user define objects in time of install and I can't get the enough information that connect to SQL server
    Thanks for any help.

    Hi Weerachai,
    Here's an example of how to create a user-defined table in code. My suggestion would be to check if it exists when your add-on starts up and then if not, create the tables, fields and objects.
    'User Table
        Private Sub CreateTable(ByVal sTable As String, ByVal sDescription As String, ByVal oObjectType As SAPbobsCOM.BoUTBTableType)
            Dim oUserTablesMD As SAPbobsCOM.UserTablesMD
            Dim iResult As Long
            Dim sMsg As String
            oUserTablesMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
            If Not oUserTablesMD.GetByKey(sTable) Then
                oUserTablesMD.TableName = sTable
                oUserTablesMD.TableDescription = sDescription
                oUserTablesMD.TableType = oObjectType
                iResult = oUserTablesMD.Add()
                If iResult <> 0 Then
                    oCompany.GetLastError(iResult, sMsg)
                    MessageBox.Show("Error Creating Table: " & sTable & " Error: " & sMsg)
                End If
            End If
        End Sub
    'User Field
        Private Sub CreateField(ByVal sTable As String, ByVal sName As String, ByVal sDescription As String, _
                                ByVal iSize As Integer, ByVal aFieldType As SAPbobsCOM.BoFieldTypes, _
                                ByVal aSubType As SAPbobsCOM.BoFldSubTypes, ByVal sLink As String, _
                                ByVal bMandatory As SAPbobsCOM.BoYesNoEnum)
            Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD
            Dim oTable As SAPbobsCOM.UserTable
            Dim iResult As Long
            Dim sMsg As String
            Dim i As Integer
            Dim x As Integer
            Dim bFound As Boolean = False
            Dim oField As SAPbobsCOM.Field
            oTable = oCompany.UserTables.Item(sTable)
            For i = 0 To oTable.UserFields.Fields.Count - 1
                oField = oTable.UserFields.Fields.Item(i)
                If oField.Name = "U_" & sName Then
                    bFound = True
                End If
            If Not bFound Then
                oUserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
                oUserFieldsMD.TableName = "@" & sTable
                oUserFieldsMD.Name = sName
                oUserFieldsMD.Description = sDescription
                oUserFieldsMD.Type = aFieldType
                If aFieldType = SAPbobsCOM.BoFieldTypes.db_Alpha Or aFieldType = SAPbobsCOM.BoFieldTypes.db_Numeric Then
                    oUserFieldsMD.EditSize = iSize
                    oUserFieldsMD.SubType = aSubType
                    oUserFieldsMD.Mandatory = bMandatory
                End If
                oUserFieldsMD.LinkedTable = sLink
                iResult = oUserFieldsMD.Add()
                If iResult <> 0 Then
                    oCompany.GetLastError(iResult, sMsg)
                    MessageBox.Show("Error Creating Field: " & sTable & "." & sName & " Error: " & sMsg)
                End If
            End If
        End Sub
    If you want to create a View I think you would have to use the RecordSet object. This will ensure that you don't have to log in to the database again
    Hope it helps,

  • Formatted search in the User defined table

    Hi All..
    I created two user defined table one is for document row and other is for document master.So in the master table created one column named as Sales order no and through formatted search call the sales order no in that column.Now i want that in my child table i want to show the those items which belongs to the selected sales order no in the master table.So how can i do that through Formatted search.Is there any query of it then please forward it..

    Ya Sure..
    I need some quality check on the items after delivery so i am trying to manage it through the user defined tables.I created two tables first is document type ,Second is Document type rows.Now i created 5 user defined field in both the table.Now i want to call my sales order and its items in the i created one fms and call the sales order in the Document table now when i double click on the first row after that i am able to see the new table which is the document row table .Now i need the item code and description of the selected sales order in the document rows table.So how the items and description can come in the row type table through FMS..
    I hope now u r able to get my scenario..

  • No value is select  from  user define  table

    Hi ALL,
                 i am using  B1if , i am sending  data  B1 to  isr , i am using user define table  but problem  no value is select  from  user define  table  .
    my table ID  is @SSRPOD 
    <payload operation="">
         <ns0:MT_POD_B1_System xmlns:ns0="">
                             <xsl:value-of select="$msg/BOM/BO/@SSRPOD/row/U_SalOrdNo" />
                             <xsl:value-of select="$msg/BOM/BO/@SSRPOD/row/U_TaxDate" />
                                  <xsl:value-of select="$msg/BOM/BO/@SSRPOD/row/U_Quantity" />
                                  <xsl:value-of select="$msg/BOM/BO/@SSRPOD/row/U_Unitmsr" />
    I have set following things. 
    Inbound Channel
        scenirio step identifier :z.xxxx
        Inbound Channel(IPO):INB_B1_EVNT_ASYN_EVT
        Process Trigger:B1Event
        Identification Method: B1Event
        Identification Parameter:n.a
        Identifier Namespace:??????
      can anyone help me?
    Edited by: Sinha_Sinha on Feb 3, 2012 7:47 AM

    Found an authorization object was missing, that enabled the case types to show but hitting the GO button brought a page that can not be viewed in IE.  on to the next hurdle..........

  • Print Layout to User Defined Table

    Hello guyz..
    I want a make preprinted for my user query from user defined table where the header information is from another query.
    I guess, the base template User Report (system) can only show the repetitve data from one query but the header area is not,
    could you help, showing the header information from another query ??
    Thanks Regards

    The word is that you cannot use the PLD with user defined tables (i wish it was possible).  So in any case to do that you have to use third party tools such as Crystal Reports and Reporting Services

  • Error while  adding records in user defined table

    Dear all,
                    I am adding a record in user defined table using   .add() method. the code is given below. while adding it raises the following error
    "-1[Microsoft]  [SQL Native Client] [SQL Server] Conversion failed when converting the nvarchar value '-3 @BG_MAILSETTINGS'  to data type int. (CINF).  "
    All the fields are varchar date type.  
                Dim oUDT As SAPbobsCOM.UserTable
                oUDT = oCompany.UserTables.Item("BG_MAILSETTINGS")
                With oForm.DataSources.UserDataSources           
                        oUDT.Code = "1"
                        oUDT.Name = "SMTPSERVER"
                        oUDT.UserFields.Fields.Item("U_SERVER").Value = .Item("EDTSMTPSVR").ValueEx
                        oUDT.UserFields.Fields.Item("U_EMAIL").Value = .Item("EDTFEMAIL").ValueEx
                        oUDT.UserFields.Fields.Item("U_PORT").Value = .Item("EDTSMTPPRT").ValueEx
                        oUDT.UserFields.Fields.Item("U_USERNAME").Value = .Item("EDTSMTPUSR").ValueEx
                        oUDT.UserFields.Fields.Item("U_PASSWORD").Value = .Item("EDTSMTPPWD").ValueEx
                        oUDT.UserFields.Fields.Item("U_AUTHENT").Value = .Item("CMBSMTPAUT").ValueEx
                        K = oUDT.Add
                        If K <> 0 Then
                            oCompany.GetLastError(iErrCode, sErrMsg)
                            MsgBox(CStr(iErrCode) & "-" & sErrMsg, vbCritical, "Error")
                            Exit Sub
                        End If
                 End with
    Could any one please say the solution for this.
    Many thanks,
    Edited by: Rui Pereira on Dec 23, 2008 3:49 PM

    Dear Manikandan P,
    Is there any change and check in stored procedure SBO_SP_TransactionNotification?
    Best Regards
    Jane Jing
    SAP Business One Forums team
    Edited by: Rui Pereira on Dec 23, 2008 3:56 PM

  • Error while linking user defined table to user defined field using vb6.0

    I am creating a userdefined field on a SAPB1 table(PDN1) using vb 6.0
    I am trying to link this field to a user defined table.
    When i do that i get the following error:
    "The field 'Related table' should consist of 8 alphanumeric chracters with no valid or default values"
    When i try to do the same thing from SAPB1(not using code) there is no such problem.
    My vb code is as follows:
    Set oUserFieldsMD = oCmp.GetBusinessObject(oUserFields)
    oUserFieldsMD.TableName = "PDN1"
    oUserFieldsMD.Name = "OB_Locn"
    oUserFieldsMD.Description = "WH Location"
    oUserFieldsMD.Type = db_Alpha
    oUserFieldsMD.EditSize = 30
    lRetCode = oUserFieldsMD.Add
    If lRetCode <> 0 Then
        oCmp.GetLastError lErrCode, sErrMsg
        MsgBox sErrMsg
        GoTo Err_
    End If
    If Not oUserFieldsMD.GetByKey("PDN1", 0) Then
        MsgBox "Error"
        GoTo Err_
    End If
    oUserFieldsMD.LinkedTable = "OB_TEST"
    lRetCode = oUserFieldsMD.Update
    Your help will be much appreciated.

    Great Sébastien!
    Looks like we could not survive here one day without your contribution
    Best regards,
    PS: For readers of this thread who don't understand why
    must be "8":
    This is the size of the
    field in the user-defined table to which the new field OB_Locn (in the DB it will be U_OB_Locn) is linked to...
    So, it should be preferrably of the same size.

  • User defined field values doesnot show up in summary tab

    I have created my own stylesheet to display some of my user defined field values (associated with organization address book entry type) in the summary tab of the addressbook entry. But Groupwise 8.0 client FAILS to display any of the user defined field values in the summary tab FOR ONLY ORGANIZATION ADDRESSBOOK ENTRY types. NOTE: These organization addressbook entries are created using the C++ Groupwise object API. But the Advanced tab of these organization addressbook entry shows those user defined fields with values in it.
    Also Groupwise 8.0 Client is able to display the user defined field values in the summary tab for the PERSON ADDRESSBOOK ENTRY types, that are created using the Groupwise Object API. Also when I create a Organization addressbook entry using the Groupwise Client (NEW ORGANIZATION) and fill in the user defined field values using the Advanced tab or that addressbook entry, the summary tab displays those user defined field values.
    So there could be some problem in setting the user defined field value for the Organization address book entry using the Object API or it could be Groupwise 8.0 Client issue in displaying the user defined field values ONLY FOR ORGANIZATION ADDRESS BOOK ENTRY, WHICH ARE CREATED USING THE OBJECT API. I also tried to see the underlying XML data in the summary tab and that XML data is missing the USERDEFINEDFIELDS and CATEGORIES tag for the organization address book entry.
    I would like to know, if there is any need for special handling only for Organization addressbook entry in Groupwise 8.0 API. Any thoughts or help is really appreciated.

    Does anyone have an idea?? Think I have the same issue. Except, when I log in the client (ver. 802) then all the info is displayed. But when the user logs in on the same client and the same pc, he sees the xml info except the office address.
    Any help is greatly appreciated!
    Joost Brenters

Maybe you are looking for

  • Why do I get build failed "Can't find project or library" in TFS 2013

    Using TFS 2013, VB6, Windows Server 2008R2 Problem:  While performing a TFS build of a VB6 application, I am receiving an error "Compile error in file c:\builds\clsCommon.cls Line 122:Can'tfind project or library" Setup: I have three projects: two VB

  • Screen not calibrated correctly

    Hi, I've had my iPhone for ages now and have had quite a few problems with it... Cracked glass twice etc... The problem I have now is that the screen seems to have "decalibrated" itself. It doesn't register the touch where it actually happens. For ex

  • ALV problem.pls

    hi , 1.i have a toolbar in the alv output,,,but according to my client requirement ,i have to add 4 more standard functions to the can we achieve this? 2.I need to download the alv output in Excel format..there is a standard function in

  • Dynamic Authorization Failed

    hi I keep getting error meesages on the ISE in regards to RADIUS the error is Dynamic Authorization failed : 1213 No response received from Network Access Device i am using ISE version 1.1.1 and the NAD is a WLC running version i use ISE to

  • Is discoverer  included with forms and reports ?

    Can anyone confirm whether Discoverer is included in the forms and reports server installation (10g) or does it require the full application server. Does it need the infrastructure database ? Is there a discoverer forum ? ( I can't find it )