Tag Info

New answers tagged

0

This is a possibility with SQL, however it needs to generate a sequence of numbers, since SQL server i was testing this does not support it I had to fetch the sequence from sys.all_objects ROW_NUMBER() function, SELECT n = ROW_NUMBER() OVER (ORDER BY [object_id]) FROM sys.all_objects the approach is to generate a view with number of time intervals small ...


5

This is tricky, because you've modeled your bookings as time intervals with granularity as fine as your DB allows. Perfectly natural to do, but as you've found out it makes some comparisons difficult. Max of For each booking that overlaps given timeRange return sum of each booking that overlaps this booking and given timeRange The ...


0

I'd suggest opting for a SQLite solution. EF does support it and there's a great guide on getting you set up over below: Entity Framework 5 on SQLite I believe a full MySQL solution is going to have a lot of overhead & likely lead to some time intensive debugging. You also mentioned that it is a small project, so SQLite will definitely be adequate. ...


1

If a unit test breaks, you usually know exactly what went wrong; when an integration test breaks, it's a hint that a piece of your process has something wrong with it. If you're comfortable with this and your SP isn't incredibly complex, the integration tests from C# should be fine. A few things to consider : Use a unit testing framework. Calling them ...


1

In less words, this sounds like unit testing. Your "C# scripts" are the units of pass/failure. Is there any practice better than this one to validate SQL based code ? You shouldn't be concerned with validating the actual SQL code. All you really should care about is the validity of the data and the result. You should be decoupling your unit tests ...


1

You seem to already know what the table hint NOLOCK does, but you question "why" do people use it so frequently. In people's experience, or people that have shared experience with them, they have alleviated concurrency problems before by using the read uncommitted table hint. Despite what the hint does (the lack of issuing a shared lock on data to prevent ...


4

Because many teams are clueless about benefits and drawbacks of the different features of Microsoft SQL Server. Imagine a slow app. Management has a choice: either throw more hardware (which translates into immediate and substantial cost), or blame developers for not doing their job correctly and expect them to make it faster (which translates into ...


6

SQL Server will typically optimize the IN to the same as the multiple OR statements. Take this for example: use AdventureWorks; go select BusinessEntityID from HumanResources.Employee where BusinessEntityID = 153 or BusinessEntityID = 25 or BusinessEntityID = 37; select BusinessEntityID from HumanResources.Employee where BusinessEntityID in (153, 25, ...


1

You're basically writing a compiler, which translates from SQL to whatever your datastore understands. In the end, you'll probably have the following parts: a Parser which takes SQL and produces an Abstract Syntax Tree a bunch of Visitors which do semantic analysis and/or rewriting on the AST an Interpreter which finally executes the (processed) query ...


0

Primarily Adapter to adapt native datastore commands to SQL dialect. IMHO I would advise you against exposing SQL API in such case. You are better off delivering native datastore-like commands (possibly wrapped somehow) that are supported by datastore developers. Simply - do you create costly overhead that won't deliver much value?


1

what way is correct ... Being cynical just for a moment, none of them. Try as we might; we never get it completely right. But we can try. ... for performance ... Database. For raw data processing power, leverage your DBMS. You don't say which one you're using but all the Big Players have some sort of procedural language (PL/SQL, T-SQL, ...


5

Unless you have something which the application must supply all the time, I think it would be best to let the database related stuff be handled by the database itself. This will allow you to have the DB to do all the heavy lifting, while allowing the application to remain as lightweight as possible so that it can handle whatever it is that the user needs ...


4

Is this industry standard to rush things? To some degree. Companies are in business to make money, and (almost universally) business people want things faster - even at the expense of some hand-wavy quality. Furthermore, is it industry standard not to do testing, comment code, create documentation etc.. ? At my current company, we have no QA ...


0

Look at it with the business eyes: either, this way of work is wrong, it means sooner or later the firm won't be able to find developers, or to hire enough of them to fix all the unmaintable code. Or, the code still generates enough money for the firm to survive. Therefore, there's nothing wrong.


0

When I learned SQL, the INNER JOIN, LEFT JOIN, etc. forms didn't exist. As other answers have already stated, different dialects of SQL had each implemented outer joins using idiosyncratic syntax. This damaged portability of SQL code. Bringing the language back together required some change, and LEFT JOIN, etc. was what they settled on. It's true that ...


1

For the data side of this. You'll have to decide whether to use a relational database? Some other database variants might be more suited. If you choose to use a relational database, you could use the following tables: A table that models the temporal dimension of the activity stream, E.g.: <activity_id, user_id, timestamp> A table containing ...



Top 50 recent answers are included