T-SQL syntax reference (with diagrams?)



  • I know the knowledge here on TDWTF seems heavily biased towards Microsoft solutions, and many mentioned working with SQL Server quite a lot, so I have a question: is there a good resource which in a more or less condensed manner lists the full syntax of its DML statements as supported by the SQL Server?

    I think the SQLite documentation is the best example of what I'd like to see. Maybe there's something different, but anyway, I'm interested more in syntax than, say, implementation intricacies.



  • Are you looking for something like this?


  • Discourse touched me in a no-no place

    @AlexMedia It doesn't seem to have anything like the (rather nice) railroad diagrams that SQLite has. Also, it's not clear to me where in that mountain of documentation I'd find a SELECT; it's buried somewhere, but I can't guess where straight off.


  • Discourse touched me in a no-no place

    @dkf My first thought after looking at the sidebar list would be to look under the DML statements section, and there it is: https://msdn.microsoft.com/en-us/library/ms189499.aspx



  • @dkf I think SQL Server has too many options for such a page to remain readable.

    I'd look under Data Manipulation though, as I want to 'do something with data'.


  • Discourse touched me in a no-no place

    @AlexMedia said in T-SQL syntax reference (with diagrams?):

    Data Manipulation

    I was thinking of DML as Data Modification Language…



  • @wft a condensed list won't generally do much good, mainly because the answer would be"well, which diagram do you want to see? We have creation, selection, data mining, maintenance, transformation, analytics in a million different ways, geo, queues..."

    Instead, just use MSDN documentation and the tutorials they provide. Use stack overflow for ten different implementation examples, or blogs for a start to finish real(ish) world example.

    The thing about sql server is that it can perform in a ton of different ways for a ton of different style environments. It can literally cover the 99.9999% of use cases which is why it's so frequently referenced. It has great query optimization, indexing support with conditional indexes, partitioning, multi disk support etc.

    It's something you just have to experiment with. Create a project"i want to do X" and just do it. You'll learn how things interact, what performs well and what doesn't.

    Learn to use the estimated query plan and actual query plan, and you can make diagrams from that if you so choose. But that isn't a high level execution query, that is what the actual query is doing when you run the statement. One if the reasons high level queries will be hard is because of how much the query plan optimizer does. It manages execution order, parallelization, simplification of execution, etc. It is the kitchen sink.

    But seeing as this is coding help, start here:

    It's about as high level as you can get.



  • @Matches Nope, the execution does not matter. I only need the full reference of INSERT/DELETE/SELECT/UPDATE syntax as understood by the SQL Server, with each and any subclause you might encounter in one of those.



  • @wft go to msdn.



  • @Matches Well, then I'll better not support T-SQL in whatever I'm developing. Too much archaeology for too little ROI.



  • @wft I don't care what you use. But if you said that to me and I were your boss I'd fire you.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.