i need to alter all foreign keys in my database and uncheck the
"Enforce relationship for replication" check box. Using the EM, I
extracted the code snippet below. unfortunately, when i run this test
from query analyzer, then go back into the EM, the box is still
checked.
can anyone tell me what i am missing? any advice on unsetting this
attribute globally would be appreciated!
BEGIN TRANSACTION
SET QUOTED_IDENTIFI ER ON
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
SET ARITHABORT ON
SET NUMERIC_ROUNDAB ORT OFF
SET CONCAT_NULL_YIE LDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
ALTER TABLE dbo.CustomerCus tomerDemo
DROP CONSTRAINT FK_CustomerCust omerDemo_Custom ers
GO
COMMIT
BEGIN TRANSACTION
ALTER TABLE dbo.CustomerCus tomerDemo WITH NOCHECK ADD CONSTRAINT
FK_CustomerCust omerDemo_Custom ers FOREIGN KEY
(
CustomerID
) REFERENCES dbo.Customers
(
CustomerID
) NOT FOR REPLICATION
GO
COMMIT
thanks!! 4 7296
dayong (re******@yahoo .com) writes: i need to alter all foreign keys in my database and uncheck the "Enforce relationship for replication" check box. Using the EM, I extracted the code snippet below. unfortunately, when i run this test from query analyzer, then go back into the EM, the box is still checked.
It's not simply a refresh issue? I was not able to reproduce this, of
the simple reason that I was not able find where you poke with FKs in
Enterprise Manager. I prefer to work exclusively with SQL statements
for DDL statements.
You can use "sp_helpconstra int" in Query Analyzer to verify the status
of the constraint.
can anyone tell me what i am missing? any advice on unsetting this attribute globally would be appreciated!
As long as you know which the foreign keys are, going like the code you
included should not be a problem.
--
Erland Sommarskog, SQL Server MVP, so****@algonet. se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp
first, obviously, i'm new to sql server. thanks for your advice so far.
you are correct, it was a refresh issue. unfortunately, i cannot find a
simple way to find the foreign keys that are set for replication. i
looked at the stored procedure you advised (sp_helpconstra int). it
appears to create a temp table and then query and join info and
eventually has a boolean value where if true is_for_replicat ion and
false not_for_replica tion.
this code is greek to me in my early stages of sql server
administration. is there a simpler way to locate the keys and columns
that are set is_for_replicat ion?
thanks in advance for any advice!!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Michael Reed (an*******@anon ymous.com) writes: first, obviously, i'm new to sql server.
If you find out how get the commands that EM runs, and run them
in Query Analyzer, you have come a long way compared to many other
SQL Server newbies!
this code is greek to me in my early stages of sql server administration. is there a simpler way to locate the keys and columns that are set is_for_replicat ion?
This SELECT lists all foreign key constraints that are set for replication,
and the parent table:
select tbl = object_name(par ent_obj), fk_name = name
from sysobjects
where xtype = 'F' and objectproperty( id, 'CnstIsNotRepl' ) = 0
order by tbl, fk_name
I don't know how many constraints you have. If you have only a handful,
you might be able to the rest manually. If you have hundreds of table,
you probably want a list of the columns in each FK. Since I'm lazy, and
I don't have a query ready for that right now, I don't include one. :-)
--
Erland Sommarskog, SQL Server MVP, so****@algonet. se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp
Erland
please re-post your last response. i can only see the summary. when i
click on the link, your post is nowhere to be found.
please re-post.
thanks!!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Heist |
last post by:
Hi, I just want to know to turn this:
CREATE TABLE . (
NOT NULL ,
(50) COLLATE French_CI_AS NULL ,
NOT NULL ,
(50) COLLATE French_CI_AS NOT NULL ,
NULL ,
NULL
) ON
into this:
|
by: bdjensen |
last post by:
Hello!
I have an MS SQL-server with an database, that runs replication. In this
database there is an table with an column
i want to extend; varchar(50)->varchar(60).
But I get this error (using design window of Enterprise Manager): Cannot
drop the table 'MytableName' because it is being used for replication.
Thanks for help
Bjoern
|
by: Andy |
last post by:
Hi All!
We are doing new development for SQL Server 2000 and also moving from
SQL 7.0 to SQL Server 2000.
What are cons and pros for using IDENTITY property as PK in SQL SERVER
2000?
Please, share your experience in using IDENTITY as PK .
|
by: dayong |
last post by:
i need to alter all foreign keys in my database and uncheck the
"Enforce relationship for replication" check box. Using the EM, I
extracted the code snippet below. unfortunately, when i run this test
from query analyzer, then go back into the EM, the box is still
checked.
can anyone tell me what i am missing? any advice on unsetting this
attribute globally would be appreciated!
BEGIN TRANSACTION
|
by: me |
last post by:
I would like to add an Identity to an existing column in a table using a
stored procedure then add records to the table and then remove the identity
after the records have been added or something similar.
here is a rough idea of what the stored procedure should do. (I do not know
the syntax to accomplish this can anyone help or explain this?
Thanks much,
CBL
| |
by: Marko Damaschke |
last post by:
Hello alltogether,
i'm working on a database-plattform which should work with
fail-over-technics.
Therefor 2 identic machines with internal RAID are available, which work
in single-host-netloadbalance on win2003-server.
Because of the internal RAID and caused by costs, a solution without
external SCSI-RAID and win2003-clustering-mechanism is looked for.
First i tried to use merge-replication but the rowguid-column, which is
added,...
|
by: Brian Wotherspoon |
last post by:
Hi all,
I'm using SQL Server 2000 SP3 to store data for real time transaction
processing.
I have set up replication to another server using a push subscription to
give me immediate backup.
I need to alter the data type of one of the columns and am using the
following basic sql:
|
by: Serge Rielau |
last post by:
Hi all,
Following Ian's passionate postings on problems with ALTOBJ and the
alter table wizard in the control center I'll try to explain how to use
ALTOBJ with this thread. I'm not going to get into the GUI because it is
hard to describe in text.
First of all what is the purpose of ALTOBJ()?
This procedure was created mostly for ISVs who need to do produce change
scripts to upgrade application from release to release, but it can also
|
by: miller.brettm |
last post by:
Hello,
I'm getting the following error message when I try add a row using a
Stored Procedure.
"The identity range managed by replication is full and must be updated
by a replication agent".
I read up on the subject and have tried the following solutions
according to MSDN without any luck.(http://support.Microsoft.com/kb/
|
by: Halfdood |
last post by:
I am working on a data migration project using a pre-made SQL 2005 database. We need to migrate data to over 300 different talbes and the records number 20 million plus for some of the tables.
We need to be able to insert values into multiple identity columns, so therefore SET IDENTITY_INSERT ON/OFF wont work.
We can't simply use the interface either as it means that a miss click or a moment of absent mindedness can cause a world of...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |