SP And Views And Restoring
May 28, 1999Can I and how do I restore just a Stored procedure and View from a database backup?
Thanks.
Can I and how do I restore just a Stored procedure and View from a database backup?
Thanks.
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 RelatedI did a full backup of a db from one server(Express2005) and trying to restore it to a different instance of SQL2005 on the same development machine. (Also had some fulltext columns if that means anything)
Many failures but finally got it to report all was successful except the icon in Object Explorer shows (Restoring...) with no indication of any real activity going on. It's a tiny database with hardly any data in it.
Just not sure what the heck is going on there. It also won't let me into the database until this the (Restoring...) goes away.
Any advice on how to get this thing finished out?
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 RelatedHello.
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.
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.
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 RelatedHi, I am restoring a database as a complete step. The database icon, under the Sql server Group in the Sql server enterprise manager, turned into gray and got a word (loading) infront of the database name, what does that means?
Ali
I am just curious to know whether it's possible to restore a SQL 6.5 DB from a DB device file. For e.g. i have a device file abc.dat which contains a db. Now thru this device file can i restore the data on xyz database.
View 3 Replies View RelatedHi All,
I'm trying to restore a database to a completely new database from an exsiting full backup.
On the backup device there are two full backups from different dates.
How can I specify which one of the two backups I want use for my restore (The only difference is the date ??
Thanks,
I had SQL win2k running on a machine and had 2 dbs. unfortunately the hard drive failed (ntldr crashed). i was able to copy the contents of from the old drive (so i have the DB files) but no backups.
Is there any way to import this data into a new DB?
Can you restore a backup (bak) file to a different server? E.g. client gets server nicked, they have bak files, can I run a restore to my sql server?
I can see the with MOVE option, but I can't see how to attach (to the new server) if the database wasn't detached (from the nicked server).
i am getting the following error when i try and restore a datbase
The log in this backup set begins at LSN 110000000011300001, which is too late to apply to the database. An earlier log backup that includes LSN 102000000188100001 can be restored..
while iam restoring my back up i got this error message
Msg 3117, Level 16, State 1, Procedure res, Line 26
The log or differential backup cannot be restored because no files are ready to rollforward.
Msg 3013, Level 16, State 1, Procedure res, Line 26
RESTORE DATABASE is terminating abnormally.
Hey all.Can anyone point me in the general direction of documentation whichwould tell me how to restore a DB via the command line instead of usingenterprise manager?ThanksMatt
View 2 Replies View RelatedHi all,I have a very old MSSQL data backup file.I do not even remember that it was created in SQL7 or 2000.Anyway, I'm trying to recreate DB from this backup.Is it possible to create DB from backup file?I tried restore from that file and SQL server complaining."The file on device '***' is not valid Microsoft tape format backup set."Thanks-Jay
View 2 Replies View RelatedHi there,
I've got a .mdf/.ldf database/log. I'm trying to bring it into SQL Server Management studio, but can't figure out how. I've gotten as far as "Attaching" it, but can't figure out where to go from there. Can anyone help me out. I know this is very basic.
Thanks.
Hi,
I have created a DB on my local machine.
Now I would like to copy this on to another machine.
I stopped the service and then copied both the MDF file and the
log files into the same folder as in Data folder of the second machine.
When I run theStudio express I cannot find the MDF file.It does not show up in the
the DB folder or window.
When I try to create one it says that the DB exists.
What am I missing?
I tried doing a backup and restore but then the DB is not created on the second machine and
hence wont work.
Tnx
i have sql server 2005 dev installed on a laptop. i have 2 .bak's from production sql server 2005 database. i went through the gui restore procedure and both backup files completed successfully. now both databases are in the (Restoring...) status and have been for quite some time. i have sp2 applied. when will these become available? each .bak was around 400 mb. it has been a few hours.
View 8 Replies View RelatedWhen i try to restore my back up i got this error: Solution?
View 2 Replies View RelatedHi,I'm new to sql but have a website running it on a hosted site. I want to have a local copy of the site running here for testing. I have everything set on my local machine to run it including MSDE and Enterprise Mgr.I've created a blank db with the same name,username and password on my local machine. From my host I received a dbname.bak file which they said I should just restore to my local machine. This sounded simple but I have no idea how to do this. When I right click on the db file within Ent.Mgr I see the Restore option but I can figure out how to designate the dbname.bak file as the source. I also see an option to import but that isn't any better.Does anyone have some simple directions which will show me the proper steps and where I should be to do this? I'd really appreciate it. I assume it's simple but not having ever done it it has me stumped.Thanks!
View 11 Replies View RelatedHi,
I am trying to restore SQL7 DB from the Network M/C,here is the Procedure i am following
i have backup file on ABCsqlbackup where ABC is M/c Name on the network
from my Server i mapped ABCsqlbackup to the I drive
then from enterprise magager i tried to restore DB and i gave path as I:xyz.bak
for backup device location where xyz.bak is backup file name.
when i tried to restore like this it is giving error "unable to verify backup file location"
and i checked in SQL server logs i found that message like..
"Unable to open Backup Device I:xyz.bak Failed to open.Operating system error,Unknown user name or bad password"
and that Sqlbackup directory is shared and it has full access to everyone.
Can anybody tell me how to restore from the Network, and where i am doing wrong.
Thanks in Advance
Mark
1) We have got the database dump (.bak) file in one machine and we need to restore this to another machine where the SQL server (version 7) is running. But in the restore option there is no way to choose any mapped or shared drives in remote machine. Any pointer to resolve this problem?
2) Can you set up a database if you have the .mdf and .ldf files?
I am running SQL 7 on two seperate NT4 servers, a production server and a standby server. Both servers are configured for Mixed Mode authentication. If I back up a database on the production server, do I also need to back up the master database and restore it. My reasoning behind this is that users' login details will be held in the sysxlogins tbl in the master, while their access rights will be held in the sysusers tbl in the database I am backing up and restoring. If I back up and restore a database without backing up and restoring the master db as well, will the connection between the system login and the database user be broken.
Any comments/suggestions would be appreciated.
"Restore Now" button is greyed out after choosing to "Add File". I know I've done this before, can't figure out the problem.
View 1 Replies View RelatedHi, i've struggled in the past to get ms sql 7 db's from one server to another server and always end up getting frustrated. I usually just export and then import..... more work but it does the trick.
Now i've been sent one single db data file that i'm told is a backup copy of someones database. How do i get this loaded onto my server. I've tried restoring from this file but it complains that the backup file is not for the database i'm restoring to.... which is correct.... this has to be something that many people deal with? isn't it?
Can someone please help me out.... some pointers would be much appreciated.
Thanks in advance,
Mark.
I am fairly new to SQL Server and have a question about restoring a database . If a server that contained SQL Server was totally destroyed, and we have backups stored on an external server, how do we restore these backups. I am assuming I would have to install a new instance on the server we buy to replace the destroyed one. Once installed how do I convince or tell SQL Server that there are backups out there. I could move the archived backups back to the new server, but how do I point the new instance of SQL Server to these backups? Thanks in advance for any help.
View 1 Replies View RelatedHi !
I have one crashed database !
I have no dumps at all !
I have cold backup of the data files !!
Is it possible to just restore the datafiles and everything`s nice again ??
This is ugrent matter, I am trying to restore master database and it fails and the error message was the database must be in a single user mode. I went the master database properites and the single user mode is grey out, what can I do now? Any suggestion is welocme with very ugrent matter.
Regards,
Hi there...
can any one help in following situation.
Suppose in a network I have two sql server ABC and XYZ and XXX (NT server) on same sub net.
1) I take a backup from server ABC on XXX (NT).(ie.. backup on network)
2) Can I restore database in XYZ which was backed up by ABC? How???
3) Suppose My ABC machines fails and I have to again install SQL Server 7 on it, will I be able to restore database from XXX(NT)? how???
regards,
zak
HI everybody,
I have a problem in restoring a backup. In the restore command there is one option called <file> = 'file_number'. Where do we get this 'file_number'?.
tks in advance
Srini
Trying to restore a backup database from another SQL 7.0 and get the error: this backup sort ID is different from the current server sort ID, cannot restore. Question: Where can we change our sort ID so that it matches? Or is this the wrong approach?
View 1 Replies View RelatedCurrently have large database in three devices, named Cabinet cab2 and cab3. Cab3 device has been expanded twice. We are upgrading the hardware and would like to get the database into one device named cabinet and clean the mess up our vendor initially created for us. Any Ideas/steps on how this could be accomplished??? TKS Jerry
View 2 Replies View Related