[dba-SQLServer] SQL Nightmares

jwcolby jwcolby at colbyconsulting.com
Thu Mar 20 08:06:31 CDT 2008


Ahh... SELECT...

This is why I find BOL so unhelpful.  The example does not show 

SELECT right("Hello",2)

It shows

Right("hello",2)

An example should run, exactly as displayed.

In fact, when I typed in 

SELECT right("Hello",2) (which is essentially what is on BOL) I then get
another error message:

Msg 207, Level 16, State 1, Line 1
Invalid column name 'hello'.

BOL says to use ".  Now when I change the " to a ' the statement works.

I am sure that once I am an expert on the syntax then BOL will be highly
useful.

I can see that this is going to be a long morning.  

John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur
Fuller
Sent: Thursday, March 20, 2008 8:49 AM
To: Discussion concerning MS SQL Server
Subject: Re: [dba-SQLServer] SQL Nightmares

I just successfully ran this:

SELECT RIGHT('abcde', 3)
and got back 'cde' as expected.

A.

On 3/20/08, jwcolby <jwcolby at colbyconsulting.com> wrote:
>
> It doesn't seem to like the Right( part of the function.  Right is not 
> correctly colored.
>
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com




More information about the dba-SQLServer mailing list