Showing posts with label SQL Server. Show all posts
Showing posts with label SQL Server. Show all posts

August 09, 2008

SQL Server 2005 Finicky with Nested Comments

I found out the hard way that MS SQL Server 2005 is sometimes finicky about nested comments leading up to CREATE PROCEDURE or ALTER PROCEDURE lines. Here's a simple illustration of this phenomenon:

/*
/*Bad comment line*/2
*/
CREATE PROCEDURE [dbo].[GetProduct]
AS

SELECT * FROM Product
This code executes without error...but everything grinds to a halt when you try to modify or script it. Management Studio reports a Syntax error in TextHeader.

I ran into this behavior after working an hour on a fairly complex sproc. I didn't back up my work before I ran it, assuming I could always pull it out of the database to make tweaks if necessary. Needless to say I was miffed to find that I couldn't open the stored procedure and effectively lost my work.

Thankfully, it's possible to retrieve code that's lost in this manner:

SELECT
ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.Routines
WHERE
ROUTINE_Name = 'GetProduct'

December 17, 2005

New Software Galore

It's amazing just how many new iterations of well-known server and browser software has been released in the last few months:

Apache 2.2
Php 5.1.x
MySql 5.0
Ruby On Rails 1.0
.NET 2.0
SQL Server 2005
Firefox 1.5

It will likely take a bit of time (and kicking the tires) before these technologies are considered ready for mass consumption by the server admins. All the same, they continue to signify a steady march forward for internet growth and development...