|
INTERVIEW QUESTIONS
DATABASE
MS SQL SERVER
DETAILS
Question: How To Enter Comments in Transact-SQL Statements?
Answer: There 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
|
|
|
Category |
MS SQL Server Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8847 users |
Added on |
9/23/2014 |
Views |
69135 |
Rate it! |
|
|
Question:
How To Enter Comments in Transact-SQL Statements?
Answer:
There 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 Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
How To Start and End Transact-SQL Statements?
|
View Answer
|
|
What Is a Transact-SQL Statement?
|
View Answer
|
|
What Is Transact-SQL Language?
|
View Answer
|
|
What Is SQL Language?
|
View Answer
|
|
Can Group Functions Be Used in the ORDER BY Clause in MS SQL Server?
|
View Answer
|
|
Can Multiple Columns Be Used in SQL GROUP BY Clause in MS SQL Server?
|
View Answer
|
|
How To Count Duplicated Values in a Column in MS SQL Server?
|
View Answer
|
|
How To Apply Filtering Criteria at Group Level with The HAVING Clause in MS SQL Server?
|
View Answer
|
|
How To Divide Query Output into Multiple Groups with the GROUP BY Clause in MS SQL Server?
|
View Answer
|
|
Can Group Functions Be Mixed with Non-group Selection Fields in MS SQL Server?
|
View Answer
|
|
How To Use Group Functions in the SELECT Clause in MS SQL Server?
|
View Answer
|
|
What Are Group Functions in Query Statements in MS SQL Server?
|
View Answer
|
|
How To Filter Out Duplications in the Returning Rows in MS SQL Server?
|
View Answer
|
|
Can SELECT Statements Be Used on Views in MS SQL Server?
|
View Answer
|
|
How To Count Rows with the COUNT(*) Function in MS SQL Server?
|
View Answer
|
|
How To Sort Query Output in Descending Order in MS SQL Server?
|
View Answer
|
|
Can the Query Output Be Sorted by Multiple Columns in MS SQL Server?
|
View Answer
|
|
How To Sort the Query Output with ORDER BY Clauses in MS SQL Server?
|
View Answer
|
|
How To Add More Data to the Testing Table in MS SQL Server?
|
View Answer
|
|
How To Select Some Specific Rows from a Table in MS SQL Server?
|
View Answer
|