SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL view statement
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Venk
Starting Member

6 Posts

Posted - 11/16/2013 :  16:50:28  Show Profile  Reply with Quote
Hi

Working on a query to display books and the authors who wrote them. The following query gives an error message. Can anyone help? - thanks

Create View AuthorBooks
As SELECT Title, Author
FROM Books
Where Category = 'Author';

TG
Flowing Fount of Yak Knowledge

USA
6062 Posts

Posted - 11/16/2013 :  23:03:31  Show Profile  Reply with Quote
What's the error? I don't see a problem with that code.

Be One with the Optimizer
TG
Go to Top of Page

Venk
Starting Member

6 Posts

Posted - 11/17/2013 :  01:04:31  Show Profile  Reply with Quote
quote:
Originally posted by TG

What's the error? I don't see a problem with that code.

Be One with the Optimizer
TG



It says invalid identifier
Go to Top of Page

Venk
Starting Member

6 Posts

Posted - 11/17/2013 :  01:05:14  Show Profile  Reply with Quote
quote:
Originally posted by TG

What's the error? I don't see a problem with that code.

Be One with the Optimizer
TG



I mean it says "Author" invalid identifier
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17681 Posts

Posted - 11/17/2013 :  01:10:05  Show Profile  Reply with Quote
are you using Microsoft SQL Server ?


KH
Time is always against us

Go to Top of Page

Venk
Starting Member

6 Posts

Posted - 11/17/2013 :  01:57:45  Show Profile  Reply with Quote
quote:
Originally posted by khtan

are you using Microsoft SQL Server ?


KH
Time is always against us





Yes, but when i use Read Only instead of Author I do not get any error message
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17681 Posts

Posted - 11/17/2013 :  02:48:36  Show Profile  Reply with Quote
what do you mean "use Read Only" ?


KH
Time is always against us

Go to Top of Page

Venk
Starting Member

6 Posts

Posted - 11/17/2013 :  02:52:14  Show Profile  Reply with Quote
quote:
Originally posted by khtan

what do you mean "use Read Only" ?


KH
Time is always against us





Using With Read Only; instead of Where Category = 'Author'; at the end of the syntax
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17681 Posts

Posted - 11/17/2013 :  08:55:12  Show Profile  Reply with Quote
can you show us the "read only" code ?

Also can you post your table DDL, some sample data ?


KH
Time is always against us

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000