Jul 25, 2008

Microsoft SQL - you can ommit the INTO clause in insert statement?

I am not quite sure if this is a known feature / bug, but it is possible to write

INSERT Products (ProductName)
VALUES ('TestProduct')

instead the "standard":

INSERT INTO Products (ProductName)
VALUES ('TestProduct')

I repeat, I am not quite sure if this is standard behaviour for Microsoft SQL Server, and for which versions. I am not quite sure even if it is valid for all INSERT scenarios you may face, but I tried few different scenarious which include insertion of rows and it works like charm.

Note: I will suggest you to stick with the
INSERT INTO as it seems "more standard" to me. Furthermore if you are using some tools to do some SQL work (tools which may need to parse your
SQL) you will probably need to change back to INSERT INTO if you have used INSERT.

Nice TFS Query

I needed to find all my tasks I had closed, but I hadn't added time input for.
I was thinking how can I sort all my TFS tasks to achieve this and it appeared to be very strightforward.

Here is what you should do:

TFS Query to get all closed tasks without working hours.

In other words you are saying :

Your new TFS query will look like this.

"Give me all the work where the completed work is 0 hours, the state is closed and it is assigned to me."

After you save and give a name to your TFS query, you will find it under the "My Queries" node in your Team Explorer window:

>