Creating a Data Connection to a SQL Server Database
To create a data connection to a SQL Server database
In Server Explorer/Database Explorer click Connect to Database.
In the Choose Data Source dialog box, select Microsoft SQL Server, and then click OK.
If the Add Connection dialog box opens, and the Data source is not Microsoft SQL Server, click Change to open the Choose/Change Data Source dialog box. For more information, see Choose/Change Data Source Dialog Box.
Select a server name from the drop-down list, or type the name of the server where the database you want to access is located.
Based on the requirements of your database or application, select either Windows Authentication or use a specific user name and password to log on to the SQL Server (SQL Server Authentication). For more information, see Add/Modify Connection (Microsoft SQL Server).
Select the database you want to connect to from the drop-down list.
Click OK.
Sorting in SQL:
Order By clause sort the result set from the query (with a where clause) in a specific order using the ORDER BY clause based on specified column(s).
Syntax:
Here is the syntax of Order By clause in SQL.
[code lanuage=”sql”] Select columns
From tables
Where
Order By column ASC/DSC;
ASC option sort the data in Ascending order and DSC option sort the selected data in Descending Order.
Grouping in SQL:
SQL Group By clause is used to retrieve data grouped according to one or more columns.
Syntax:
Here is the syntax of Group By clause in SQL.
[code lanuage=”sql”] Select columns
From tables
GROUP BY column;
Creating a Data Connection to a SQL Server Database To create a data connection to a SQL Server database
Sorting in SQL:
Order By clause sort the result set from the query (with a where clause) in a specific order using the ORDER BY clause based on specified column(s).
Syntax:
Here is the syntax of Order By clause in SQL.
[code lanuage=”sql”] Select columns From tables Where
Order By column ASC/DSC;
ASC option sort the data in Ascending order and DSC option sort the selected data in Descending Order.
Grouping in SQL:
SQL Group By clause is used to retrieve data grouped according to one or more columns.
Syntax:
Here is the syntax of Group By clause in SQL.
[code lanuage=”sql”] Select columns From tables GROUP BY column;