If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
TRIGGER a VIEW with SQL for a LINKED SERVER (ACCESS DB)
Hi,
I have an ACCESS DB that I would like to import to a SQL DB. I linked the ACCESS DB to my SQL SERVER. For this, no problem. After that I create a VIEW from my SQL DATABASE and I can see all RECORDS from the ACCESS TABLE. Now , I am looking for updating my Table from SQL DB by all new records inserted in the ACCESS DB. I create a TRIGGER from my VIEW. You can see below the source code : CREATE TRIGGER TG_INSERT_LogStatus ON [dbo].[VIEW_MTX_BTS_LOG] ---------------------------------------------------------- INSERT in Log INSTEAD OF INSERT AS BEGIN My code END ---------------------------------------------------------------------------- ----------------------------- I can execute my TRIGGER but I cannot see the new records inserted in the ACCESS DB. Is anyone can help me about that. |
#2
|
|||
|
|||
TRIGGER a VIEW with SQL for a LINKED SERVER (ACCESS DB)
Does the linked table have both a primary key AND ALSO a timestamp field
exposed? I would make sure of the above, and then delete/re-crease the link in ms-access for the problem table. Likely when you created this table you did not select/set a primary key. Also, are you using a native sql project in ms-access (ADP project), or odbc? -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada http://www.attcanada.net/~kallal.msn |
#3
|
|||
|
|||
TRIGGER a VIEW with SQL for a LINKED SERVER (ACCESS DB)
Dunno. Will SQL Server trigger on events on foreign tables?
I don't think there is anyone here who has ever tried it. (david) "youssef" wrote in message ... Hi, I have an ACCESS DB that I would like to import to a SQL DB. I linked the ACCESS DB to my SQL SERVER. For this, no problem. After that I create a VIEW from my SQL DATABASE and I can see all RECORDS from the ACCESS TABLE. Now , I am looking for updating my Table from SQL DB by all new records inserted in the ACCESS DB. I create a TRIGGER from my VIEW. You can see below the source code : CREATE TRIGGER TG_INSERT_LogStatus ON [dbo].[VIEW_MTX_BTS_LOG] ---------------------------------------------------------- INSERT in Log INSTEAD OF INSERT AS BEGIN My code END -------------------------------------------------------------------------- -- ----------------------------- I can execute my TRIGGER but I cannot see the new records inserted in the ACCESS DB. Is anyone can help me about that. |
#4
|
|||
|
|||
TRIGGER a VIEW with SQL for a LINKED SERVER (ACCESS DB)
Hi,
I selected the primary key. I find in a forum a solution but I don't understand how it is working. Please find the link : With Oracle : http://www.experts-exchange.com/Data...8.html#9102669 With SQL : http://www.experts-exchange.com/Data..._20823443.html Can you help me about that ? Best Regards "david epsom dot com dot au" david@epsomdotcomdotau wrote in message ... Dunno. Will SQL Server trigger on events on foreign tables? I don't think there is anyone here who has ever tried it. (david) "youssef" wrote in message ... Hi, I have an ACCESS DB that I would like to import to a SQL DB. I linked the ACCESS DB to my SQL SERVER. For this, no problem. After that I create a VIEW from my SQL DATABASE and I can see all RECORDS from the ACCESS TABLE. Now , I am looking for updating my Table from SQL DB by all new records inserted in the ACCESS DB. I create a TRIGGER from my VIEW. You can see below the source code : CREATE TRIGGER TG_INSERT_LogStatus ON [dbo].[VIEW_MTX_BTS_LOG] ---------------------------------------------------------- INSERT in Log INSTEAD OF INSERT AS BEGIN My code END -------------------------------------------------------------------------- -- ----------------------------- I can execute my TRIGGER but I cannot see the new records inserted in the ACCESS DB. Is anyone can help me about that. |
#5
|
|||
|
|||
TRIGGER a VIEW with SQL for a LINKED SERVER (ACCESS DB)
Hi,
I selected the primary key. I find in a forum a solution but I don't understand how it is working. Please find the link : With Oracle : http://www.experts-exchange.com/Data...8.html#9102669 With SQL : http://www.experts-exchange.com/Data..._20823443.html Can you help me about that ? Best Regards "david epsom dot com dot au" david@epsomdotcomdotau wrote in message ... Dunno. Will SQL Server trigger on events on foreign tables? I don't think there is anyone here who has ever tried it. (david) "youssef" wrote in message ... Hi, I have an ACCESS DB that I would like to import to a SQL DB. I linked the ACCESS DB to my SQL SERVER. For this, no problem. After that I create a VIEW from my SQL DATABASE and I can see all RECORDS from the ACCESS TABLE. Now , I am looking for updating my Table from SQL DB by all new records inserted in the ACCESS DB. I create a TRIGGER from my VIEW. You can see below the source code : CREATE TRIGGER TG_INSERT_LogStatus ON [dbo].[VIEW_MTX_BTS_LOG] ---------------------------------------------------------- INSERT in Log INSTEAD OF INSERT AS BEGIN My code END -------------------------------------------------------------------------- -- ----------------------------- I can execute my TRIGGER but I cannot see the new records inserted in the ACCESS DB. Is anyone can help me about that. |
#6
|
|||
|
|||
TRIGGER a VIEW with SQL for a LINKED SERVER (ACCESS DB)
With Oracle:
He has an Oracle table. With SQL: He has an SQL Server table. Do you have a SQL Server table? What is the table name? What is the name of the database? Does the trigger fire when you do an insert? Does it insert a new record in the second table? Where is the second table? What is the table name? What is the name of the database? (david) "youssef" wrote in message ... Hi, I selected the primary key. I find in a forum a solution but I don't understand how it is working. Please find the link : With Oracle : http://www.experts-exchange.com/Data...8.html#9102669 With SQL : http://www.experts-exchange.com/Data..._20823443.html Can you help me about that ? Best Regards "david epsom dot com dot au" david@epsomdotcomdotau wrote in message ... Dunno. Will SQL Server trigger on events on foreign tables? I don't think there is anyone here who has ever tried it. (david) "youssef" wrote in message ... Hi, I have an ACCESS DB that I would like to import to a SQL DB. I linked the ACCESS DB to my SQL SERVER. For this, no problem. After that I create a VIEW from my SQL DATABASE and I can see all RECORDS from the ACCESS TABLE. Now , I am looking for updating my Table from SQL DB by all new records inserted in the ACCESS DB. I create a TRIGGER from my VIEW. You can see below the source code : CREATE TRIGGER TG_INSERT_LogStatus ON [dbo].[VIEW_MTX_BTS_LOG] ---------------------------------------------------------- INSERT in Log INSTEAD OF INSERT AS BEGIN My code END -------------------------------------------------------------------------- -- ----------------------------- I can execute my TRIGGER but I cannot see the new records inserted in the ACCESS DB. Is anyone can help me about that. |
#7
|
|||
|
|||
TRIGGER a VIEW with SQL for a LINKED SERVER (ACCESS DB)
With Oracle:
He has an Oracle table. With SQL: He has an SQL Server table. Do you have a SQL Server table? What is the table name? What is the name of the database? Does the trigger fire when you do an insert? Does it insert a new record in the second table? Where is the second table? What is the table name? What is the name of the database? (david) "youssef" wrote in message ... Hi, I selected the primary key. I find in a forum a solution but I don't understand how it is working. Please find the link : With Oracle : http://www.experts-exchange.com/Data...8.html#9102669 With SQL : http://www.experts-exchange.com/Data..._20823443.html Can you help me about that ? Best Regards "david epsom dot com dot au" david@epsomdotcomdotau wrote in message ... Dunno. Will SQL Server trigger on events on foreign tables? I don't think there is anyone here who has ever tried it. (david) "youssef" wrote in message ... Hi, I have an ACCESS DB that I would like to import to a SQL DB. I linked the ACCESS DB to my SQL SERVER. For this, no problem. After that I create a VIEW from my SQL DATABASE and I can see all RECORDS from the ACCESS TABLE. Now , I am looking for updating my Table from SQL DB by all new records inserted in the ACCESS DB. I create a TRIGGER from my VIEW. You can see below the source code : CREATE TRIGGER TG_INSERT_LogStatus ON [dbo].[VIEW_MTX_BTS_LOG] ---------------------------------------------------------- INSERT in Log INSTEAD OF INSERT AS BEGIN My code END -------------------------------------------------------------------------- -- ----------------------------- I can execute my TRIGGER but I cannot see the new records inserted in the ACCESS DB. Is anyone can help me about that. |
#8
|
|||
|
|||
TRIGGER a VIEW with SQL for a LINKED SERVER (ACCESS DB)
Hi,
Thank for your time. So, I have one Table in the ACCESS DB. This DB, I linked with SQL SERVER. At this moment, I can connected to the ACCESS DB from my SQL SERVER (LINKED SERVER NAME : MTX_BTS_LOG) Now I create in my SQLSERVER a DB with the same structure TABLE than the ACCESS DB. the Name of the Table is : [Router Status] In this way, I create in my SQL DB, a view (VIEW_MTX_BTS_LOG) that represent the TABLE of the linked server( ACCESS DATABASE). The name of the VIEW : VIEW_MTX_BTS_LOG SELECT * FROM MTX_BTS_LOG...[Router Status] When I exectute the VIEW, I see all records from the TABLE of my ACCESS DB. Now, I create a TRIGGER from this VIEW with this code : CREATE TRIGGER TG_INSERT_LogStatus ON [dbo].[VIEW_MTX_BTS_LOG] ---------------------------------------------------------- INSERT in Log INSTEAD OF INSERT AS BEGIN My code = Insert the new record in my SQL TABLE END -------------------------------------------------------------------------- Now, the TRIGGER is created but nothing when a new record is inserted in the ACCESS DB. Can you help me ? Best Regards "david epsom dot com dot au" david@epsomdotcomdotau wrote in message ... With Oracle: He has an Oracle table. With SQL: He has an SQL Server table. Do you have a SQL Server table? What is the table name? What is the name of the database? Does the trigger fire when you do an insert? Does it insert a new record in the second table? Where is the second table? What is the table name? What is the name of the database? (david) "youssef" wrote in message ... Hi, I selected the primary key. I find in a forum a solution but I don't understand how it is working. Please find the link : With Oracle : http://www.experts-exchange.com/Data...8.html#9102669 With SQL : http://www.experts-exchange.com/Data..._20823443.html Can you help me about that ? Best Regards "david epsom dot com dot au" david@epsomdotcomdotau wrote in message ... Dunno. Will SQL Server trigger on events on foreign tables? I don't think there is anyone here who has ever tried it. (david) "youssef" wrote in message ... Hi, I have an ACCESS DB that I would like to import to a SQL DB. I linked the ACCESS DB to my SQL SERVER. For this, no problem. After that I create a VIEW from my SQL DATABASE and I can see all RECORDS from the ACCESS TABLE. Now , I am looking for updating my Table from SQL DB by all new records inserted in the ACCESS DB. I create a TRIGGER from my VIEW. You can see below the source code : CREATE TRIGGER TG_INSERT_LogStatus ON [dbo].[VIEW_MTX_BTS_LOG] ---------------------------------------------------------- INSERT in Log INSTEAD OF INSERT AS BEGIN My code END -------------------------------------------------------------------------- -- ----------------------------- I can execute my TRIGGER but I cannot see the new records inserted in the ACCESS DB. Is anyone can help me about that. |
#9
|
|||
|
|||
TRIGGER a VIEW with SQL for a LINKED SERVER (ACCESS DB)
Hi,
Thank for your time. So, I have one Table in the ACCESS DB. This DB, I linked with SQL SERVER. At this moment, I can connected to the ACCESS DB from my SQL SERVER (LINKED SERVER NAME : MTX_BTS_LOG) Now I create in my SQLSERVER a DB with the same structure TABLE than the ACCESS DB. the Name of the Table is : [Router Status] In this way, I create in my SQL DB, a view (VIEW_MTX_BTS_LOG) that represent the TABLE of the linked server( ACCESS DATABASE). The name of the VIEW : VIEW_MTX_BTS_LOG SELECT * FROM MTX_BTS_LOG...[Router Status] When I exectute the VIEW, I see all records from the TABLE of my ACCESS DB. Now, I create a TRIGGER from this VIEW with this code : CREATE TRIGGER TG_INSERT_LogStatus ON [dbo].[VIEW_MTX_BTS_LOG] ---------------------------------------------------------- INSERT in Log INSTEAD OF INSERT AS BEGIN My code = Insert the new record in my SQL TABLE END -------------------------------------------------------------------------- Now, the TRIGGER is created but nothing when a new record is inserted in the ACCESS DB. Can you help me ? Best Regards "david epsom dot com dot au" david@epsomdotcomdotau wrote in message ... With Oracle: He has an Oracle table. With SQL: He has an SQL Server table. Do you have a SQL Server table? What is the table name? What is the name of the database? Does the trigger fire when you do an insert? Does it insert a new record in the second table? Where is the second table? What is the table name? What is the name of the database? (david) "youssef" wrote in message ... Hi, I selected the primary key. I find in a forum a solution but I don't understand how it is working. Please find the link : With Oracle : http://www.experts-exchange.com/Data...8.html#9102669 With SQL : http://www.experts-exchange.com/Data..._20823443.html Can you help me about that ? Best Regards "david epsom dot com dot au" david@epsomdotcomdotau wrote in message ... Dunno. Will SQL Server trigger on events on foreign tables? I don't think there is anyone here who has ever tried it. (david) "youssef" wrote in message ... Hi, I have an ACCESS DB that I would like to import to a SQL DB. I linked the ACCESS DB to my SQL SERVER. For this, no problem. After that I create a VIEW from my SQL DATABASE and I can see all RECORDS from the ACCESS TABLE. Now , I am looking for updating my Table from SQL DB by all new records inserted in the ACCESS DB. I create a TRIGGER from my VIEW. You can see below the source code : CREATE TRIGGER TG_INSERT_LogStatus ON [dbo].[VIEW_MTX_BTS_LOG] ---------------------------------------------------------- INSERT in Log INSTEAD OF INSERT AS BEGIN My code END -------------------------------------------------------------------------- -- ----------------------------- I can execute my TRIGGER but I cannot see the new records inserted in the ACCESS DB. Is anyone can help me about that. |
#10
|
|||
|
|||
TRIGGER a VIEW with SQL for a LINKED SERVER (ACCESS DB)
OK, the examples you quoted are for
SQL Server tables and Oracle tables You have an ACCESS DB Table I'm sorry, but I don't think you can use SQL Server Triggers for an ACCESS DB Table. However, if I am wrong, if you can use a SQL Server Trigger, then you should try to use an UPDATE TRIGGER instead of INSERT TRIGGER. It is normal to see external database inserts done as a blank insert, with a real update. (david) "youssef" wrote in message ... Hi, Thank for your time. So, I have one Table in the ACCESS DB. This DB, I linked with SQL SERVER. At this moment, I can connected to the ACCESS DB from my SQL SERVER (LINKED SERVER NAME : MTX_BTS_LOG) Now I create in my SQLSERVER a DB with the same structure TABLE than the ACCESS DB. the Name of the Table is : [Router Status] In this way, I create in my SQL DB, a view (VIEW_MTX_BTS_LOG) that represent the TABLE of the linked server( ACCESS DATABASE). The name of the VIEW : VIEW_MTX_BTS_LOG SELECT * FROM MTX_BTS_LOG...[Router Status] When I exectute the VIEW, I see all records from the TABLE of my ACCESS DB. Now, I create a TRIGGER from this VIEW with this code : CREATE TRIGGER TG_INSERT_LogStatus ON [dbo].[VIEW_MTX_BTS_LOG] ---------------------------------------------------------- INSERT in Log INSTEAD OF INSERT AS BEGIN My code = Insert the new record in my SQL TABLE END -------------------------------------------------------------------------- Now, the TRIGGER is created but nothing when a new record is inserted in the ACCESS DB. Can you help me ? Best Regards "david epsom dot com dot au" david@epsomdotcomdotau wrote in message ... With Oracle: He has an Oracle table. With SQL: He has an SQL Server table. Do you have a SQL Server table? What is the table name? What is the name of the database? Does the trigger fire when you do an insert? Does it insert a new record in the second table? Where is the second table? What is the table name? What is the name of the database? (david) "youssef" wrote in message ... Hi, I selected the primary key. I find in a forum a solution but I don't understand how it is working. Please find the link : With Oracle : http://www.experts-exchange.com/Data...8.html#9102669 With SQL : http://www.experts-exchange.com/Data..._20823443.html Can you help me about that ? Best Regards "david epsom dot com dot au" david@epsomdotcomdotau wrote in message ... Dunno. Will SQL Server trigger on events on foreign tables? I don't think there is anyone here who has ever tried it. (david) "youssef" wrote in message ... Hi, I have an ACCESS DB that I would like to import to a SQL DB. I linked the ACCESS DB to my SQL SERVER. For this, no problem. After that I create a VIEW from my SQL DATABASE and I can see all RECORDS from the ACCESS TABLE. Now , I am looking for updating my Table from SQL DB by all new records inserted in the ACCESS DB. I create a TRIGGER from my VIEW. You can see below the source code : CREATE TRIGGER TG_INSERT_LogStatus ON [dbo].[VIEW_MTX_BTS_LOG] ---------------------------------------------------------- INSERT in Log INSTEAD OF INSERT AS BEGIN My code END -------------------------------------------------------------------------- -- ----------------------------- I can execute my TRIGGER but I cannot see the new records inserted in the ACCESS DB. Is anyone can help me about that. |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Access 2003 Data Access Page - SQL Server - NT Login | GregCrossan | General Discussion | 0 | June 17th, 2004 10:38 PM |
Slow connection to SQL Server from Microsoft Word XP | Gerald Vogt | Mailmerge | 4 | June 13th, 2004 01:35 PM |
create table using access 2000 connecting to SQL Server 2000 | Chris | Running & Setting Up Queries | 0 | June 11th, 2004 06:41 PM |
sql view | charles osborne | Database Design | 1 | May 29th, 2004 05:21 AM |
Access 2000 .adp and SQL 2000 | Wayne H. | New Users | 0 | May 3rd, 2004 08:28 PM |