I am building a query in code (ASP) and when I execute the query, I get the
following error:
========================================
========
Microsoft OLE DB Provider for SQL Server error '80040e37'
Invalid object name 'Circuits2005'.
========================================
=========
I added a Response.Write to list the query and it is as follows:
========================================
=========
SELECT DISTINCT Circuits2005.CircuitID, Circuits2005.CircuitName FROM
Circuits2005 INNER JOIN SPScores2005 ON SPScores2005.CircuitID =
Circuits2005.CircuitID UNION SELECT DISTINCT Circuits2005.CircuitID,
Circuits2005.CircuitName FROM Circuits2005 INNER JOIN DPScores2005 ON
DPScores2005.CircuitID = Circuits2005.CircuitID ORDER BY CircuitName
========================================
===========
If I copy/past that into QA, it works fine? "Circuits2005" is a valid table
name?
Any ideas?
Waynewho owns the table?
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:OZIcCcEVFHA.628@.tk2msftngp13.phx.gbl...
>I am building a query in code (ASP) and when I execute the query, I get the
>following error:
> ========================================
========
> Microsoft OLE DB Provider for SQL Server error '80040e37'
> Invalid object name 'Circuits2005'.
> ========================================
=========
> I added a Response.Write to list the query and it is as follows:
> ========================================
=========
> SELECT DISTINCT Circuits2005.CircuitID, Circuits2005.CircuitName FROM
> Circuits2005 INNER JOIN SPScores2005 ON SPScores2005.CircuitID =
> Circuits2005.CircuitID UNION SELECT DISTINCT Circuits2005.CircuitID,
> Circuits2005.CircuitName FROM Circuits2005 INNER JOIN DPScores2005 ON
> DPScores2005.CircuitID = Circuits2005.CircuitID ORDER BY CircuitName
> ========================================
===========
> If I copy/past that into QA, it works fine? "Circuits2005" is a valid
> table name?
> Any ideas?
> Wayne
>|||In addition, make sure you're actually hitting the proper database. Make
sure, if the user you're connecting with has a different default database
than the one containing the Circuits2005 table, that you are switching to
the proper database before performing the select.
"Michael C" <mculley@.NOSPAMoptushome.com.au> wrote in message
news:uvfIzeEVFHA.4000@.TK2MSFTNGP14.phx.gbl...
> who owns the table?
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:OZIcCcEVFHA.628@.tk2msftngp13.phx.gbl...
the
>|||Hi Wayne
rewrite the query as
SELECT DISTINCT Circuits2005.CircuitID, Circuits2005.CircuitName FROM
Circuits2005 INNER JOIN SPScores2005 ON SPScores2005.CircuitID =
Circuits2005.CircuitID UNION SELECT DISTINCT Circuits2005.CircuitID,
Circuits2005.CircuitName FROM <database_name>..Circuits2005 Circuits2005
INNER JOIN DPScores2005 ON
DPScores2005.CircuitID = Circuits2005.CircuitID ORDER BY CircuitName
best Regards,
Chandra
---
"Wayne Wengert" wrote:
> I am building a query in code (ASP) and when I execute the query, I get th
e
> following error:
> ========================================
========
> Microsoft OLE DB Provider for SQL Server error '80040e37'
> Invalid object name 'Circuits2005'.
> ========================================
=========
> I added a Response.Write to list the query and it is as follows:
> ========================================
=========
> SELECT DISTINCT Circuits2005.CircuitID, Circuits2005.CircuitName FROM
> Circuits2005 INNER JOIN SPScores2005 ON SPScores2005.CircuitID =
> Circuits2005.CircuitID UNION SELECT DISTINCT Circuits2005.CircuitID,
> Circuits2005.CircuitName FROM Circuits2005 INNER JOIN DPScores2005 ON
> DPScores2005.CircuitID = Circuits2005.CircuitID ORDER BY CircuitName
> ========================================
===========
> If I copy/past that into QA, it works fine? "Circuits2005" is a valid tabl
e
> name?
> Any ideas?
> Wayne
>
>|||Thanks for the responses. It turns out that although the initial connection
was correct, there was another connection statement that still pointed to an
old database. I got rid of that and things are working fine now.
Wayne
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:OZIcCcEVFHA.628@.tk2msftngp13.phx.gbl...
>I am building a query in code (ASP) and when I execute the query, I get the
>following error:
> ========================================
========
> Microsoft OLE DB Provider for SQL Server error '80040e37'
> Invalid object name 'Circuits2005'.
> ========================================
=========
> I added a Response.Write to list the query and it is as follows:
> ========================================
=========
> SELECT DISTINCT Circuits2005.CircuitID, Circuits2005.CircuitName FROM
> Circuits2005 INNER JOIN SPScores2005 ON SPScores2005.CircuitID =
> Circuits2005.CircuitID UNION SELECT DISTINCT Circuits2005.CircuitID,
> Circuits2005.CircuitName FROM Circuits2005 INNER JOIN DPScores2005 ON
> DPScores2005.CircuitID = Circuits2005.CircuitID ORDER BY CircuitName
> ========================================
===========
> If I copy/past that into QA, it works fine? "Circuits2005" is a valid
> table name?
> Any ideas?
> Wayne
>
Showing posts with label building. Show all posts
Showing posts with label building. Show all posts
Friday, March 30, 2012
Friday, March 9, 2012
Query to combine several "records/rows" into one "record/row"?
Im new to SQL, Ive been getting by building lists from our student database by building or teacher (etc.). These have been all records that exist on only one row, so its been easy (so far).
Heres what Im trying to do and I dont even know what to call it, so I'm not even sure what to search for...
Ive got a MS SQL 6.5 database with the following:
ACTIVE students: each student has ID_NUM[8 digits], NAME, GRADE, SCHOOL with one rowof 4 data items per student.
SCHEDULE of courses with (student) ID_NUM[8 digits], SEMESTER[S1 or S2], HOUR[1-7], COURSE_NAME, ROOM_NUM with 14 records (rows) with these 5 items, in this SCHEDULE database for each student.
My mission is to combine then in to one row using the student ID_NUM as the key. (This is to help me with several things, spreadsheets/database for others to easily use, export to simple databases for teacher handhelds.).
Id like one row of the 75 items combined, resulting in 32 items (ACTIVE 4 items + 14 * 2 SCHEDULE items [COURSE_NAME, ROOM_NUM]) since I want stuff plugged into the correct field, for each student. I'd refer to this as COMBINEDRECORD and Id turn the field names into the following:
ID_NUM[8 digits], NAME, GRADE, SCHOOL, S1HOUR1_NAME, S1HOUR1_ROOM_NUM, S1HOUR2_NAME, S1HOUR2_ROOM_NUM, S1HOUR3_NAME, S1HOUR3_ROOM_NUM, S1HOUR4_NAME, S1HOUR4_ROOM_NUM, S1HOUR5_NAME, S1HOUR5_ROOM_NUM, S1HOUR6_NAME, S1HOUR6_ROOM_NUM, S1HOUR7_NAME, S1HOUR7_ROOM_NUM, S2HOUR1_NAME, S2HOUR1_ROOM_NUM, S2HOUR2_NAME, S2HOUR2_ROOM_NUM, S2HOUR3_NAME, S2HOUR3_ROOM_NUM, S2HOUR4_NAME, S2HOUR4_ROOM_NUM, S2HOUR5_NAME, S2HOUR5_ROOM_NUM, S2HOUR6_NAME, S2HOUR6_ROOM_NUM, S2HOUR7_NAME, S2HOUR7_ROOM_NUM
I dont care if there are any blanks I just want to get the data if
SEMESTER='S2', HOUR='5' & COURSE_NAME='Basketweaving' & ROOM_NUM='Pool'
to end up being in the right spot (S2 and Hour 5) in the new COMBINEDRECORD row with
S2HOUR5_NAME='Basketweaving' & S2HOUR5_ROOM_NUM='Pool' for the correct student ID_NUM. Of course with the correct ACTIVE student info into the same "row"
Does that make sense? It might not be the best way, but itll make the data more accessible to everyone and some programs we already use with our old student system. Obviously theres more data than that but I think this is enough to explain my issue and give me enough to work with
Any help, directions to a webpage or book with the correct terms to look up would be very helpful.
Thank you for any help or direction you can give,
GarySounds like a join. Are you trying to creat a new table or just do a report?|||Or a view with a join if you want to leave the existing tables alone.|||Originally posted by barneyrubble318
Or a view with a join if you want to leave the existing tables alone.
I'll probably be doing two (similar) things:
1) An SQL query that just puts my COMBINEDRECORD table into an Excel Spreadsheet. (Why Excel? Everyone here knows how to merge from it, so they can then manipulate it how they want.)
2) An SQL query from Desktop2MobileDB which will convert the COMBINEDRECORD table into a Palm OS (MobileDB) database so principals and teachers can have more data on hand. (They can see where the kid in the hall is really supposed to be...)
I pretty much do the above two things with data now, the problem is the multi-line data from the SCHEDULE/
If I have to create a new table and then access it from there, I guess I can do that. I might not be able to automate it as easily though...
Thanks,
Gary
Heres what Im trying to do and I dont even know what to call it, so I'm not even sure what to search for...
Ive got a MS SQL 6.5 database with the following:
ACTIVE students: each student has ID_NUM[8 digits], NAME, GRADE, SCHOOL with one rowof 4 data items per student.
SCHEDULE of courses with (student) ID_NUM[8 digits], SEMESTER[S1 or S2], HOUR[1-7], COURSE_NAME, ROOM_NUM with 14 records (rows) with these 5 items, in this SCHEDULE database for each student.
My mission is to combine then in to one row using the student ID_NUM as the key. (This is to help me with several things, spreadsheets/database for others to easily use, export to simple databases for teacher handhelds.).
Id like one row of the 75 items combined, resulting in 32 items (ACTIVE 4 items + 14 * 2 SCHEDULE items [COURSE_NAME, ROOM_NUM]) since I want stuff plugged into the correct field, for each student. I'd refer to this as COMBINEDRECORD and Id turn the field names into the following:
ID_NUM[8 digits], NAME, GRADE, SCHOOL, S1HOUR1_NAME, S1HOUR1_ROOM_NUM, S1HOUR2_NAME, S1HOUR2_ROOM_NUM, S1HOUR3_NAME, S1HOUR3_ROOM_NUM, S1HOUR4_NAME, S1HOUR4_ROOM_NUM, S1HOUR5_NAME, S1HOUR5_ROOM_NUM, S1HOUR6_NAME, S1HOUR6_ROOM_NUM, S1HOUR7_NAME, S1HOUR7_ROOM_NUM, S2HOUR1_NAME, S2HOUR1_ROOM_NUM, S2HOUR2_NAME, S2HOUR2_ROOM_NUM, S2HOUR3_NAME, S2HOUR3_ROOM_NUM, S2HOUR4_NAME, S2HOUR4_ROOM_NUM, S2HOUR5_NAME, S2HOUR5_ROOM_NUM, S2HOUR6_NAME, S2HOUR6_ROOM_NUM, S2HOUR7_NAME, S2HOUR7_ROOM_NUM
I dont care if there are any blanks I just want to get the data if
SEMESTER='S2', HOUR='5' & COURSE_NAME='Basketweaving' & ROOM_NUM='Pool'
to end up being in the right spot (S2 and Hour 5) in the new COMBINEDRECORD row with
S2HOUR5_NAME='Basketweaving' & S2HOUR5_ROOM_NUM='Pool' for the correct student ID_NUM. Of course with the correct ACTIVE student info into the same "row"
Does that make sense? It might not be the best way, but itll make the data more accessible to everyone and some programs we already use with our old student system. Obviously theres more data than that but I think this is enough to explain my issue and give me enough to work with
Any help, directions to a webpage or book with the correct terms to look up would be very helpful.
Thank you for any help or direction you can give,
GarySounds like a join. Are you trying to creat a new table or just do a report?|||Or a view with a join if you want to leave the existing tables alone.|||Originally posted by barneyrubble318
Or a view with a join if you want to leave the existing tables alone.
I'll probably be doing two (similar) things:
1) An SQL query that just puts my COMBINEDRECORD table into an Excel Spreadsheet. (Why Excel? Everyone here knows how to merge from it, so they can then manipulate it how they want.)
2) An SQL query from Desktop2MobileDB which will convert the COMBINEDRECORD table into a Palm OS (MobileDB) database so principals and teachers can have more data on hand. (They can see where the kid in the hall is really supposed to be...)
I pretty much do the above two things with data now, the problem is the multi-line data from the SCHEDULE/
If I have to create a new table and then access it from there, I guess I can do that. I might not be able to automate it as easily though...
Thanks,
Gary
Wednesday, March 7, 2012
Query Timeout in SSAS
I am using Sql 2005 SSAS. When building the Data Source Views using "Edit Named Query", the data source is pointed to a Sql 7.0 server. When I tried to execute the query, it terminates after 30 seconds with "Query Timeout Expired".
Try editing the DataSource object for your SQL 7.0.
You should be able to change query timeout. I beleive it is part of the connection string.
Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to:
Posts (Atom)