Friday, March 23, 2012

Newbie question

Apolgies if this seems obvious.
I am using Visual Studio and experimenting with SQL server databases. I can
connect to Northwind and Pubs (the samples) and do simple selections on
them. At work we have a personnel database which I am tesing at home. I
can connect to it and explore the contents but when I run this
SELECT [acadyear_setup_id], [narrative], [census_date], [age
_as_at_date]
FROM [ascis_acadyear_setup]
I get the error invlaid object name ascis_acadyear_setup
What am I doing wrong?It's possible that the object owner is not yourself or dbo. Try the
following:
select
table_schema
from
information_schema.tables
where
table_name = 'ascis_acadyear_setup'
This will tell you who the owner is. Then use two-part naming:
SELECT [acadyear_setup_id], [narrative], [census_date], [age
_as_at_date]
FROM [TheOwner].[ascis_acadyear_setup]
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"Allison" <,> wrote in message
news:44007a2f$0$6981$ed2619ec@.ptn-nntp-reader02.plus.net...
Apolgies if this seems obvious.
I am using Visual Studio and experimenting with SQL server databases. I can
connect to Northwind and Pubs (the samples) and do simple selections on
them. At work we have a personnel database which I am tesing at home. I
can connect to it and explore the contents but when I run this
SELECT [acadyear_setup_id], [narrative], [census_date], [age
_as_at_date]
FROM [ascis_acadyear_setup]
I get the error invlaid object name ascis_acadyear_setup
What am I doing wrong?|||Please do not multipost, answered in connect.
HTH, jens Suessmeyer.|||"Jens" <Jens@.sqlserver2005.de> wrote in message
news:1140883638.016887.92390@.e56g2000cwe.googlegroups.com...
> Please do not multipost, answered in connect.
> HTH, jens Suessmeyer.
>Very sorry for offending you - newbies need help not a slapped wrist|||"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:uVMJYMiOGHA.720@.TK2MSFTNGP14.phx.gbl...
> It's possible that the object owner is not yourself or dbo. Try the
> following:
> select
> table_schema
> from
> information_schema.tables
> where
> table_name = 'ascis_acadyear_setup'
> This will tell you who the owner is. Then use two-part naming:
> SELECT [acadyear_setup_id], [narrative], [census_date], [a
ge_as_at_date]
> FROM [TheOwner].[ascis_acadyear_setup]
>
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> .Thank you this worked first time

> "Allison" <,> wrote in message
> news:44007a2f$0$6981$ed2619ec@.ptn-nntp-reader02.plus.net...
> Apolgies if this seems obvious.
> I am using Visual Studio and experimenting with SQL server databases. I
> can
> connect to Northwind and Pubs (the samples) and do simple selections on
> them. At work we have a personnel database which I am tesing at home. I
> can connect to it and explore the contents but when I run this
> SELECT [acadyear_setup_id], [narrative], [census_date], [a
ge_as_at_date]
> FROM [ascis_acadyear_setup]
> I get the error invlaid object name ascis_acadyear_setup
> What am I doing wrong?
>|||>>Very sorry for offending you - newbies need help not a slapped wrist
I can't speak for Jens but I believe his reply was quite polite with no
'slapping' intended. As you can see, he is trying to help you in your other
thread.
Multi-posting is a common mistake newbies make and it's appropriate to point
this out so that it can be avoided it in the future. With multiple
independent threads, there's a lot of duplicate effort going on to help you
out.
If you need to post the same question to different forums, you can
cross-post by specify multiple newsgroups in the list and replies will
appear in the all the forums posted.
Hope this helps.
Dan Guzman
SQL Server MVP
"Allison" <,> wrote in message
news:440086ed$0$6962$ed2619ec@.ptn-nntp-reader02.plus.net...
> "Jens" <Jens@.sqlserver2005.de> wrote in message
> news:1140883638.016887.92390@.e56g2000cwe.googlegroups.com...
>|||?
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"Allison" <,> wrote in message
news:44008a84$0$6993$ed2619ec@.ptn-nntp-reader02.plus.net...
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:uVMJYMiOGHA.720@.TK2MSFTNGP14.phx.gbl...
> It's possible that the object owner is not yourself or dbo. Try the
> following:
> select
> table_schema
> from
> information_schema.tables
> where
> table_name = 'ascis_acadyear_setup'
> This will tell you who the owner is. Then use two-part naming:
> SELECT [acadyear_setup_id], [narrative], [census_date], [a
ge_as_at_date]
> FROM [TheOwner].[ascis_acadyear_setup]
>
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> .Thank you this worked first time

> "Allison" <,> wrote in message
> news:44007a2f$0$6981$ed2619ec@.ptn-nntp-reader02.plus.net...
> Apolgies if this seems obvious.
> I am using Visual Studio and experimenting with SQL server databases. I
> can
> connect to Northwind and Pubs (the samples) and do simple selections on
> them. At work we have a personnel database which I am tesing at home. I
> can connect to it and explore the contents but when I run this
> SELECT [acadyear_setup_id], [narrative], [census_date], [a
ge_as_at_date]
> FROM [ascis_acadyear_setup]
> I get the error invlaid object name ascis_acadyear_setup
> What am I doing wrong?
>|||I think she thanked you (just kind of hidden):

Allison:
">" indicates a quote. When you want to add text in response, start
your line without that character so that we can tell when the original post
ends and the reply begins.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OhNwSAjOGHA.2012@.TK2MSFTNGP14.phx.gbl...[vbcol=seagreen]
> ?
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> .
> "Allison" <,> wrote in message
> news:44008a84$0$6993$ed2619ec@.ptn-nntp-reader02.plus.net...
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:uVMJYMiOGHA.720@.TK2MSFTNGP14.phx.gbl...
>
>|||Thanx, Adam. It was buried in there somewhere.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:%23QiIKVmOGHA.1088@.tk2msftngp13.phx.gbl...
I think she thanked you (just kind of hidden):

Allison:
">" indicates a quote. When you want to add text in response, start
your line without that character so that we can tell when the original post
ends and the reply begins.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:OhNwSAjOGHA.2012@.TK2MSFTNGP14.phx.gbl...[vbcol=seagreen]
> ?
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> .
> "Allison" <,> wrote in message
> news:44008a84$0$6993$ed2619ec@.ptn-nntp-reader02.plus.net...
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
> news:uVMJYMiOGHA.720@.TK2MSFTNGP14.phx.gbl...
>
>sql

No comments:

Post a Comment