SQL server code example

Example 1: scaffold-dbcontext sql server

PM> Scaffold-DbContext "Server=.\SQLExpress;Database=SchoolDB;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

Example 2: microsoft sql server

/* Answer to: "microsoft sql server" */

/*
  Microsoft SQL Server is a relational database management
  system developed by Microsoft. As a database server, it is a
  software product with the primary function of storing and
  retrieving data as requested by other software
  applications—which may run either on the same computer or on
  another computer across a network.
*/

Example 3: SQL Server Enterprise

SQL Server Enterprise ist die teuerste, aber auch die umfangreichste Edtion.
Mittelgrosse bis  grosse Unternehmen wählen meist diese Variante, da sie 
alle Funktionen von SQL Server enthält. Lizenziert wird nach Cores, dessen 
Anzahl ohne Beschränkung definiert werden kann.

Example 4: group_concat sql server

STRING_AGG ( expression, separator ) [ <order_clause> ]

<order_clause> ::=   
    WITHIN GROUP ( ORDER BY <order_by_expression_list> [ ASC | DESC ] )
    SELECT STRING_AGG(Genre, ',') AS Result
FROM Genres;
Result:

Result                                      
--------------------------------------------
Rock,Jazz,Country,Pop,Blues,Hip Hop,Rap,Punk

Tags:

Sql Example