Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8786221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:33:48+00:00 2026-06-13T21:33:48+00:00

i am inserting table in database using table datatype with the following code: CREATE

  • 0

i am inserting table in database using table datatype with the following code:

CREATE TYPE BackUpDoctorLocationAreaRoom AS TABLE (
[RoomId] bigint,
[AreaId] bigint,
[LocationId] bigint
);

Alter proc proc_tblBackUpDoctorInsert 
(
@Id uniqueidentifier='',
@BackUpDoctorId uniqueidentifier='1323e1f4-7a93-4b45-9a9b-3840c32fd6d8',  
@StartDate datetime='11/08/2012',  
@EndDate datetime='11/09/2012',  
@StartTime datetime='22:22:22',  
@EndTime datetime='01:11:11',  
@CreatedBy uniqueidentifier='acf7961c-4111-49ad-a66a-ce7f9ce131bd',  
@ModifiedBy uniqueidentifier='acf7961c-4111-49ad-a66a-ce7f9ce131bd',  
@createdDate datetime='11/6/12 3:09:58 AM',  
@ModifiedDate datetime='11/6/12 3:09:58 AM',
@tblBackUpDoctorsForRooms BackUpDoctorLocationAreaRoom READONLY
)    
as    
set xact_abort on
declare @newId uniqueidentifier;    
set @newId = newid(); 
insert into tblBackUpDoctor (Id,BackUpDoctorId,StartDate,EndDate,StartTime,EndTime,CreatedBy,ModifiedBy,
createdDate,ModifiedDate,IsActive,isdeleted) values 
(@newId,    
@BackUpDoctorId,    
@StartDate,    
@EndDate,    
@StartTime,    
@EndTime,    
@CreatedBy,    
@ModifiedBy,    
@createdDate,    
@ModifiedDate,    
1,0)    
declare @IdFortblBackUpDoctorsForRooms uniqueidentifier;    
set @IdFortblBackUpDoctorsForRooms = newid();    
delete from tblBackUpDoctorsForRooms where BackUpRecordId=@id and Roomid in (Select roomid from @tblBackUpDoctorsForRooms)
delete from tblbackupdoctor where id=@id
insert into tblBackUpDoctorsForRooms (BackUpRecordId,Roomid,Araeid,locationid)    
Select  @newId,roomid,areaid,locationid from @tblBackUpDoctorsForRooms
select @newId

This is the sp in which i am using that table.

My class file’s code is :

public string InsertBackUpDoctor(ClsBackUpDoctorProp objProp, DataTable dtLocAreaRoom)
{
    String ConnectionString = CCMMUtility.GetCacheForWholeApplication();
    String backUpRecordId = "";
    SqlParameter[] param = new SqlParameter[12];
    param[0] = new SqlParameter("@Id", objProp.Id);
    param[1] = new SqlParameter("@BackUpDoctorId", objProp.BackUpDoctorId);
    param[2] = new SqlParameter("@StartDate", objProp.StartDate);
    param[3] = new SqlParameter("@EndDate", objProp.EndDate);
    param[4] = new SqlParameter("@StartTime", objProp.StartTime);
    param[5] = new SqlParameter("@EndTime", objProp.EndTime);
    param[6] = new SqlParameter("@CreatedBy", objProp.CreatedBy);
    param[7] = new SqlParameter("@ModifiedBy", objProp.ModifiedBy);
    param[8] = new SqlParameter("@createdDate", CCMMUtility.GetCurrentDateTimeByTimeZone("US Mountain Standard Time"));
    param[9] = new SqlParameter("@ModifiedDate", CCMMUtility.GetCurrentDateTimeByTimeZone("US Mountain Standard Time"));
    param[10] = new SqlParameter("@CurrentDate", objProp.CurrentDate);
    param[11] = new SqlParameter("@tblBackUpDoctorsForRooms ", dtLocAreaRoom);


    backUpRecordId = SqlHelper.ExecuteScalar(ConnectionString, "proc_tblbackupdoctorInsertBackUpDoctors", param).ToString();
    return backUpRecordId;
}

and here is the error which is coming when i tries to insert :

The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Table-valued parameter 12 (“@tblBackUpDoctorsForRooms”), row 0, column 0: Data type 0xF3 (user-defined table type) has a non-zero length database name specified. Database name is not allowed with a table-valued parameter, only schema name and type name are valid.
I dont know why this coming please help me..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:33:50+00:00Added an answer on June 13, 2026 at 9:33 pm

    I believe you’d have to change the way you pass your custom parameter:

    Not just

    param[11] = new SqlParameter("@tblBackUpDoctorsForRooms ", dtLocAreaRoom);
    

    but rather something like

    SqlParameter parameter = new SqlParameter();           
    
    parameter.ParameterName = "@tblBackUpDoctorsForRooms";               
    parameter.SqlDbType = System.Data.SqlDbType.Structured;
    parameter.TypeName = "BackUpDoctorLocationAreaRoom";                
    parameter.Value = dtLocAreaRoom;                                  
    
    param[11] = parameter;       
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i created a table in the database (mysql),and i write a code for inserting
I am inserting a new row to the database table using Entity Framework, but
i have a database table prop_amenities which have following columns here is the create
I have a problem with inserting data into SQLite database using QSqlTableModel. The table
I am inserting values into a table and below is my code protected void
I am having a problem with inserting a new row in database using Doctrine
I have a table in database which has following structure(data) : +--------------------------+ Organization +--------------------------+
I'm inserting a number of instances of a particular object to a database using
My database table have a Timestamp column and i am using LINQ for insert,
I'm using MVC3 with C# code. I have a table in my SQL Server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.