you should absolutely know sql and keep your knowledge up-to-date. orm is designed to ease the pain of doing something tedious that you know how to do, much like a graphing calculator is designed to do something that you can do by hand (and should know how).
the minute you start letting your orm do things in the database that you don't fully understand is the minute you've lost control over your model.
its always a good think to learn the underlying language for stuff like linq to sql. sql is pretty much standardized and it will help you understand a new paradigm in programming.
- you may not always be working in .net.
- doesn't hurt to know the underlying concepts.
- linq to sql is not being maintained anymore in favor of the entity framework
sooner or later you will run into problems that need at leat a working knowledge of sql to solve. and sooner or later you will run into requirements that are best realised in the db (whether in sp-s or in triggers or views or whaterver).
linq to sql will only work with .net. if you happen get another job where you are not working with .net, then you will have to go back to writing stored procs.
knowing sql will also give you a better understanding of how the server operates as well as possibly making you a better database designer.
it is still important to learn sql queries/syntax. the reason is you need to at least understand how linq to sql translate to the database behind the scenes.
this will help you when you find problems, for example something not updating correctly. or a query performance needs to increase.
it is the same that you need to understand what assembly language is and how it eventually becomes machine language. however in all you don't have to be an expert, but at least be able to write in it and understand it.
it is still important to know sql and the paradigm (set-based) behind it to be able to create efficient sql statements, even if your using linqtosql or any other or/m.
there will always be situations where you will want to write the query in native sql because it is not possible to write it in linqtosql / hql / whatever, or linqtosql is just not able to generate a performant query for it.
there will always be situations where you will want to execute an ad-hoc query on a database using native sql, etc...
i think linqtosql (or other linq to sql providers) should not prevent you of knowing sql.
when your query is not returning what you expect, or when it takes 30 minutes to run on the production database, you'd better be able to understand what lts has generated, and why it is failing.
i know, it's a rehashed topic, and it might not be applicable to what you do ("small" database that will never hit that kind of problem etc), but it pays not to get too oblivious of abstraction layers sometimes.
the other reason is, linq does not the whole range of what you can do in sql, so you might have to resort to writing "raw" sql, even if the result is materialised as objects.
it depends what you're working on, and from what you said it might make more sense to focus on other areas.
having said that i find knowing sql allows the following:
- the ability to write queries to extract data from systems easily. for adhoc queries, or for checking things.
- the ability to write complex stored procedures, which allows me to group complex data processing in one place, where it should be, in the database.
- the ability to fine tune linqtosql by adding indexes, and understanding the sql/query plan's it procedures.
most of these are more of a help on more complex systems, so if you're not working on those it might not be as much of a help.
it may help in your situation to list the technologies which might be of use, and then prioritise them.
in order words make a development plan for yourself, which may encompass more then just learning technical knowledge but allow a more broad focus like design patterns, communication skills and other areas.
sql is a tool. linq to sql is also a tool. having more tools in your belt is a good thing. it'll give you more perspectives when attacking a problem.
consider a scenario where you may want to do multiple queries or multiple updates to the db in one operation. if you can write tsql you can potentially save yourself a lot of roundtrips to the database.
i would say you definately need to know your sql in depth, because you need to know what code your linq-expression generates and what effects the code will have if you want high performing queries. sure you might get the job done in most cases, but sometimes there is a huge difference in performance in very subtle difference in linq-syntax.
i ran into this this morning actually, where i had done .any(d => d.id == (...).first().id) instead of doing where (...).any(i => i.id == d.id). this resulted in the query executing five times slower.
sometimes you need to analyze the actual sql-query to realise the mistakes you make.
in my opinion, knowing sql is more valuable than any vendor specific technology. there will always be cases when those nice prepackaged frameworks will not be able to solve a particular situation and knowledge of advanced sql will be required.
- If using LINQ to SQL is there any good reason to learn SQL queries/syntax anymore?
- Good way to time SQL queries when using Linq to SQL
- Is there a good source that gives an overview of linq optimizations?
- SQL Query to LINQ syntax using not exist and join
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- Is there a JS library that supports writing linq to sql queries with nodejs?
- Are there any parts of LINQ I should avoid for SQL 2000?
- Is there any way to reduce duplication in these two linq queries
- How to know whether there is any overlap in a collection of periods using LINQ
- Is there any way to use Linq to SQL without adding the .dbml file?
- Is there any open source software for converting SQL statements to LINQ?
- Is there a way to batch inserts using linq to sql
- is there any reason to use entity SQL over Linq?
- Using linq to query SQL Server is causing 100s of small queries
- Does LINQ convert code to SQL queries
- Is there any benefit to using LINQ to get the first (and only) element in IEnumerable<T>?
- Is there a secret to using LINQ to SQL to add records when the object has relationships?
- Is there any difference between sql linq
- Write SQL queries using LINQ from linq object List
- What is a good way using LINQ To SQL to update multiple tables through a view?
- Design choice: Any good reason for 'ToArray()' LINQ extension to throw an exception for null collections?
- Is there any way to intercept all Linq to SQL queries?
- Is there any difference in performance between these two LINQ to SQL queries?
- Ineffective generation of SQL queries when using expressions with LINQ
- Simplify the following code to a one-liner using Linq queries
- Produce Insert SQL queries from a Dictionary using LINQ expressions
- SQL "IN" as LINQ query using method syntax
- How can I convert my LINQ query to use the lambda syntax and is there any advantage to doing this?
- How to call an Sql User defined Function using Entity frame work Code first approach with LInq c#
- is there any function to get numeric , double value from string from xml using linq c#
More Query from same tag
- Left join with LINQ with entityframework
- Getting 'Data source is an invalid type' when binding Linq query to Gridview
- While querying IQueryable with linq subquery it fail
- Using Linq how do get a list of users and their last login from two tables
- Convert SQL to Linq in ASP Net Core
- Datatable datarow in Linq
- LinqToCsv - Writing single objects to the file
- c# LINQ find value in datareader
- TransactionScope, linq and strange transaction manager issue (HRESULT: 0x8004D024)
- Select method, changes default ordering of DataTable
- Turning bit type into a dropdownlistfor
- Map query expression from DTO to Entity Object
- Extending System.Data.Linq.DataContext
- Find Any string contains List<>
- Two dimensional array sum in C#/Linq
- LINQ Join and GroupJoin in same query CS1941
- Extracting only certain indexes
- Convert number sequence to Parent/Child hierarchy
- Using LINQ to Get Sum/ Average of a List with custom objects
- Add a Join to this LINQ Query?
- simplifying two queries into one with the same types linq
- LINQ - IQueryable multiple where condition
- Multiple Joins in Entity Framework query
- Error convert Datetime to nullable Datetime in Linq
- Make a Collection from Collection of Collection
- Collection was modified; enumeration operation may not execute , even when i create a copy of the current object
- Intersect two lists and return the similarity with the preserved order of the original first string value
- Entity Framework where clause on related data is missing columns
- Finding list of unique subsets of a given list of integers
- Select with formatted string into object using Linq