Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS SQL Server
 DTS Problem (was Duplicte Constraint in setup.asp)
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Podge
Support Moderator

Ireland
3775 Posts

Posted - 20 August 2005 :  13:37:57  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
I'm using v3405 and trying to install two forums using different table prefixes setup in config.asp

While installing the second forum I get an error that a contraint cannot be added because the "contraint SNITZ_373" already exists in the database.

I did a response.write of all the sql in setup.asp and found the offending statement -

CREATE TABLE SNITZ2_ALLOWED_MEMBERS (MEMBER_ID INT NOT NULL, FORUM_ID INT NOT NULL, CONSTRAINT SNITZ2_SnitzC373 PRIMARY KEY NONCLUSTERED (MEMBER_ID, FORUM_ID) )

The only other reference to a constraint with the same (almost) name is this sql statement

CREATE TABLE SNITZ2_MEMBERS ( MEMBER_ID int IDENTITY (1, 1) NOT NULL , M_STATUS smallint NULL , M_NAME nvarchar (75) NULL
 DEFAULT '' , M_USERNAME nvarchar (150) NULL DEFAULT '' , M_PASSWORD nvarchar (65) NULL DEFAULT '' , M_EMAIL nvarchar (50) NULL
 DEFAULT '' , M_COUNTRY nvarchar (50) NULL DEFAULT '' , M_HOMEPAGE nvarchar (255) NULL DEFAULT '' , M_SIG ntext NULL DEFAULT '' ,
 M_VIEW_SIG smallint NULL DEFAULT 1 , M_SIG_DEFAULT smallint NULL DEFAULT 1 , M_DEFAULT_VIEW int NULL , M_LEVEL smallint NULL ,
 M_AIM nvarchar (150) NULL DEFAULT '' , M_ICQ nvarchar (150) NULL DEFAULT '' , M_MSN nvarchar (150) NULL DEFAULT '' , M_YAHOO
 nvarchar (150) NULL DEFAULT '' , M_POSTS int NULL DEFAULT '0' , M_DATE nvarchar (14) NULL , M_LASTHEREDATE nvarchar (14) NULL
 DEFAULT '' , M_LASTPOSTDATE nvarchar (14) NULL DEFAULT '' , M_TITLE nvarchar (50) NULL DEFAULT '' , M_SUBSCRIPTION smallint
 NULL , M_HIDE_EMAIL smallint NULL , M_RECEIVE_EMAIL smallint NULL , M_LAST_IP nvarchar (15) NULL , M_IP nvarchar (15) NULL ,
 M_FIRSTNAME nvarchar (100) NULL CONSTRAINT SNITZ2_SnitzC0369 DEFAULT '' ,M_LASTNAME nvarchar (100) NULL CONSTRAINT
 SNITZ2_SnitzC0370 DEFAULT '' ,M_OCCUPATION nvarchar (255) NULL CONSTRAINT SNITZ2_SnitzC0371 DEFAULT '' ,M_SEX nvarchar (50) NULL
 CONSTRAINT SNITZ2_SnitzC0372 DEFAULT '' , M_AGE nvarchar (10) NULL CONSTRAINT SNITZ2_SnitzC0373 DEFAULT '' ,
 M_DOB nvarchar (8) NULL DEFAULT '' , M_HOBBIES ntext NULL DEFAULT '' , M_LNEWS ntext NULL DEFAULT '' , M_QUOTE ntext NULL
 DEFAULT '' , M_BIO ntext NULL DEFAULT '' , M_MARSTATUS nvarchar (100) NULL CONSTRAINT SNITZ2_SnitzC0374 DEFAULT '' ,M_LINK1
 nvarchar (255) NULL CONSTRAINT SNITZ2_SnitzC0375 DEFAULT '' ,M_LINK2 nvarchar (255) NULL CONSTRAINT SNITZ2_SnitzC0376
 DEFAULT '' , M_CITY nvarchar (100) NULL CONSTRAINT SNITZ2_SnitzC0377 DEFAULT '' , M_STATE nvarchar (100) NULL CONSTRAINT
 SNITZ2_SnitzC0379 DEFAULT '' , M_PHOTO_URL nvarchar (255) NULL CONSTRAINT SNITZ2_SnitzC0378 DEFAULT '' , M_KEY nvarchar (32)
 NULL DEFAULT '' , M_NEWEMAIL nvarchar (50) NULL DEFAULT '' , M_PWKEY nvarchar (32) NULL DEFAULT '' , M_SHA256 smallint NULL
 DEFAULT '1' )


Anyone have an idea what is going on here?

Can I safely rename one of the constraints? I presume it doesn't matter what its called as long as its created?

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.

Edited by - Podge on 22 August 2005 11:58:05

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 August 2005 :  13:47:03  Show Profile  Visit HuwR's Homepage
yes you an safely rename them, however "CONSTRAINT SNITZ2_SnitzC373" is not the actually the same as "CONSTRAINT SNITZ2_SnitzC0373" and are not the same as "contraint SNITZ_373" which is the error reported


it looks to me like the prefix is not being added correctly somewhere in the setup code
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 20 August 2005 :  14:03:29  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
quote:
yes you an safely rename them


Thanks HuwR. That answers my question.

I'm aware of the differences in the constraint names but I'm 100% positive that the prefix is there in the sql statement being executed.
I'll do some more investigating and post my finding here.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 August 2005 :  14:37:15  Show Profile  Visit HuwR's Homepage
"contraint SNITZ_373" can not be created by the Snitz setup, all the constraints in Snitz are of the form

strTablePrefix + "SnitzCXXX" or in the case of members and members_pending is strMemberTableprefix + "SnitzCXXX"
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 20 August 2005 :  14:55:19  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
I wrote that line from memory, it isn't exactly as was stated.

I figured out what the error was and yes it was my code (although in my defence some guy in Microsoft wrote the example I based it on). I'm using dotnet & DTS via interop to create two forum schemas (with different prefixes) then copy all data from two different forums. The creation of the tables & constraints were not the problem it was dts copying all objects when it should only be copying data. Fixed it though and am now working on the next problem - how to force garbage collection instantly.

Thanks for the help HuwR.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 August 2005 :  14:57:34  Show Profile  Visit HuwR's Homepage
no probs
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 22 August 2005 :  12:05:52  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
hmmm...

Got DTS working and ran it a few times so that it automatically copied the tables to the destination database. Worked great until it just hung on one database half way through for no reason. No error reported or anything. This, coupled with the fact that its very slow means that I'm looking for another way to copy data from one database to another (same schema for both source and destination databases).

Is it as simple as writing a script which will iterate through every row of every table in the source database and insert them into the destination database? I can't help feeling that there will be problems with identity columns or something else I'm missing. I have to do this programmatically as to do it manually would take forever as there are thousands of databases. Any other ideas?

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07