YAFLogo

cbadan
  • cbadan
  • 53% (Neutral)
  • YAF Forumling Topic Starter
14 years ago
Hi.

I got a new server some days ago and transfered all the database contents to the new server.

Then all the sudden i get this message:

[Exception: FILE:

mssql/views.sql

ERROR:

There is already an object named 'yaf_vaccess_null' in the database.

STATEMENT:

IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[yaf_vaccess_null]') AND OBJECTPROPERTY(id, N'IsView') = 1)

EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[yaf_vaccess_null]

WITH SCHEMABINDING

AS

select

a.UserID,

ForumID = convert(int,0),

AccessMaskID = convert(int,0),

GroupID = convert(int,0),

ReadAccess = convert(int,0),

PostAccess = convert(int,0),

ReplyAccess = convert(int,0),

PriorityAccess = convert(int,0),

PollAccess = convert(int,0),

VoteAccess = convert(int,0),

ModeratorAccess = convert(int,0),

EditAccess = convert(int,0),

DeleteAccess = convert(int,0),

UploadAccess = convert(int,0),

DownloadAccess = convert(int,0),

AdminGroup = convert(int,0)

from

[dbo].[yaf_User] a']

YAF.Classes.Data.DB.system_initialize_executescripts(String script, String scriptFile, Boolean useTransactions) +576

YAF.Install._default.ExecuteScript(String scriptFile, Boolean useTransactions) +240

YAF.Install._default.UpgradeDatabase(Boolean fullText) +79

YAF.Install._default.Wizard_NextButtonClick(Object sender, WizardNavigationEventArgs e) +976

System.Web.UI.WebControls.Wizard.OnNextButtonClick(WizardNavigationEventArgs e) +108

System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +418

System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +19

System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37

System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118

System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10

System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13

System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Anyone what might be wrong?

Sponsor
bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
14 years ago
Run manually

DROP VIEW yaf_vaccess_null

and see what happens.

cbadan
  • cbadan
  • 53% (Neutral)
  • YAF Forumling Topic Starter
14 years ago

Run manually

DROP VIEW yaf_vaccess_null

and see what happens.

bbobb wrote:

This is the output:


Msg 3705, Level 16, State 1, Line 1
Cannot use DROP VIEW with 'yaf_vaccess_null' because 'yaf_vaccess_null' is a table. Use DROP TABLE.

The problem is that, it's redirecting to /install/default.aspx all the time. Then im trying to go through the process and then it gives me the other output that i described before.

bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
14 years ago
And you've made DROP TABLE yaf_vaccess_null as it says to you...:?:

Thanks that you supplied us with all the info like your YAF has version, is it from svn, is it integrated and your DB engine version.

cbadan
  • cbadan
  • 53% (Neutral)
  • YAF Forumling Topic Starter
14 years ago

And you've made DROP TABLE yaf_vaccess_null as it says to you...:?:

Thanks that you supplied us with all the info like your YAF has version, is it from svn, is it integrated and your DB engine version.

bbobb wrote:

Server informations

Dot.net 3.5 SP1

Yaf version: 1.9.4 ( not the svn version ) and not integrated

MS SQL 2008 Dev. edition

Yeah, i did try that....then this happpens:


DROP TABLE dbo.yaf_vaccess_null 

Result:
Command(s) completed successfully.

And then i retry the install process:


FILE:
mssql/views.sql

ERROR:
There is already an object named 'yaf_vaccess_user' in the database.

STATEMENT:
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[yaf_vaccess_user]') AND OBJECTPROPERTY(id, N'IsView') = 1)
EXEC dbo.sp_executesql @statement = N'CREATE VIEW [dbo].[yaf_vaccess_user]
WITH SCHEMABINDING
AS
SELECT
b.UserID,
b.ForumID,
c.AccessMaskID,
GroupID = convert(int,0),
ReadAccess = convert(int,c.Flags & 1),
PostAccess = convert(int,c.Flags & 2),
ReplyAccess = convert(int,c.Flags & 4),
PriorityAccess = convert(int,c.Flags & 😎,
PollAccess = convert(int,c.Flags & 16),
VoteAccess = convert(int,c.Flags & 32),
ModeratorAccess = convert(int,c.Flags & 64),
EditAccess = convert(int,c.Flags & 128),
DeleteAccess = convert(int,c.Flags & 256),
UploadAccess = convert(int,c.Flags & 512),
DownloadAccess = convert(int,c.Flags & 1024),
AdminGroup = convert(int,0)
from
[dbo].[yaf_UserForum] b
INNER JOIN [dbo].[yaf_AccessMask] c on c.AccessMaskID=b.AccessMaskID' 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

This is basiclly what i've done:

1) Transfer ALL tables from 1 database server to another.

2) Tried the same asp.net files without any luck.

3) Fresh installed files, then i connect to the new database server, but it gives me the same error like the old files.

It seems like it skips "IF NOT EXISTS" and tried to create the tables again.

Underground
14 years ago
Just wondering about the process.

To transfer the database to another server, a good way to go is to backup the 'old' one and to restore it into another. Did you do that?

If not, I suggest you do it like that.

And if you have done it like that, you might want to check the default collation setting of the database server. It might be different from the old one.


My site containing the YAF forum: Globalcaching.eu 
cbadan
  • cbadan
  • 53% (Neutral)
  • YAF Forumling Topic Starter
14 years ago

Just wondering about the process.

To transfer the database to another server, a good way to go is to backup the 'old' one and to restore it into another. Did you do that?

If not, I suggest you do it like that.

And if you have done it like that, you might want to check the default collation setting of the database server. It might be different from the old one.

Underground wrote:

Usally i use Import/Export data that's included in MSSQL 2008...the same goes for this. I created a new database with the same name and imported all tables from the old server.

Maby I sould try the old fashion way with sql files in a query...

cbadan
  • cbadan
  • 53% (Neutral)
  • YAF Forumling Topic Starter
14 years ago
😲

Just wondering about the process.

To transfer the database to another server, a good way to go is to backup the 'old' one and to restore it into another. Did you do that?

If not, I suggest you do it like that.

And if you have done it like that, you might want to check the default collation setting of the database server. It might be different from the old one.

cbadan wrote:

Usally i use Import/Export data that's included in MSSQL 2008...the same goes for this. I created a new database with the same name and imported all tables from the old server.

Maby I sould try the old fashion way with sql files in a query...

Underground wrote:

Ok, so i fixed it by deleting all the old views one by one with Sql Server Management Studio :-D

It seems like some of the view´s may have some dependencies. 😲

centur
  • centur
  • 58.4% (Neutral)
  • YAF Camper
14 years ago
IMO "drop-if-exists" scripts should be added to install script. Dont know exactly does it will affect upgrade script, but if upgrade script is different than install - "drop-if-exists" is pretty good solution.

Something like this:


IF EXISTS (SELECT * FROM sysobjects WHERE Name = 'Employee')
   DROP TABLE Employee
GO
CREATE TABLE Employee blah-blah-blah
Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
14 years ago
SQL Server Data transfer has some big problems. One of them is the view transfer issue. It doesn't transfer a view. It creates a table that look exactly like the view and transfers all the records to the new table.

This is not a problem with YAF -- it's an issue you created when you used the MS Transfer tools. Another issue you'll probably encounter is that during the transfer none of the primary keys were kept on the tables.

Welcome to the crap that is MS SQL transfer.

The ONLY real way to transfer without having to know a ton of tricks (like I do, done it millions of times) -- is to just backup the whole DB and restore it.