Home > Top 10 SQL Server development tips of 2008
The Year in Review:
EMAIL THIS

Top 10 SQL Server development tips of 2008

07 Jan 2009 | Steve Cimino, Assistant Editor

Expert advice on database administration
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google

More on SQL Server development:
Top 10 SQL Server development tips of 2007

Blog: SQL Server with Mr. Denny
Here are the top 10 most viewed SQL Server development tips of 2008. Whether you were converting date/time data into character types, working with DATETIME and SMALLDATETIME in SQL Server 2005, using a stored procedure to find the size of SQL Server tables or retrieving XML data values with XQuery, these were the topics that piqued your interest this year.

#1 - SQL Server data conversions from date/time values to character types
T-SQL supports two built-in methods for converting date/time data to character data and vice versa. These are implicit and explicit conversions, and this tip will take you through a step-by-step process for using each method. Included in these steps is advice on how to use the CAST and CONVERT functions when converting date/time values.

#2 - Basics for working with DATETIME and SMALLDATETIME in SQL Server 2005
Understanding the DATETIME, SMALLDATETIME and TIMESTAMP data types in SQL Server is not always a straightforward process. Learn how data is stored within DATETIME and SMALLDATETIME and find out why TIMESTAMP is different and often confused with these two primary date/time data types.

#3 - Find size of SQL Server tables and other objects with an original stored procedure
Getting an overview of user table sizes in a database, a summary of the total space owned by a group of tables and the top 10 biggest indexed objects are among the important reasons to calculate the specific disc space used by an object in SQL Server. Sp_SOS, an original stored procedure, can replace the often inadequate sp_spaceused stored procedure that ships with SQL Server.

#4 - Using SQL Server datetime functions GETDATE, DATENAME and DATEPART
There are several functions used for retrieving the current date and time, or individual parts of a DATETIME or SMALLDATETIME value, in SQL Server. Learn how to extract the day, month or year from a datetime value, as well as the quarter, week, hour or even the millisecond.

#5 - Retrieve XML data values with XQuery in SQL Server 2005
XQuery is the scripting language to use when accessing specific XML data values, rather than XML as a single data type value. Find out how to use two XQuery methods within your T-SQL statements -- Value() to retrieve a single XML value and Query() to retrieve multiple XML values.

#6 - Stored procedure to monitor long-running jobs in SQL Server 2000
Monitoring long-running jobs in SQL Server 2000 is not a simple practice, but it is a best practice among DBAs. Discover a stored procedure that easily identifies long-running jobs while also alerting DBAs, through email alerts, of situations that may poorly affect SQL Server performance.

#7 - Create DDL table in SQL Server 2005 to audit DDL trigger activity
Whenever DDL statements in SQL Server 2005 make changes with commands, such as CREATE TABLE and ALTER, the DDL trigger fires an event. But, it's possible to log these events by designing an audit table and defining a custom-made DDL trigger, along with testing the auditing solution.

#8 - Using DATEADD and DATEDIFF to calculate SQL Server date/time values
The DATEADD and DATEDIFF functions in SQL Server can perform easy calculations, such as adding or subtracting a time interval from a date/time value or comparing two date/time values. Get examples of how to use these handy functions in table definitions, queries and data modification statements.

#9 - Configure SQL Server Service Broker for sending stored procedure data
The Service Broker feature in SQL Server 2005 allows you to queue data of stored procedures and other application development components. Follow these steps for setting up Service Broker and learn how to use this communications platform to transmit data and messages from one SQL Server system to another.

#10 - Simplify queries with SQL Server 2005 common table expressions (CTEs)
Common table expressions (CTEs) in SQL Server 2005 are an alternative to using derived tables and views for retrieving data. CTEs separate code into unique units, so there's no need to repeat complex code, and they are self-referencing within your query.

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
SQL/Transact SQL (T-SQL)
Combining result sets from multiple SQL Server queries
Using DELETE and TRUNCATE TABLE statements to delete data in SQL Server
SQL language crash course (just enough to be dangerous)
Working with IntelliSense in SQL Server 2008 Management Studio
SQL Server Mailbag: Stored procedures, triggers and SSRS reports
Working with sparse columns in SQL Server 2008
Determining the source of full transaction logs in SQL Server
New GROUP BY option provides better data control in SQL Server 2008
Using the OPENROWSET function in SQL Server
Loading data files with SQL Server's BULK INSERT statement
SQL/Transact SQL (T-SQL) Research

SQL Server Stored Procedures
SQL Server Mailbag: CALs, witnesses and unwanted changes
SQL Server Mailbag: Stored procedures, triggers and SSRS reports
Top tips and tricks for SQL Server database development
SQL Server trigger vs. stored procedure to receive data notification
SQL Server errors, failures and other problems fixed from the trenches
SQL Server and data manipulation in T-SQL
How to use SQL Server 2008 hierarchyid data type
SQL Server stored procedures tutorial: Write, tune and get examples
Check SQL Server database and log file size with this stored procedure
SQL Server source code analysis and management adds database security

XML in SQL Server
An introduction to XML shredding for SQL Server
Processing XML files with SQL Server functions
Manage traces in SQL Server 2005 Analysis Services with XMLA commands
Create a computed column in SQL Server using XML data
Create DDL table in SQL Server 2005 to audit DDL trigger activity
Retrieve XML data values with XQuery in SQL Server 2005
XML data type in SQL Server 2005 vs. VARCHAR (MAX)
T-SQL commands vs. XML AUTO in SQL Server
Basic Transact-SQL programming constructs: 15 tips, 15 minutes
T-SQL identifiers

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
ACID  (SearchSQLServer.com)
Collaboration Data Objects  (SearchSQLServer.com)
commit  (SearchSQLServer.com)
container  (SearchSQLServer.com)
DAO  (SearchSQLServer.com)
fetch  (SearchSQLServer.com)
OLE DB  (SearchSQLServer.com)
query  (SearchSQLServer.com)
SQL  (SearchSQLServer.com)
T-SQL  (SearchSQLServer.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary




Secure SQL - Data Security for Your Database
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2005 - 2010, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts