How To Enter Comments in Transact-SQL Statements?
Submitted by: AdministratorThere are 2 ways to enter comments within Transact-SQL statements:
* Starting comments with two dashes "--": Everything between "--" and the end of the line is treated as a comment.
* Entering comments between "/*" and "*/": Everything between "/*" and "*/" is treated as a comment.
Here are some good examples of how to enter comments:
/* The following statement
creates a table
called ggl_links */
CREATE TABLE ggl_links (
id INTEGER PRIMARY KEY, -- the primary key
url VARCHAR(80) NOT NULL, -- address of the link
notes VARCHAR(1024),
counts INT, -- number of clicks
created DATETIME NOT NULL DEFAULT(getdate())
);
GO
-- Get rid of this table
DROP TABLE ggl_links;
GO
Submitted by: Administrator
* Starting comments with two dashes "--": Everything between "--" and the end of the line is treated as a comment.
* Entering comments between "/*" and "*/": Everything between "/*" and "*/" is treated as a comment.
Here are some good examples of how to enter comments:
/* The following statement
creates a table
called ggl_links */
CREATE TABLE ggl_links (
id INTEGER PRIMARY KEY, -- the primary key
url VARCHAR(80) NOT NULL, -- address of the link
notes VARCHAR(1024),
counts INT, -- number of clicks
created DATETIME NOT NULL DEFAULT(getdate())
);
GO
-- Get rid of this table
DROP TABLE ggl_links;
GO
Submitted by: Administrator
Read Online MS SQL Server Job Interview Questions And Answers
Top MS SQL Server Questions
☺ | How to download Microsoft SQL Server 2005 Express Edition? |
☺ | What Happens If Strings Are Casted into Wrong Code Pages in MS SQL Server? |
☺ | What are system databases in MS SQL Server? |
☺ | How To Create a Testing Table with Test Data in MS SQL Server? |
☺ | How To Use Subqueries with the EXISTS Operators in MS SQL Server? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Sybase Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |