Login or Sign Up to become a member!
LessThanDot Site Logo

LessThanDot

A Technical Community for IT Professionals

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

Browsing "tip"

2

SQL Advent 2011 Day 12: Table Value Constructor

Today we are going to take a look at the Table Value Constructor, sometimes also called Row Value Constructor. The Table Value Constructor allows multiple rows of data to be specified in a single DML statement.

Read More...
0

SQL Advent 2011 Day 10: Upsert by using the Merge statement

In my Are you ready for SQL Server 2012 or are you still partying like it is 1999? post, I wrote about how you should start using SQL Server 2005 and SQL Server 2008 functionality now in order to prepare for SQL Server 2012. I still see tons of code tha…

Read More...
4

SQL Advent 2011 Day 9: Dynamic TOP

In my Are you ready for SQL Server 2012 or are you still partying like it is 1999? post, I wrote about how you should start using SQL Server 2005 and SQL Server 2008 functionality now in order to prepare for SQL Server 2012. I still see tons of code tha…

Read More...
0

How to call a user defined function with a default parameter

Someone had some trouble earlier today with calling a user defined function that has a default value for a parameter

When you have a stored procedure with default values for parameters, you can omit those when calling the proc. With user defined func…

Read More...
0

How to capture the error output from a stored procedure when calling another stored procedure in SQL Server?

This is a quick post, this question was asked recently

I have a stored procedure which is being called by some business objects and it’s working fine. I want to extend this stored procedure to call a new stored procedure (basically it will insert som…

Read More...
0

Learn the platform differences to be more effective

Something that you are used to doing on one platform is not always the best thing on another platform. Compacting databases might be good in Access, shrinking databases is not so good in SQL Server. Looping in SQL Server instead of using a SET based sol…

Read More...
0

Latest article by SQL Server MVP Erland Sommarskog is a gem

SQL Server MVP Erland Sommarskog has posted his latest article yesterday and I highly recommend printing it out/transferring it to your ebook reader and reading it.
Of course I think most of you are already familiar with Erland’s article The curse and…

Read More...
1

How to capture the error output from xp_cmdshell in SQL Server

A person asked the following question: I am running the following command: EXEC @ReturnCode = master.dbo.xp_cmdshell @cmdline On the Results tab I get 2 lines Could not find a part of the path ‘serverdirectoryfilename’. NULL How do I capture the first line in an error message? I tried using a Try Catch block with “SELECT […]

Read More...
1

When should you store @@ROWCOUNT into a variable?

There was a question I answered the other day where someone complained that the rowcount was always 0. Below is a simplified version of the query, can you tell why @SomeCount will be 0? T-SQL1 2 3 4 5 6 7 8 9 10 declare @SomeCount int   select 1 union all select 2   […]

Read More...
14

SQL Server Types – Numeric vs Int

As I was working on a database yesterday I came across a curious sight, multiple columns defined as numeric(7,0), numeric(9,0), and so on. It seemed like someone was trying to provide the database with the most specific definition possible for a number of different pieces of data. Having never run into this particular practice, I immediately started searching for a reason. Was it smaller? faster? better?

Read More...
« Previous PageNext Page »