SQL-Transact SQL (T-SQL)

Email Alerts

Register now to receive SearchSQLServer.com-related news, tips and more, delivered to your inbox.
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Character string data types

    There are four different character data types that store character strings: char, varchar, varchar(max), and text. There are also four character data types for storing unicode data: nchar, nvarchar, nvarchar(max) and ntext. This book excerpt on T-SQL... 

  • Transact SQL cursors

    T-SQL cursors are used to repeat custom processing for each row of the cursor. The following excerpt outlines how to process a cursor for Transact-SQL Server and gives an example. 

  • Unconditional and scheduled execution

    Unconditional execution (the GoTo Statement) in T-SQL forces the server to continue the execution from a label within a stored procedure or batch. Scheduled execution (the WaitFor Statement) allows the developer to schedule a time for the remaining s... 

  • Special data types-Part 1

    In book excerpt, special data types are defined, including: timestamp, uniqueidentifier, and cursor and xml data types, a major new feature in SQL Server 2005. User defined data types are also explained, which can be defined in Transact-SQL or .NET. 

  • Special data types-Part 2

    This section continues discussion of special data types, including table and the cursor types and also traditional user-defined data types. 

  • Cursor related statements

    This book excerpt illustrates cursor statements, including the open statement, fetch statement, @@fetch_status, close statement and the deallocate statement for T-SQL cursors. 

  • Flow control statements

    T-SQL flow-control statements require skill and lack user friendliness, yet they allow for complex procedures. This book excerpt covers the use of comments. Comments can be included inside the source code of a batch or stored procedure. Comments are... 

  • Problems and justified use of cursors

    The use of cursors in T-SQL should traditionally be avoided when possible, as they are a procedural feature and performace penalties tend to be a problem. However, this excerpt outlines situations in which cursors are acceptable, and even necessary. 

  • Blocks, looping and conditional flow control statements

    Statements blocks (Begin…End) can be used to group several statements to be executed together. Conditional execution (If statements) are used to change the flow of code based on the value of a condition. T-SQL contains only one statement that ... 

  • Date, time and number data types in SQL Server

    In this book excerpt on basic T-SQL programming constructs, date and time, integer numbers, approximate numbers, exact numbers, monetary and binary data types are defined and examples given.