How to Select Records from Table via SQL using SELECT Statement

Select Records from Table via SQL using SELECT:

(1) Before starting SQL query, understand the advantages of language.

  • SQL stands for Structured Query Language.
  • SQL can retrieve data from a database.
  • SQL can insert, update, delete records in a database.
  • SQL can create new databases.
  • SQL can create new tables, procedure & views.

(2) “SELECT” statement used for select records in the table from database.

(3) Syntax of “SELECT” statement is-

SELECT column1, column2, …
FROM table_name;

(4) Let’s take an example to select records for “Vendor table”.

(5) Select the database in SQL server and click on the “New Query” button as shown.

Select the database in SQL server and click on the New Query

(6) After that new query editor open as shown.

SQL new query editor open

(7) After doing the above steps, write a query in the editor, in which select all records of Vendor table, as shown.

sql query to select all records of table

Source Code:

–// For selecting all fields in table
Select * from dbo.[CRONUS India Ltd_$Vendor$437dbf0e-84ff-417a-965d-ed2bb9650972]
–// For selecting all fields in table
–// For selecting particular fields in table
Select [No_], [Name], [Address] from dbo.[CRONUS India Ltd_$Vendor$437dbf0e-84ff-
417a-965d-ed2bb9650972]
–// For selecting particular fields in table

(8) After writing the query, then execute the query (Shortcut keys is F5) as shown.

After writing the query, then execute the query by F5 key in SQL

(9) After executing the two queries in the same editor, SQL gives two results. Recommended write and execute queries one by one for reporting.


Use of FINDFIRST FINDLAST and FINDSET in BC D365
Use of SETRANGE and SETFILTER in Dynamics 365
How to use CASE statement in D365 BC
Extension Fields Not Visible in Page in D365 WebClient- Solved
Dynamics 365 Business Central pricing– Microsoft Docs

Leave a Reply