Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips
Tip Bank > Database Development > SQL > Transact-sql

Transact-sql - Page 2

21-40 of 395     Previous     Next
Calculate the Last Day of the Month for Any Given Date
by Raja Krishna
The code in this tip calculates the last day of the month for any given date.
Determine the Version and Build Information for Microsoft SQL Server
by Alexander Ocher
Use the query shown in this tip to determine the version and build information for Microsoft SQL Server.
Obtain Information About Table Columns in Microsoft SQL Server
by Alexander Ocher
To obtain information about table columns in Microsoft SQL Server, use the INFORMATION_SCHEMA.COLUMNS view.
Testing Compatibility Between SQL Server Versions
by Srinath MS
When migrating SQL code (stored procedures, triggers, etc.) to newer versions, it's not uncommon to have to rewrite your entire back-end code. However, a simpler solution is to check the exisiting code's compatibility with the newer versions.
Returning a Random set of Records
by Parthasarathy Mandayam
Find out how to use the NEWID() function to return a random set of records.
Determine Whether a Table Has an Identity Column
by Jaya Nehru Kumar
A simple, single line of code helps you determine whether a table has an identity column.
The Purpose of the GO Statement
by Sachin Kainth
Although GO is not a T-SQL statement, it is often used in T-SQL code and unless you know what it is it can be a mystery. Find out its purpose in this tip.
Retrieve All Columns from Each Table in Every Database
by Mohammad Khan
This stored procedure retrieves all the columns of each table in every database.
Finding a SQL Server Object
by Srinath MS
Use this code to find a SQL Server object, even if the database name is unknown.
Selecting One Record Before and After a Value
by Srinath MS
Find out how to select one record before and after a value.
Constructing Strings of Repeated Characters in T-SQL
by Srinath MS
Learn how to use the Repliciate() function to display a set of characters for a specified length.
Find All User Tables, Columns, DataTypes, and Length
by Daljinder Singh
Use this code to determine all your user tables, plus their columns, datatypes, and length.
Locate All Stored Procedures and Their Objects/SQL Tables
by Daljinder Singh
This code shows you how to you need to locate all the stored procedures and objects/SQL tables upon which they depend.
Using SELECT * on a Table with the Column Type NTEXT
by Steve Skelton
Find out how to ensure that your NTEXT contents display when you've used SELECT * on table with the column type.
Achieving IIF Functionality in T-SQL
by Jaya Nehru Kumar
Although T-SQL doesn't provide an IIF command, you can get equivalent functionality using the SELECT CASE command.
Check for the Existence of a Stored Procedure Using T-SQL
by Jaya Nehru Kumar
Find out how you can use T-SQL to check for the existence of a stored procedure.
Some Useful TSQL Code Snippets for Beginners
by Vadivel Mohanakrishnan
For the benefit of the newbies in SQL Server, here's a list of a few basic queries.
View the Source Code of Stored Procedures in Yukon
by Vadivel Mohanakrishnan
This tip explains how to display the definitions of user-defined stored procedures and system stored procedures in SQL Server 2005 (code named Yukon).
Using T-SQL to Check Whether a Table Exists
by Jaya Nehru Kumar
Use this simple query to check for the existence of a table in a database.
Reset the Identity for All User Tables
by Jaya Nehru Kumar
This tip provides a stored procedure for resetting the identity of all your user tables.
21-40 of 395     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date