A Query Where Two Tables Are Linked To The Same Another Table

Jul 23, 2005

Hello,

I'm not an expert in SQL, if you could help me for that little
problem:

I had tree simple tables with their fields:
[Client] IdClient, Param
[Sale] IdSale, IdClient, Param
[Param] IdParam, Value

How can I retrieve a recordset with this columns ?
IdClient, IdSale, ValueOfParamClient, ValueOfParamSale

The problem is that I can retrieve a Param for one table (Client or
Sale) like this request :

SELECT Client.IdClient, Sale.IdSale, Param.Value
FROM
(Client
INNER JOIN Sale
ON Sale.IdClient = Client.IdClient)
LEFT JOIN Param
ON Param.IdParam = Sale.Param

But how can I retrieve the Param of the another table in a simple
query ? (because I would also like that it works for access)

Thank for your help,

Marc

View 4 Replies


ADVERTISEMENT

Linked Server Oracle Tables - Not Able To Add To Query Designers Show Diagram Pane Via Add Table Dialogue

Apr 18, 2008

I am new to sqlserver.


1)I created a linked server to a oracle database, works fine. Now I am writing queries, using "Query Desgner", when I do a "Add table" linked server tables do not appear. Is this a limitation. I can get around the problem by creating a view.

2) When I use "Microsoft OLE DB Provider for Oracle" for linked server, some times connection seems to get lost. On one occassion, the next day it was fine, it re-established itself.

Any ideas thnx.

View 5 Replies View Related

Append Query From Access Table To Linked SQL Server Table Failing

Jun 18, 2004

Strange one here - I am posting this in both SQL Server and Access forums

Access is telling me it can't append any of the records due to a key violation.

The query:

INSERT INTO dbo_Colors ( NameColorID, Application, Red, Green, Blue )
SELECT Colors_Access.NameColorID, Colors_Access.Application, Colors_Access.Red, Colors_Access.Green, Colors_Access.Blue
FROM Colors_Access;

Colors_Access is linked from another MDB and dbo_Colors is linked from SQL Server 2000.

There are no indexes or foreign contraints on the SQL table. I have no relationships on the dbo_ table in my MDB. The query works if I append to another Access table. The datatypes all match between the two tables though the dbo_ tables has two additional fields not refrenced in the query.

I can manually append the records using cut and paste with no problems.

I have tried re-linking the tables.

Any ideas?
Thanks,
Brad

View 4 Replies View Related

Query To Return Records Where One Table Is Void Of Linked Data In Another Table

Feb 13, 2008

I have two tables that share a common identity row. I need to build a query where data that exists in one table does not contain data in the other table. For example, table 1 has columns of Owner_ID, LastName, FirstName and table 2 has columns Auto_ID, Owner_ID, AutoMake. Both tables are joined by the Owner_ID column. I need a query that provides all owners from table 1 who do not have an entry in table 2.

Thanks in advance,

Mark

View 5 Replies View Related

Query To Get Linked List Kind Of Data From The Table

Sep 18, 2006

hi Experts,



I have a Issue table which stores the below data for many issue. some issue are duplicate to other and they are stored in a field Duplicate_of









ID
Duplicate_of
State

77637
65702
Duplicate

65702
42217
Duplicate

42217
-
Verified

i wanted to write a query or some stored procedure when passed 77637 should help me get 42217.



Hint : 77637 when passed has field Duplicate_of which point to 65702 and his state will be Duplicate, 65702 will be duplicate to 42217 and state will be duplicate and 44217 is not duplicate to anything and state will be other then Duplicate

i appreciate if somebody can help me think in some line to give me some idea.



/soni

View 1 Replies View Related

Getting Count From Table In Linked Server Using Runtime Query

Mar 21, 2008

Hi Friends,
I want to have solution for one of the problem.
The requirement is like this :
I want to write stored procedure or function which will take parameter as SQL Server name, DB name, UserName and passwod.
This Stored proc will connect to Remote server using these parameters and will get the count of the rows in one of the table.
I created the connection using the linked server

EXEC sp_addlinkedserver @SerevrName,N'SQL Server'



EXEC sp_addlinkedsrvlogin @SerevrName, False, Null, @ServerUserName,@SerevrPws

Now I am trying to get count using following query :
set @SQLQuery = 'SELECT count(*) FROM [' + @SerevrName + '].' + @SrcDataBaseName +'.dbo.<<TableName>>'

But the question is that the execution goes this way :

exec(@SQLQuery)


Now how to assign this count value to some variable so that I can use it later ...?

Going forword I want to use cursor and get the rows in these table using cursor ...?
How can I assign values returned from any runtime query to temporary variable or table ...?


I tried another approach also:
I put remote connection and query execution in inner stored proc called usp_GetTableRowCount
set @SQLQuery = 'SELECT count(*) FROM [' + @SerevrName + '].' + @SrcDataBaseName +'.dbo.<<TableName>>'

exec(@SQLQuery)

and in outer stored proc : referenced the inner stored proc like this

exec @AFSDataRowCount = dbo.usp_GetTableRowCount <<Server Name>>,<<User Name>>, <<Password>>, <<DBName>>
The execution of dbo.usp_GetTableRowCount <<Server Name>>,<<User Name>>, <<Password>>, <<DBName>> gives me exact no of rows
but when I see value of AFSDataRowCount, I get 0.

Kindly help me out whereever I am making mistake or else pls tell me any other approach to follow.
Thanks in advance.

View 6 Replies View Related

Query To Get Linked List Kind Of Data From The Table

Sep 18, 2006

hi Experts,



I have a Issue table which stores the below data for many issue. some issue are duplicate to other and they are stored in a field Duplicate_of









ID
Duplicate_of
State

77637
65702
Duplicate

65702
42217
Duplicate

42217
-
Verified

i wanted to write a query or some stored procedure when passed 77637 should help me get 42217.



Hint : 77637 when passed has field Duplicate_of which point to 65702 and his state will be Duplicate, 65702 will be duplicate to 42217 and state will be duplicate and 44217 is not duplicate to anything and state will be other then Duplicate

i appreciate if somebody can help me think in some line to give me some idea.



/soni

View 5 Replies View Related

SQL 2012 :: Extract All Tables Names And Their Row Counts From Linked Server Tables

Oct 7, 2015

I am using the following select statement to get the row count from SQL linked server table.

SELECT Count(*) FROM OPENQUERY (CMSPROD, 'Select * From MHDLIB.MHSERV0P')

MHDLIB is the library name in IBM DB2 database. The above query gives me only the row count of table MHSERV0P. However, I need to get the names, rowcounts, and sizes of all tables that exist in MHDLIB librray. Is it possible at all?

View 1 Replies View Related

