Solved

How do I use Identity_Insert on a table from a dbase located on an entirely different server?

Posted on 2008-09-30
3
314 Views
Last Modified: 2012-05-05
I am working on developing DNN modules for my company intranet to replace the need for Access to perform certain functions. My intranet is located on 1 server which is seperate from my main SQL server. I developed all the stored procedures with a copy of the live database which I placed on the same server I was developing the modules. I got everything working perfectly, but then once I pointed the path for all procedures to the live database I get an error on the 2 insert procedures which require an Identity_Insert statement. To get the path to work on SQL I had to place brackets around the server and database name to treat it as a single argument since it seems Identity insert will only allow 3 arguments ->[UCLISERVER1.Engineering01].dbo.Activity. However, now that everything is hitting the live database I get the error {Cannot find the object "UCLISERVER1.Engineering01.dbo.Activity" because it does not exist or you do not have permissions.} when I try to run the code that calls the insert procedure. If I rem out the Identity_insert lines I just get the generic error telling me I need them. Does anybody know how to get around this?
0
Comment
Question by:casper114
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
aaronakin earned 250 total points
ID: 22607375
1. Then you put brackets around UCLISERVER1.Engineering01, you are essentially telling SQL Server that "UCLISERVER1.Engineering01" is your database name.  To specify it as a server & database, you'd have to use "[UCLISERVER1].[Engineering01]".

2. You can use IDENTITY_INSERT for a remote server.  This is why it only allows a 3-part name.  You'll probably have to call an SP on the live server to do the insert in order to make this work.
0
 

Author Comment

by:casper114
ID: 22609229
Thanks Aaron. Created insert SP's under the live database and once I changed the call to those procedures everything worked great. I'll have to remember that when using the Identity_Insert in the future.
0
 

Author Closing Comment

by:casper114
ID: 31501624
Thanks for your help. Once I was able to sit down and implement it, things went beautifully.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now