Views Are Deleted

Jul 23, 2005

I am runnnig Microsoft SQL Server 2000 and have a database that gets
downloaded everymorning from an ftp site. This download contains the
new records and any changes to existing records. However I am running
into a problem in that I am forced to recreate the views over everytime
we replace the new database with the old one. I've tried restoring the
database as well as replacing it and am not sure what I am missing. I
am new to SQL Server and any help would be greatly appreciated.

View 4 Replies


ADVERTISEMENT

Are Embedded Views (Views Within Views...) Evil And If So Why?

Apr 3, 2006

Fellow database developers,I would like to draw on your experience with views. I have a databasethat includes many views. Sometimes, views contains other views, andthose views in turn may contain views. In fact, I have some views inmy database that are a product of nested views of up to 6 levels deep!The reason we did this was.1. Object-oriented in nature. Makes it easy to work with them.2. Changing an underlying view (adding new fields, removing etc),automatically the higher up views inherit this new information. Thismake maintenance very easy.3. These nested views are only ever used for the reporting side of ourapplication, not for the day-to-day database use by the application.We use Crystal Reports and Crystal is smart enough (can't believe Ijust said that about Crystal) to only pull back the fields that arebeing accessed by the report. In other words, Crystal will issue aSelect field1, field2, field3 from ReportingView Where .... eventhough "ReportingView" contains a long list of fields.Problems I can see.1. Parent views generally use "Select * From childview". This meansthat we have to execute a "sp_refreshview" command against all viewswhenever child views are altered.2. Parent views return a lot of information that isn't necessarilyused.3. Makes it harder to track down exactly where the information iscoming from. You have to drill right through to the child view to seethe raw table joins etc.Does anyone have any comments on this database design? I would love tohear your opinions and tales from the trenches.Best regards,Rod.

View 15 Replies View Related

Large Views Vs Multiple Small Views

Sep 6, 2007

Which is more efficient? One large view that joins >=10 tables, or a few smaller views that join only the tables needed for individual pages?

View 1 Replies View Related

Recompiling Views That Reference Other Views

Jun 28, 2007

Hello.

Newbie here. I've only been using SQL for about a year now and have some minor questions about sql objects that reference other objects.



We have some views which reference other views in the joins. I will call one the primary view and the one being referenced in the joins as the secondary view.

Recently we made changes to the secondary view.

After which the primary views which referenced it would not work because of this change and had to be 'refreshed' by using drop/create scripts which essentially just dropped it and recreated the exact same view. I do not recall the exact error message that was returned other than it seemed to suggest that it could no longer see the secondary view since it had been changed. Nothing in the primary view was changed in any way, just the secondary.



Some here where I work have suggested off hand that this was a recompile of the primary view because the contents of the secondary changed.

My questions are:

1. Exactly why did this happen and is there a proper name for it when it does?

2. The same problem does not seem to occur when we have stored procedures referencing views in the joins which had just been changed. Why is that?



Thanks for any help on the matter. I greatly appreciate it.

View 3 Replies View Related

Quicky : Views Of Views Of Views

Feb 22, 2007

Hello,

to make a report easier I'm developing it using a view of joined views of joined views.

Is there any significant performance penalty as opposed to just having one big select?

Cheers.

View 1 Replies View Related

Views Dependent On Other Views

Mar 14, 2006

Hello There,I'm trying to create a view that has calculations dependent oncalculations, where the problem resides is that each time I make acalculation I must create an intermediate view so I can reference aprevious calculation.for example lets say I have my_table that has columns a & b. now I wanta view that has a & b, c = a + b, and d = c + 1.this is grossly simplified, the calculations I actually use are fairlycomplex and copying / pasting them is out of the question.so what I have is my_view_a which makes column c, and my my_view_finalwhich makes column d (however, in my real application I have 5 of theseviews, a/b/c/d/e/)is there anyway I can consolidate all these views into one? I wasthinking of using a stored procedure with temp tables or somethingalong those lines.I just which I can use the aliases that I create for c in d in onestep.any insight would be greatly appreciated.

View 5 Replies View Related

URGENT - My DB Has Been Deleted

Sep 27, 2007

I just did the dumbest thing ever. I think I have lost my database. i was trying to attach a different db with the same name. but it wasnt able to attach so the i renamed my current db and attached the new db.i dont know what has happened but my old db has been deleted and i cant find it the mdf file for it.... that has been removed for the directory it was in too!!  I was using MS SQL Server Managemnent Studio  can I undo this somehow?? PLEASE HELP 

View 14 Replies View Related

To Know Who Deleted The Database

Dec 11, 2000

Is it possible to know that who has deleted the database

Thanks in advance

View 2 Replies View Related

Deleted Database

Jan 21, 2005

Our past CIO deleted a SQL Server database because he didn't know what it was or if we needed it. Guess what we do! We were able to undelete the backup files but when we try to restore from it we get the error "No a valid backup" Any ideas?

Thank you for any help. :eek:

View 2 Replies View Related

Backups Not Deleted.

Jul 25, 2006

I am running sql server 2000 on windows 2000. i have my backups set to delete after a week. they are not deleting, can anyone tell me why this is happening?? the backups filled the hard drive.

View 3 Replies View Related

Deleted Mdf File

Sep 20, 2007

I am currently trying to recover a data base that i detached. I have search the computer with *.mdf with out results...

I detached the database from msde 2000 and then installed sql express now when i go to attach the db it is missing, is there away i can recover the db?

View 8 Replies View Related

Deleted Data

Apr 18, 2007

Is there anyway to retreive deleted data (rows) of a table? Unfortunately the backups are corrupt so we can't do a restore.
Thanks

View 12 Replies View Related

Deleted Packages..??

May 18, 2007

Hi,
I accidentaly deleted a package while working on it, intention was to delete another package just above it in solution explorer but the one i was working on got deleted, is there any way to retrieve it...??

any suggestion wud be appreciated.

thanks,
ravi

Nothing much that i can do..!!

View 5 Replies View Related

Help - Recovering A Deleted Job

Jul 20, 2005

Any ideas how I can recover a job that has been deleted (?) from SQL7.0 ? We had one which was used on a regular basis which has nowceased to exists. I've spoken to the people responsible for the serverand was met by blank faces (as usual). They have no idea when it wasdeleted, by whom or when. To make matters worse, they don't think theycan get it off the backup set without a major bit of work to theserver. Suprisingly, none of the users noticed that things had stoppedworking.Unfortunately, I needed to do some work on this in preparation for mymonthly meeting with my boss on Monday. Whilst I'm not to blame, I'dlike to understand a little more about any options available to us forrecovery as he will undoubtedly ask when he finds out.I have an old back up on another server, so it's not the end of theworld re-creating it, but I was under the impression it was backed upproperly. Is this normal or have they missed something ?Are there any ways I can recover this ? What can I get done to thebackup to make sure this is backed up properly ?Thanks in advance.Ryan

View 1 Replies View Related

Relationships Getting Deleted (MS SQL)

Jul 20, 2005

Dear All,I got a wierd problem which I haven't been able to explain.I am working on MS SQL 2000. I don't know for what reason, therelationship between Parent/Child table is getting deleted. When Iopen up the ER diagram in MSSQL Enterprise Manager, I see therelationship line come up for just a split of a second, and disappearsafterwards. This is the second time I am seeing this thing.I realized it when I accidently deleted the rows in the Parent Table.They should not have been deleted as I had associated records in theChild Table (because of Key Constraints).Has anyone ever come across this situation? Do you have anysuggestions?Regards,TinTin

View 1 Replies View Related

Mastlog.ldf Deleted

Feb 5, 2008

hi,

I have deleted the mastlog.ldf file how can I restore it?

thanks

View 14 Replies View Related

How To See Who Deleted Rows

Feb 1, 2008



5 accounts have access to database, is it possible to see or log who deleted any records?

Thank you

View 4 Replies View Related

Records Don't Get Deleted From The Database!

Sep 17, 2007

I am using this code to delete records from a table in the database that has two fields (both are primary keys) I am not getting any error, but nothing gets deleted. Thanks for the help.
Code:protected void btnRemove_Click(object sender, EventArgs e)
{
 
Remove();Response.Redirect("RegisteredCompanies.aspx");
 
}protected void Remove()
{
//update database with filename
//Save Changes
connection.Open();using (SqlTransaction trans = connection.BeginTransaction())
{
try
{ SqlHelper.ExecuteNonQuery(trans, CommandType.StoredProcedure, "spRemoveCompany", new SqlParameter("@Userid", getGdUserID(Profile.UserName)),new SqlParameter("@BusinessID", getBusinessID());
}catch (Exception err)
{
// throw exception
trans.Rollback();
 lblStatus.Text = "An error has occurred in the delete process. Please try again.";
}
}
 Here is the stored procedure:ALTER PROCEDURE [dbo].[spRemoveCompany]
 
 
@Userid uniqueidentifier OUTPUT,
@BusinessID uniqueidentifier OUTPUT
 
 
 
ASDELETE FROM Associations2 WHERE Userid = @Userid AND BusinessID = @BusinessID
 
RETURN

View 4 Replies View Related

Reuse Deleted Primary Key Id

Dec 15, 2007

Hello,          Can I reuse the deleted primary key id? I'm using SQLServer2005. cheers,imperialx   

View 6 Replies View Related

Inserted/deleted Table.

Mar 4, 2004

Hi,

I am currently working on a MS SQL server 2000.

I would like to access the data inserted or deleted within a trigger. however the built-in tables -- inserted and deleted --- are not accessible. anyone knows why? And is there any other way to do this?

Thanks

View 1 Replies View Related

Deleted Default DB, Need Hlp Fast!

Mar 27, 2004

I have stoopidly enough deleted default Db. That causes Enterprise Manager to be unable to work with my DB's. The default DB I deleted had no other functions other then being default DB, I mean it was outdated, and I had other DB's that contained all my importent work. They are still running, and I can view DB driven site hosted at localhost, even though default DB no longer excist. I am even able to upload new content, or add new users, so this means all my other DB's are fine. I can even see SQL server icon in my bottom right corner of my desktop, and it shows server running.

Now I am in the need of adding tables and rework some of my excisting tables and stored procedures, but I am not able to do that with Enterprise Manager, due to the lack of default Database.

How do I correct this problem? I have gotten one tip of doing the following: EXEC sp_defaultdb 'User', 'DB' but I am not sure what to do with this.....tried to run it from command line, and put my username and the DB I would set to default but nothing happend.

So I need more details, step-by-step guiding will work, as I don't know a hole lot about Enterprise Manager and SQL.

Btw, this is my error in Enterpr.Managr:

A connection could not be established to MyComputerVSDOTNET2003

Reason: Cannot open default database. Login failed..

Please verify SQL server is running and check your SQL server registration prpoerties and try again

Pls tell me there is a way to fix this problem.

View 6 Replies View Related

Retrieve Deleted Table

Dec 6, 2004

hi there,

by mistake i deleted tables in the DB, i heard once that there is a way to retireve it after it has deleted, from the temp or something like that

so is there a way?

Thanks

View 1 Replies View Related

#deleted# In Access97 From SQL7

Mar 12, 1999

When I try to link tables from Access97 to SQL7, all the columns have #deleted# in them. Does any one know why this is?

Thanks

Phil

View 3 Replies View Related

Recover Deleted Records

Mar 22, 2005

I want to know what to do to recover the deleted records on a specific table. Unfortunately, the dba was unable to activate Trace feature and I am not familiar in using the transaction logs to retrieve data.

please help. :confused:

View 4 Replies View Related

Alert Deleted But Still Firing

Mar 28, 2006

I created an alert (18453) to audit successful logins. After I was done with the alert I made I edited the alert 18453 to disable event log logging and then deleted the alert. My problem is that the alert is deleted but it continues to log to the SQL Server error log and the windows application log. I have tried restarting the SQL Server Agent and even had the server rebooted over the weekend. Has anyone else had this problem? Where is this configured and how can I disable it?

View 2 Replies View Related

Transaciton File Deleted

Apr 1, 2002

Hi All
The problem is

The transaction file of Database got deleted.So Sql server shows the Db as suspect.Unfortunately also do not have latest bk up copy of DB.
I tried creating dummy log file with same name and placing it in same location but that did not help.
I wud highly appreciate if someone cud suggest a soln quickly.

Warm Regards
Jignesh

View 1 Replies View Related

Restoring Deleted Records

Sep 21, 2001

Does anybody know if SQL 2000 has a tool to roll back (udelete) records?
Let's say Payroll dept deletes 500 records by mistake...
I know of 2 products that do that (Computer Assoc. - Unicenter Log Analyzer
and Red Matrix Techmologies' SQL Audit 1.7 - but I have never used them. Any comments? Thanks for your help.

View 2 Replies View Related

How To Recover All Deleted Records

Feb 20, 2005

Hi everyone

Is there any way to recover all deleted records.

By mistakes i deleted all records.

Please help me out

Waiting for reply.

Thanx in advance

View 2 Replies View Related

Subscription Data Are Deleted...

Nov 8, 2005

Subscription data are deleted...

We've got a merge replication. I have one Publisher and one Subscriber. I've made a pull subscription to a Publisher.

I've got into trouble few times occasionally 3-4 times a year. Today also I got problem with one table only one row among so many not carried out on at subscriber, even it is not find out at publisher.

This row was entered at subscriber in the morning, printed by users but in evening report it is not coming down in reports, so I had checkup and find out it is not available at any server. How?

I don’t understand, how inserted, printed data erase from subscriber but rarely. Is there any clue?

Which parameter of the subscription is responsible for it ?

Best regards.

View 2 Replies View Related

Possible To Tell Who Deleted Records In My SQL Table?

Dec 12, 2005

Hello All.

Is there a way to check who has deleted records from my SQL tables? I asked because I notice records keep disappearing from my tables recently for no reason. The DB is only accessible by a few IT staff. Business users have no direct access to it so they can't do any harm and there is no application that update these record missing tables.

I don't need to know the exact records that have been removed. I need info on who has made a deletion activity on which table, date and time is good enough.

Thank you.

Best regards

View 5 Replies View Related

Old, Deleted Identity Values Re-used?

Dec 28, 2005

If I have an Identity-declared column, the table has lots of rows and I start deleteting records - will any old, deleted identities be re-used (without an explicit re-seed) ?

(I'm talking about numerical Identities, not these GUID things)

View 2 Replies View Related

Get Number Of Rows Deleted

Feb 1, 2006

How do we get the number of rows deleted from a table?

@@rowcount is returning 0

View 2 Replies View Related

How To Restore The Deleted Records?

May 14, 2006

Hi,
Plz help me to restore deleted records.Pl zsuggest the ways to do it.
Thanks!!

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved