|
Posted by dba_222 on 08/16/06 01:58
I'm not even trying to do anything in particular yet.
I'm just trying to get the basics down in SQL Server.
The tables are from the Northwinds schema, or "database",
in Sql Server terms.
This is one of the most classic elementary programs you write.
Read the data, print it, end. The first one didn't even use a cursor,
but wouldn't even compile!
If I can't get Sql Server to do that, I have serious doubts about
using it for much of anything. I never had issues like this in
Oracle.
My example was 100% clear, and the question was, what is the
correct syntax to do the simple business?
If anyone knows, please tell us the secret.
Thanks!
Arnie Rowland wrote:
> SELECT CustomerID
> FROM dbo.Customers
>
> You probably shouldn't be trying to use a cursor -it has really bad performance issues -amongst other things.
>
> Perhaps if you were to provide us a bit more information (table DDL, sample data in the form or INSERT statements), and especially a clear explanation of what you hope to accomplish, someone here can help come up with a more efficient and non-cursor solution.
>
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
>
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
>
> <dba_222@yahoo.com> wrote in message news:1155688502.341846.321810@75g2000cwc.googlegroups.com...
> > Dear experts,
> >
> > Again, sorry to bother you again with such a seemingly dumb question,
> > but I'm having some really mysterious results here.
> >
> > ie.
> >
> > Create procedure the_test
> > As
> >
> >
> > Begin
> >
> > Select CustomerID
> >>From dbo.customers
> >
> > -----------------------------*/
> > Server: Msg 170, Level 15, State 1, Procedure the_test, Line 8
> > Line 8: Incorrect syntax near 'customers'.
> >
> > Just WHAT is the syntax please?????
> >
> >
>
[Back to original message]
|