Linked Server ( Not Able To Access Any Tables Under LINKED SERVER From My DESKTOP Enterprise Manager

Mar 25, 2002

Hi ,
On my Desktop i registered Production Server in Enterprise Manager
on that Server if i go to SecurityLinked Servers
There is another Server is already mapped, when i am trying to see the Tables under that one of the
Linked Server i am getting the Error message saying that
"Error 17 SQL Server does not exist or access denied"

if i went to Production Server location and if i try to see the tables i am able to see properly, no problems
why i am not able to see from my Desk top
i am using the sa user while mapping the Production Server on my DESKTOP using (ENTERPRISE MANAGER)

And i check the Client Network Utility in the Alias using Named Pipe only, i changed to TCP/IP still same problem
What might the Problem how can i see the Tables in Linked Server from my DESKTOP

Thanks

View 5 Replies View Related

Query To Combine Two Tables Based On Third Table

Feb 18, 2015

I have three tables A, B, C respectively. Table C is used to map table A and B. Three tables are below:

Table A:

Table B:

Table C:

So what query do I need write to have table like below?

View 3 Replies View Related

Multiple Tables - Loop Through Query Switching Table Name?

Mar 8, 2012

I would like to run the same query on multiple tables. So say I have a list of tables

@tableList = a|b|c|d

And then I have my query looping through the tables

for (@table in tableList)
{
update from @table
set = ''
}

Is there a simple way to do this in an mssql query, if so how do I get to loop through the query switching the table name?

View 4 Replies View Related

Query:Source From Multiple Tables To A Fact Table

Jan 19, 2006

Greetings,

Iam new to SQLl2005. Iam using DTS to transfer data from my source to the warehouse. I have a couple of tables in my source whein I have to join these to tables fields and insert the same in teh warehouse fact table. I have used a Join query in my Oledb source component, What other component needs to be used to insert the data into the fact table.
I also need to extract same data with aggregation and insert the same into an another Fact table.

Kindly help.

View 21 Replies View Related

Declaring A Table Variable Within A Select Table Joined To Other Select Tables In Query

Oct 15, 2007

Hello,

I hope someone can answer this, I'm not even sure where to start looking for documentation on this. The SQL query I'm referencing is included at the bottom of this post.

I have a query with 3 select statements joined together like tables. It works great, except for the fact that I need to declare a variable and make it a table within two of those 3. The example is below. You'll see that I have three select statements made into tables A, B, and C, and that table A has a variable @years, which is a table.

This works when I just run table A by itself, but when I execute the entire query, I get an error about the "declare" keyword, and then some other errors near the word "as" and the ")" character. These are some of those errors that I find pretty meaningless that just mean I've really thrown something off.

So, am I not allowed to declare a variable within these SELECT tables that I'm creating and joining?

Thanks in advance,
Andy



Select * from

(

declare @years table (years int);

insert into @years

select

CASE

WHEN month(getdate()) in (1) THEN year(getdate())-1

WHEN month(getdate()) in (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) THEN year(getdate())

END

select

u.fullname

, sum(tx.Dm_Time) LastMonthBillhours

, sum(tx.Dm_Time)/((select dm_billabledays from dm_billabledays where Dm_Month = Month(GetDate()))*8) lasmosbillingpercentage

from

Dm_TimeEntry tx

join

systemuserbase u

on

(tx.owninguser = u.systemuserid)

where

Month(tx.Dm_Date) = Month(getdate())-1

and

year(dm_date) = (select years from @years)

and tx.dm_billable = 1

group by u.fullname

) as A

left outer join

(select

u.FullName

, sum(tx.Dm_Time) Billhours

, ((sum(tx.Dm_Time))

/

((day(getdate()) * ((5.0)/(7.0))) * 8)) perc

from

Dm_TimeEntry tx

join

systemuserbase u

on

(tx.owninguser = u.systemuserid)

where

tx.Dm_Billable = '1'

and

month(tx.Dm_Date) = month(GetDate())

and

year(tx.Dm_Date) = year(GetDate())

group by u.fullname) as B

on

A.Fullname = B.Fullname

Left Outer Join

(

select

u.fullname

, sum(tx.Dm_Time) TwomosagoBillhours

, sum(tx.Dm_Time)/((select dm_billabledays from dm_billabledays where Dm_Month = Month(GetDate()))*8) twomosagobillingpercentage

from

Dm_TimeEntry tx

join

systemuserbase u

on

(tx.owninguser = u.systemuserid)

where

Month(tx.Dm_Date) = Month(getdate())-2

group by u.fullname

) as C

on

A.Fullname = C.Fullname

View 1 Replies View Related

Regarding The Query To Save The Ids Of The Edited Names From Different Tables Into A Single Table.

Mar 8, 2008

Here with the below query iam binding my gridview with industry name,company name,Plant Name,Group Name related to the IDs in Audit table.Select Aud.Ad_ID_PK,Aud.Audit_Name,Ind.Industry_Name,Cmp.Company_Name,Pla.Plant_Name,Gr.Groups_Name,Aud.Audit_Started_On,Aud.Audit_Scheduledto,Aud.Audit_Created_On from
Industry Ind,
Company Cmp,
Plant Pla,
Groups Gr,
Audits Audwhere Ind.Ind_Id_PK =Aud.Audit_Industry and
Cmp.Cmp_ID_PK =Aud.Audit_Company and
Pla.Pl_ID_PK =Aud.Audit_Plant and
Gr.G_ID_PK =Aud.Audit_Group and
Ad_ID_PK in (select Ad_ID_PK from Audits)
Now i want to edit these names.
when i click on edit in gridview these names will be filled into textboxes and when i change the names it should compare the name with particular tables and should get the Id of that and store in Audits table.
For example:
i have this data in my audits table:




Commercial83312

2
2
2
1
Here Commercial83312 is ID of that Audit and 2,2,2,1 are the Industry,Company,Plant and group Ids for that particular audit.In the front end i can see the names of this particular IDs.
when i edit the industry name in the UI it must check the name with industry table and get the ID of the changed name and store it in audit table.
so the data may be changed in audits table as :



Commercial83312

4
2
2
1

 




so here the industry ID is changed
I need the stored procedure for this.
please help me,its very urgent...

View 4 Replies View Related

SQL Server 2014 :: Query To Combine Two Tables Based Third Table

Feb 18, 2015

I have three tables A, B, C respectively. Table C is used to map table A and B. Three tables are below:

Table A:

Table B:

Table C:

So what query do I need write to have table like below?

Table D

View 7 Replies View Related

SQL 2000: Query Question - Input Data Within Two Tables And 'between' Table

May 1, 2008

Hello specialists.

Maybe this is the wrong formum but I've got a question for which you probably have the answer, i hope.


Situation
------------
John is member of Group_A and Group_B
Bill is member of Group_B and Group_C
Allison is member of Group_A and Group_E

How can I create a query to input Allisons username into table 1 and groupmembership into table 2. Also updating the relationship within table3 must be done automaticaly. I want to avoid duplicate records.
The final situation I want is given in red text.

The relationships between the tables are as follows
-------------------------------------------------------------
Table1 (PK)ID-Userinfo [ONE] <------------> [MANY] Table3 ID-Userinfo
Table3 (PK)ID-GroupInfo [MANY] <------------> [ONE] Table2 (PK)ID-GroupInfo

Table1: UserInfo
------------------------------
(PK)ID-Userinfo UserName
1 John
2 Bill
3 Allison

Table2: GroupInfo
------------------------------
(PK)ID-GroupInfo GroupName
1 Group_A
2 Group_B
3 Group_C

4 Group_E

Table3: MemberOf
------------------------------
(PK)ID-MemberOf ID-UserInfo ID-GroupInfo
1 1 1
2 1 2
3 2 2
4 2 3
5 3 1
6 3 4


I hope you can help me cracking this nut.

Thx in advance. Greetings Fred

View 3 Replies View Related

SQL Query Question : How To Add Data To Two Tables Connected By Third Junction-table.

May 1, 2008


Hello specialists.

Maybe this is the wrong formum but I've got a question for which you probably have the answer, i hope.


Situation
------------
John is member of Group_A and Group_B
Bill is member of Group_B and Group_C
Allison is member of Group_A and Group_E

How can I create a query to input Allisons username into table 1 and groupmembership into table 2. Also updating the relationship within junction-table3 must be done automaticaly. I want to avoid duplicate records.
The final situation I want is given in red text.

The relationships between the tables are as follows
-------------------------------------------------------------
Table1 (PK)ID-Userinfo [ONE] <------------> [MANY] Table3 ID-Userinfo
Table3 (PK)ID-GroupInfo [MANY] <------------> [ONE] Table2 (PK)ID-GroupInfo

Table1: UserInfo
------------------------------
(PK)ID-Userinfo UserName
1 John
2 Bill
3 Allison

Table2: GroupInfo
------------------------------
(PK)ID-GroupInfo GroupName
1 Group_A
2 Group_B
3 Group_C

4 Group_E

Table3: MemberOf
------------------------------
(PK)ID-MemberOf ID-UserInfo ID-GroupInfo
1 1 1
2 1 2
3 2 2
4 2 3
5 3 1
6 3 4


I hope you can help me cracking this nut.

Thx in advance. Greetings Fred

View 7 Replies View Related

Loading Data From Same Table (oracle) In To Diff SQL Tables With In Same Package(same Query)

Nov 14, 2007



Hi,

I have Table A . we already have 80 columns . we have to add 65 more columns.

we are populating this table from oracle .and we need to populate those 65 columns again from the same table.

Is it a better idea to add those new 65 columns to the same table or new table.

If we go for the same table then loading time will be double, If I go for new table and If i am able to run both the packages which loads table data from same oracle server to difffrent sql tables then we should be good. But if we run in to temp space issues on oracle server . Then i have to load the two tables separately which consumes the same time as earlier one.

I was thinking if there is a way in SSIS where I can pull data from same oracle table in to two diff sql tables at same time?

View 1 Replies View Related

The OLE DB Provider MSDAORA For Linked Server .... Does Not Contain The Table COUNTRY. The Table Either Does Not Exist Or The Current User Does Not Have Permissions On That Table.

Jun 13, 2006

I am using SQL Server 2005 and trying to create a linked server on Oracle 10. I used the commands below:
EXEC sp_addlinkedserver
@server = 'test1',
@srvproduct = 'Oracle',
@provider = 'MSDAORA',
@datasrc = 'testsource'
exec sp_addlinkedsrvlogin
@rmtsrvname = 'test1',
@useself = 'false',
@rmtuser='sp',
@rmtpassword='sp'
 
When I execute
select * from test1...COUNTRY
I get the error. "The OLE DB provider "MSDAORA" for linked server "...." does not contain the table "COUNTRY". The table either does not exist or the current user does not have permissions on that table."
The 'sp' user I am connecting is the owner of the table. What could be the problem ?
Thanks a lot.

View 3 Replies View Related

Linked Tables In SQL 7

Jul 5, 1999

Is there a way to implement linked tables in SQL 7 to get the same functionality that they deliver in Access ?

View 1 Replies View Related

Linked Tables

Mar 5, 2002

Hi

Our users are linking sql tables in Access. Our management wants to stop that.
Is there any way to deny connection to sql server using access linking tables?

Please help me.
Thanks in advance
Jaya

View 2 Replies View Related

SQL Linked Tables

Sep 10, 2007

I have two SQL Server 2005 Databases running on the same server.

I am working in a third database that needs to contain a union query to display data from one table in each of the other databases.

In other words, within Database 3, I need to create View C..

This view will show takes Fields W & X from Table A in Database 1..
and union those values with Fields Y & Z from Table B in Database 2..

a) Does this make any sense?
b) What is the best way to do this?

(I searched, but anything with the phrase 'linked table' brought up results almost exclusively from the Access forums..)

Thanks!

View 11 Replies View Related

Linked Tables

Jul 20, 2005

I have access tables which are linked to SQL database by ODBCconnection. By using Access, i can easily see my table contents. butwhen i am using ASP, i con not. I am getting this error messageMicrosoft JET Database Engine (0x80004005)ODBC--connection to 'SQL ServerMYDATABASE' failed.windows 2000, access XP, and sql 2000Please help me.Thank you

View 5 Replies View Related

Linked Tables

May 4, 2006

I currently have a SQL Database with 1 Table. I have connected to the SQL table via MS Access 2003 via Linked Tables. I can import records from either an XLS or CSV file to the Link Tables all day. However, I cannot update nor delete records. I have given my account full DBO access to the SQL Database and Table but still cannot make any modification from within Access. Is this even possible for what I am attempting to do within Access? If so, please tell me what I need to modify within SQL. Thanks in advance!

View 4 Replies View Related

Help With Deleteing From Two Linked Tables

Mar 24, 2008

Hi,
know this sounds like a really silly question, but im having a bit of a problem deleting from two linked tables
I have tried doing the following, however it says that it has an error near the ','
Any suggestions??
DELETE FROM meter_quote , client_details FROM meter_quote, client_details INNER JOIN client_details ON meter_quote.Client_ID = client_details.Client_ID
Thanks, Hayley

View 2 Replies View Related

Can You Have Linked SQL Server Tables?

Mar 9, 2004

Hello,

I currently am in charge of creating a Sharepoint 2003/Exchange 2003 ticketing system. We have a client database (MS Access 2003) that has a linked table to our Exchange store, retrieving information we enter in Exchange regarding specific clients. I would like to move this database to SQL Server for performance reasons. Soon there will be many people accessing this database and I don't want the bottle neck to be Access.

The only quirk I can think of is, can one link a table from SQL Server to Exchange. Or for that matter, can SQL Server have linked tables at all? One solution I can think of is to create a System Service that runs on the server, to periodically update the SQL table with the information in the Exchange store. But that could become costly over time with large amounts of network bandwidth being used for unnecessary updates.

Is there maybe another solution I'm not seeing? Should I just stick with the Access database?

Thanks
Josh

View 1 Replies View Related

ODBC Linked Tables

Mar 23, 2001

In order to use Access 97 as your frontend and SQL 7 as your backend on a
network (where the frontend is located on the same computer as the backend and
people just map to Access frontend) where security for the data is recognized
by your domain login account and what domain group you belong to..do you
have to have the same System DSN on everyone's computer for linking? I am
still having problems with people linking to the SQL server through the network and only my account is working correctly from my desktop. Everyone
else who tries to link gets an ODBC failure error message when trying to
open one of the linked tables. I have heard from one person that you must
have the same system DSN on every client's computer but to me that makes no
sense as I do not have the DSN listed on my individual computer...I am just
going through the network as myself..not as an admin..and getting directly
to the data. Everyone else can get to the shared folder on the server but
cannot get to the linked tables. Any ideas?

View 2 Replies View Related

Access/SQL Linked Tables

Nov 17, 2005

I have linked a number of tables from a SQL database to a Access front end. I am able to update all but one of the tables (the main table I need!!!). I get the error, cannot update record as it has been changed by another user although there is no other user. I believe it may be to do with the way the recordset is linked to the access database or the referential integrity of the table associations in the SQL database.

I can change the data using query analyser without issue.

Any help would be greatfully apreciated.

View 7 Replies View Related

Do A Lot Of Linked Tables Cause Block?

May 18, 2004

Hello, everyone:

There are a lot of Access and Excel tables linked to my SQL Server (SQL2K SP3 on W2K). The end users update those likned tables. I am wondering if there is the block problem. If yes, how to prevent that? Thanks.

ZYT

View 1 Replies View Related

Opendatabase And Linked Tables

May 22, 2006

Hi I am trying, to query, from the SQL Server query analyzer MyTable, which is a linked table residing in Access,

SELECT *
FROM OPENDATASOURCE(
'Microsoft.Jet.OLEDB.4.0',
'Data Source="S:MyDatabase.mdb";
User ID=Admin;Password='
)...[MyTable]




Im not being allowed to do so:
the error is the following:
--------------
Could not open table 'SHRTCKN' from OLE DB provider 'Microsoft.Jet.OLEDB.4.0'. The specified table does not exist.
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IOpenRowset::OpenRowset returned 0x80040e37: The specified table does not exist.].
------------------------

Does anybody have any comment?

thank you

View 2 Replies View Related

Altering Linked Tables

Jul 20, 2005

I have a table (in Access) that is linked to the SQL server, and Ineed to add a column to it. I wrote the following:ALTER TABLE CensusADD COLUMN 'ActiveFacility' BIT;and I get a syntax error that I do not know how to solve. The columnneeds to contain yes/no data for each record.Any help for a struggling newbie?Thanks,Christine

View 1 Replies View Related

Tables In Linked Server

Jul 20, 2005

