Top 24 T SQL Interview Questions
Top 24 T SQL Interview Questions
com/
T-SQL stands for Transact Structured Query Language. It is an extension of SQL functionality
supported by Microsoft SQL Server and Sybase ASE.
The difference between SQL and TSQL is that SQL is a query language to operate on sets,
while TSQL is a proprietary procedural language used by MS SQL Server. Also, T-SQL has a
different implementation of DELETE and UPDATE than SQL.
3) Mention how tsql statements can be written and submitted to the Database engine?
Tsql statements can be written and submitted to the Database engine in following ways,
"GO" is not a Transact-SQL statement but a batch separator. It is a command identified by the
sqlcmd and osql utilities and SQL Server Management Studio Code editor. SQL Server utilities
read “GO” as a signal that they should send the current batch of TSQL statements to an
instance of SQL Server.
1/3
https://career.guru99.com/
TRUNCATE is used for unconditional removal of data records from Tables. Truncate
Operations are not logged.
DELETE is used for conditional removal of data records from Tables. These operations
are logged.
A local variable is defined using TSQL by using statement “DECLARE” and the name of the
local variable should begin with “@” sign as the first character of its name. For example, integer
CNT we will define local variable as,
The TSQL command IDENT_CURRENT returns the last identity value produced for a specified
table or view. The last identity value created can be for any session and any scope.
TSQL command IDENT_INCR returns the increment value mentioned during the formation of
an identity column in a table or view that has an identity column.
9) Mention if it is possible to import data directly from T-SQL commands without using
SQL Server Integration Services? If yes, what are the commands?
Yes, it is possible to import data directly from T-SQL commands without using SQL Server
Integration Services. These commands include,
BCP
OpenRowSet
Bulk Insert
OPENQUERY
OPENDATASOURCE
Linked Servers
2/3
https://career.guru99.com/
A sub-query is used to return data that will be used in the main query as a condition to further
restrict the data to be retrieved.
A sub-query can be used with the statements like Update, select, delete and insert with the
operators like =, >, =,
3/3
Powered by TCPDF (www.tcpdf.org)