Home

Visual Data Entry

 

Introduction

As you are probably aware already, columns are used to organize data by categories. Each column has a series of fields under the column header. One of the actual purposes of a table is to display data that is available for each field under a particular column. Data entry consists of providing the necessary values of the fields of a table. Data is entered into a field and every time this is done, the database creates a row of data. This row is called a record. This means that entering data also self-creates rows.

There are various ways you can perform data entry for a Microsoft SQL Server table:

  • In Microsoft SQL Server Management Studio, you can use a table from the Object Explorer
  • In Microsoft SQL Server Management Studio, you can enter data by typing code in a query window
  • In Microsoft Visual Studio, you can open the table from the Server Explorer
  • You can import data from another object or another database
  • You can use an external application such as Microsoft Access, Microsoft Visual Basic, Borland C++ Builder, Microsoft Visual C++, Borland Delphi, Microsoft Visual Basic, C#, Visual C#, J#, etc
  • You can create a Windows application in Microsoft Visual Studio

Using the Server Explorer

Probably the easiest and fastest way to enter data into a table is by using either Microsoft SQL Server Management Studio or Microsoft Visual Studio. Of course, you must first open the desired table from a database connection. In the Server Explorer, after expanding the connection to the database and the Tables nodes, right-click the desired table and click Show Table Data. If the table does not contain data, it would appear with one empty row. If some records were entered already, their rows would show and the table would provide an empty row at the end, expecting a new record.

To perform data entry on a table, you can click in a cell. Each column has a title, called a caption, on top. This gray section on top is called a column header. In Microsoft SQL Server, it displays the actual name of the column. You refer to the column header to know what kind of data should/must go in a field under a particular column. This is why you should design your columns meticulously. After identifying a column, you can type a value. Except for text-based columns, a field can reject a value if the value does not conform to the data type that was set for the column. This means that in some circumstances, you may have to provide some or more explicit information to the user.

Practical LearningPractical Learning: Introducing Data Entry

  1. In the Server Explorer, if necessary, expand the Tables node under Server.CPAR2.dbo.
    Right-click the RepairOrders node and click Show Table Data
  2. Click the empty box under CustomerName, type Jamil Harrah
  3. Click the box under ReceiptNumber, type 1244LPD and press Enter
  4. Notice that you receive an error because the letters are not allowed:
     
    Error
  5. Click OK on the error message box.
  6. Change the value to 1244 and press Tab
  7. Under OrderDate, type 2006/02/16 and press the down arrow key
  8. Notice that the date changes to 2/16/2006
  9. For the second box under OrderDate, type 06/06/06 and press Tab
  10. For the OrderTime of the second record, type 14:48 and press the up arrow key
  11. Notice that the value changes to today's date followed by the time you had entered
  12. For the first record under OrderTime, type 04:25 PM and press Enter
  13. Close the RepairOrders window
 

Published on Thursday 3 January 2008

 

Previous Copyright © 2007 FunctionX, Inc. Next