Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

PortalWebHosting
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  SQL SPROC Update Script Erases Table Records?
Previous Previous
 
Next Next
New Post 5/12/2008 4:40 PM
User is offline Ryno
279 posts
9th Ranked




SQL SPROC Update Script Erases Table Records? 
Modified By Ryno  on 5/12/2008 7:40:36 PM)

I just pasted some script into the SQL page on my database to edit some existing stored procedures and it deleted all the records in the table.  I don't know why?  I lost a bunch of data by using ALTER procedure script like:

 

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

ALTER PROCEDURE [dbo].[AddAccess]

@UserID int, etc etc etc

Nowwhere was there an ALTER TABLE or anything like that.  Now I have to figure out if I can restore my table records somehow.  Anybody had this issue before?

 

 


I use DNN version 4.8.1
 
New Post 5/12/2008 5:35 PM
User is offline Scott Stokes
108 posts
www.adverageous.com
9th Ranked


Re: SQL SPROC Update Script Erases Table Records? 

"DROP TABLE" is what you would need to look for, in the scripts you ran, in order to figure which tables were killed.

I never did understand why there would ever be a DROP TABLE statement in a modules' SQL install scripts.

Personally I prefer table creation blocks structured like this:

IF NOT EXISTS (SELECT * FROM {databaseOwner}SYSOBJECTS WHERE id = object_id(N'{databaseOwner}[{objectQualifier}AdverExpContentTypes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
BEGIN
CREATE TABLE {databaseOwner}[{objectQualifier}AdverExpContentTypes] (
 [ID] int IDENTITY ( 1,1 ) NOT NULL,
 [Extension] nvarchar(50) NULL,
 [ContentType] nvarchar(100) NULL
)

ALTER TABLE {databaseOwner}[{objectQualifier}AdverExpContentTypes] WITH NOCHECK ADD
 CONSTRAINT [{objectQualifier}PK_AdverExpContentTypes] PRIMARY KEY CLUSTERED
 (
  [ID]
 )  ON [PRIMARY]
END
GO

 

 
New Post 5/12/2008 5:43 PM
User is offline Ryno
279 posts
9th Ranked




Re: SQL SPROC Update Script Erases Table Records? 

The word TABLE wasn't in the script at all.  It was just a string of ALTER PROCEDURES to change the SPROCS.  I ALTERed the SPROC that would delete records but didn't call that SPROC.  I don't get it.


I use DNN version 4.8.1
 
New Post 5/13/2008 6:04 PM
User is offline Ryno
279 posts
9th Ranked




Re: SQL SPROC Update Script Erases Table Records? 

Ok, there was no issue.  I don't know why my SELECT statement wasn't pulling up any data from the DNN page but that's what led me to believe the records were gone.  I loaded up SQL Manager and connected to my database and found all the data was there like it should be.  I tweaked the database structure and all is good.

Nothing to see here, move along.


I use DNN version 4.8.1
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  SQL SPROC Update Script Erases Table Records?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Icthus Technologies
Building Faith on the Internet
www.icthustech.com
Efficion Consulting
A premier DotNetNuke consulting firm providing complete DNN services including: custom module development, skinning and design, installation and integration services.
www.efficionconsulting.com
DotNetNuke Training by Engage Software
Specializing in customized training, architecture and module solutions for large scale implementations lead by DNN Core Team Member Christopher Hammond.
engagesoftware.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP