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

  • SEARCH
  • Home
  • 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 9160733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:48:25+00:00 2026-06-17T13:48:25+00:00

First off, I’m using ASP.NET MVC with Entity Framework Code First 5.0 using SQL

  • 0

First off, I’m using ASP.NET MVC with Entity Framework Code First 5.0 using SQL Server. I have an application that requires me to save the status (Working/Off) for every half hour of the day every day of the week. If you do the math that’s 336 rows of nothing but (id, day, time, status, user_id) for every user (potentially thousands of users).

I was wondering which one these scenarios would be more optimum in terms of storage size and the performance of the application (in your opinion).

  1. Store these as 1 row per status (id, day, time, status, user_id) so 336 rows for every user.
  2. Save it all in a comma delimited field in the database (one very large row) and parse them out using C#.
  3. Is there a better way that I haven’t looked into or haven’t considered?

I’m currently leaning towards option 1.

  • 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-17T13:48:26+00:00Added an answer on June 17, 2026 at 1:48 pm

    These are separate pieces of data so you should absolutely not munge them together as comma-separated values. This makes searching, reporting and other things a major pain.

    Table-valued parameters are the most efficient way to do pass multiple rows to SQL Server. However, I do not know if EF is going to paint you into a corner – I hear that there are many normal things you can do in SQL Server that EF/CF still can’t do.

    How it works, you create a table type (I have to guess on data types here):

    CREATE TYPE dbo.StatusData AS TABLE
    (
      [day] DATE,
      [time] TIME,
      [status] VARCHAR(32),
      [user_id] INT
    );
    

    This should match the structure of your table where you plan to store this information (and again, no, you shouldn’t store separate facts in the same column).

    Now you can add this as a parameter to your stored procedure:

    CREATE PROCEDURE dbo.SaveStatus
      @s AS dbo.StatusData READONLY
    AS
    BEGIN
      SET NOCOUNT ON;
    
      INSERT dbo.BaseTable([Day], [Time], [Status], [user_id])
        SELECT [Day], [Time], [Status], [user_id]
        FROM @s;
    END
    GO
    

    Now you can just pass a DataTable or other collection of values from C# into a single stored procedure parameter (use SqlDbType.Structured).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off, I'm using Access 2000 and DAO. I have code that executes a
First off I am using the Codeigniter Framework so this issue is a workaround
First off I have an app that provides the user information about the amount
First off, I only have a very basic understanding of SQL. I can create
First off, I have never used VBA (or VB for that matter), so keep
First off, let me start off that I am not a .net developer. The
First off, I would like to make clear, that I am SUPER NEW TO
First off I use this code to make the navigation bar always stay fixed;
First off, I've never used GWT before. I have good experience in HTML/CSS/JS/JSP. I'm
First off, I'm using XCode 4.0.2. Okay, here is my issue. I can build

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.