HiI received the below error when trying to run an update from one SQLServer to another.I can insert and select. I cannot delete or update. The permissionshave been changed to allow the linked server user to carry outeverything, the linked servers are working but we cannot change thedata.We are stumpped and your help would be appreciated.Server: Msg 7306, Level 16, State 2, Line 1Could not open table '"charmfin"."charm"."TMP_BATCHPOSTING"' from OLEDB provider 'SQLOLEDB'. The provider could not support a row lookupposition. The provider indicates that conflicts occurred with otherproperties or requirements.[OLE/DB provider returned message: Multiple-step OLE DB operationgenerated errors. Check each OLE DB status value, if available. Nowork was done.]OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IOpenRowset::OpenRowsetreturned 0x80040e21: [PROPID=DBPROP_BOOKMARKS VALUE=TrueSTATUS=DBPROPSTATUS_CONFLICTING], [PROPID=DBPROP_COMMANDTIMEOUTVALUE=600 STATUS=DBPROPSTATUS_OK], [PROPID=Unknown PropertyIDVALUE=True STATUS=DBPROPSTATUS_OK], [PROPID=DBPROP_IRowsetLocateVALUE=True STATUS=DBPROPSTATUS_CONFLICTING],[PROPID=DBPROP_IRowsetChange VA...Thanks in advance.Simon

View 1 Replies View Related

Some Tables Do Not Appear When Using Linked Server

Aug 11, 2007

I just finished up setting up linked server from one of my database machines to another. After futzing to get permissions just right, it works great for many things:


select top 5 * from altai.prep.dbo.simulation_status
0 Prepping Simulation is being prepped by the owner.
1 Prepped Simulation has been prepped by the owner.
2 Checking Simulation is being checked by the owner.
3 Checked Simulation has been checked.
4 Running Simulation is running.


I can even see tables using sp_tables_ex:

sp_tables_ex 'ALTAI', 'S%', 'dbo', 'prep', NULL, 1



TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS

-------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

prep dbo Simulation TABLE NULL

prep dbo Simulation_References TABLE NULL

prep dbo Simulation_SimulationGroup TABLE NULL

prep dbo Simulation_Status TABLE NULL

prep dbo SimulationGroup TABLE NULL

(5 row(s) affected)


The trouble is, I have another table in this database called that begins with "S": Staging_Transition_States. If I try to access this table via the linked server, I get:


select * from altai.prep.dbo.Staging_Transition_States

Msg 7314, Level 16, State 1, Line 1

The OLE DB provider "SQLNCLI" for linked server "altai" does not contain the table ""prep"."dbo"."Staging_Transition_States"". The table either does not exist or the current user does not have permissions on that table.


This table exists, sp_help for this table is below. Why doesn't this table show up in the output of sp_tables_ex? As far as I can tell, permissions for the tables that work and this table are identical.

Thanks!

--Andrew


Name Owner Type Created_datetime

-------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ------------------------------- -----------------------

Staging_Transition_States dbo user table 2007-07-27 11:29:47.790





Column_name Type Computed Length Prec Scale Nullable TrimTrailingBlanks FixedLenNullInSource Collation

-------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ----------------------------------- ----------- ----- ----- ----------------------------------- ----------------------------------- ----------------------------------- --------------------------------------------------------------------------------------------------------------------------------

pdb4 char no 4 yes no yes SQL_Latin1_General_CP1_CI_AS

temp smallint no 2 5 0 yes (n/a) (n/a) NULL

run smallint no 2 5 0 yes (n/a) (n/a) NULL

sim_id int no 4 10 0 yes (n/a) (n/a) NULL

time_step int no 4 10 0 yes (n/a) (n/a) NULL

time decimal no 5 9 2 yes (n/a) (n/a) NULL

status tinyint no 1 3 0 no (n/a) (n/a) NULL

order int no 4 10 0 yes (n/a) (n/a) NULL

comment varchar no 250 yes no yes SQL_Latin1_General_CP1_CI_AS

created smalldatetime no 4 yes (n/a) (n/a) NULL

created_by sysname no 256 yes (n/a) (n/a) SQL_Latin1_General_CP1_CI_AS

updated smalldatetime no 4 yes (n/a) (n/a) NULL

updated_by sysname no 256 yes (n/a) (n/a) SQL_Latin1_General_CP1_CI_AS



Identity Seed Increment Not For Replication

-------------------------------------------------------------------------------------------------------------------------------- --------------------------------------- --------------------------------------- -------------------

No identity column defined. NULL NULL NULL



RowGuidCol

--------------------------------------------------------------------------------------------------------------------------------

No rowguidcol column defined.



Data_located_on_filegroup

--------------------------------------------------------------------------------------------------------------------------------

PRIMARY



The object 'Staging_Transition_States' does not have any indexes, or you do not have permissions.



constraint_type constraint_name delete_action update_action status_enabled status_for_replication constraint_keys

-------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ------------- ------------- -------------- ---------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

DEFAULT on column created DF__Staging_T__creat__047AA831 (n/a) (n/a) (n/a) (n/a) (getdate())

DEFAULT on column created_by DF__Staging_T__creat__056ECC6A (n/a) (n/a) (n/a) (n/a) (suser_sname())

DEFAULT on column status DF__Staging_T__statu__038683F8 (n/a) (n/a) (n/a) (n/a) ((0))

DEFAULT on column updated DF__Staging_T__updat__0662F0A3 (n/a) (n/a) (n/a) (n/a) (getdate())

DEFAULT on column updated_by DF__Staging_T__updat__075714DC (n/a) (n/a) (n/a) (n/a) (suser_sname())



No foreign keys reference table 'Staging_Transition_States', or you do not have permissions on referencing tables.

No views with schema binding reference table 'Staging_Transition_States'.

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved