Table-Valued Parameter without using a stored procedure

时光毁灭记忆、已成空白 提交于 2019-12-07 11:07:22

问题


It seems all I can find online are examples of table-valued parameters that require using a stored procedure. I recall doing this in the past without the stored procedure. Is that possible?

This code keeps throwing an error about the type not being specified.

SqlCommand cmd = new SqlCommand(@"
        UPDATE t1
        SET t1.ScheduledStartUTC = t2.ScheduledStartUTC
        FROM ScheduleTickets AS t1
            INNER JOIN @SetScheduledStart AS t2 ON t1.ScheduleId = t2.ScheduleId AND t1.PatchSessionId  = t2.PatchSessionId 
    ", c);
cmd.Parameters.Add("@SetScheduledStart", SqlDbType.Structured).Value = SetScheduleTicketsDateDT;
cmd.ExecuteNonQuery();

来源:https://stackoverflow.com/questions/49365851/table-valued-parameter-without-using-a-stored-procedure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!