|
Do you mean you want to overwrite the data of db1 database with that of db2.
Thanking you in Advance
Regards
Pratik Shah
|
|
|
|
|
|
Hi,
Since you already have the backup of db1 (assumed, as said by you) you can just drop the database db1 and restore the data of db2 in a new database and give the dbname as db1. (This can be done using the Enterprise Manager in SQL 2000).
Kind regards
PS
Thanking you in Advance
Regards
Pratik Shah
|
|
|
|
|
I assume you want to copy everything from db2 to db1.
1. Backup db2.
2. Right click db1, go to All Task/Restore Database..
3. Check "FROM Device".
4. Select the device by click on button "Select Devices".
5. Add the backup file that you backup from db2. Click button "OK".
6. Go to tab "Option". Change the physical file name to db1.mdf and db1.ldf.
7. Check option "Force restore over existing database".
8. You should know how to continue now.
btw, please check Management/Current Activity/Process Info to make sure no connection is connected to db1.
Eliz.K
www.oin1.com
|
|
|
|
|
I need some advice on replication...
I set up a new push-subscription on my server, when I change the data (which should then be replicated) the server reports "No replicated transactions available"
In my Replication Monitor the changes are noted under the "Publisher to Distributor History" but still it reports the above message upon synchronization.
Why could this be?
_______________________________________________________________________
http://www.readytogiveup.com/[ ^]
"you can't forget something you never knew..." M. Du Toit
|
|
|
|
|
This problem occurs when SQL replication goes KooKoo, typically after a database restore.
The quickest (and probably only) fix is to remove all the Publications and start from scratch.
Search SQL Server 2005 Books Online for "Removing Replication"
_______________________________________________________________________
http://www.readytogiveup.com/[ ^]
"you can't forget something you never knew..." M. Du Toit
|
|
|
|
|
Hi
HOw to create Backup of database using query for a fixed time?
I do not want to use Wizard.
plz help as soon as possible.
Thanks
|
|
|
|
|
This will create a backup:
BACKUP DATABASE pubs TO DISK = N'c:\temp\pubs.bak'
but I have no idea if that's what you need, since I don't know what you mean by 'for a fixed time'. Could you explain?
|
|
|
|
|
Thnks for replay
BACKUP DATABASE Parikrama TO DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\SQLSpyNetJob.bak'
WITH NOINIT, NOSKIP, STATS = 10
can anyone tell wht is the meaning of STATS =10 in above query.
And plz tell me i want query tht taking automatically bacup of database with in interval0f 10-10 minutes by job scheduler .
Thanks
|
|
|
|
|
Care Career wrote: database
SQL Server Books On Line[^] are your friend. That means with statistics update based on a 10% sample of the data.
Creating a backup every 10 minutes is only likely to work for a very small database, as backup can take more time than this. Creating a job to do this on a scheduled interval takes more than one query, and is best done using the database maintenance wizard. It is possible manually, but the procedure is more lengthy than can be described here. Use the reference I have provided, and look up SQL Server Agent tasks, or Database maintenance.
|
|
|
|
|
thnx lot
Can u tell how to start Sql server agent?
1069 logon faliure error is coming when i start sql server agent.
Thnx
|
|
|
|
|
|
Rob Graham wrote: That means with statistics update based on a 10% sample of the data.
Are you sure?
This is what I found:
STATS [ = percentage ]
Displays a message each time another percentage completes, and is used to gauge progress. If percentage is omitted, SQL Server displays a message after each 10 percent is completed.
The STATS option reports the percentage complete as of the threshold for reporting the next interval. This is at approximately the specified percentage; for example, with STATS=10, if the amount completed is 40 percent, the option might display 43 percent. For large backup sets, this is not a problem, because the percentage complete moves very slowly between completed I/O calls.
|
|
|
|
|
hi,
i want to know that whether or not reportviewer control support subscript & superscript ?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Rupesh Kumar Swami wrote: reportviewer control support subscript & superscript ?
Have you actually tried it?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
hi paul,
i tried , but up till now i have no result found. i also try for crystalreport viewer but in CrystalReportViewer case i am sure that it does not support subscript & superscript.
have you any idea about superscript & subscript in Microsoft Reporting service related to VS.NET 2005(ReportViewer control)?if yes , please guide me or send any link.
Thanks in advance.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
hello
i have a database where i get links out off for images standard is 1 image per page but sometimes i want to load multible images on to a page without changing the page everytime i have got 1 asp page were can load aal of the record from the database from i want to add a script thats checking if the is a link for second image availeble if it's there then that he show it if not he does nothing. i think it a true or false script but i dont know how toe work it out
cool349
|
|
|
|
|
From your description, I'm not 100% sure what you are trying to achieve but I think I know. Anyway, if you were creating an ASP.NET page and you wanted to display the images, I would wrap each required image up inside its own control. The control would have a primary key identifier that told it which image to download from the database and the control would then be responsible for displaying the resulting image.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi,
I have two tables reciept and issue.
Reciept have the foloowing details
partno date rquantity rrate
a 10/1/2005 50 15
a 15/4/2005 10 22
a 11/7/2005 40 20
Issue have the foloowing details
partno date iquantity irate value
a 14/1/2005 10 10
a 15/5/2005 20 22
a 1/8/2005 20 22
what i have to do is
take the quatity from issue table subtract from the rquantity of reciept table until rquatity becomes 0 then we have to store some calucated result in "Value" column
iquantity(irate-rrate)
example, first we have to subtract
10 from the 50, the remainder is 40 ,store 10(10)+10(10-15)=50
20 from the 40, the remainder is 20,store 20(22)+20(22-22)=440
20 from the 20, the remainder is 0,,store 20(20)+20(22-20)=440
Can anyone tell to solve this?
Chaitra N
|
|
|
|
|
n_gchaitra wrote: take the quatity from issue table subtract from the rquantity of reciept table until rquatity becomes 0 then we have to store some calucated result in "Value" column
How about trying to itrate this from Front-End and thereby updating the column in the DB accordingly?
|
|
|
|
|
I thought of using asp.net with vb script. But I think then also we need to write appropriate sql statements only.
Chaitra N
|
|
|
|
|
What you are looking for is a cursor (at least if you are using sql server).
cursors allow you to iterate through a set of results returned by a select statement and perform any number of sql actions on each iteration. Be careful though as SQL is designed for Set based actions not iterative procedures so the performance overhead against a properly designed query (if one would be possible for what you want to do) is huge.
Just google for 'SQL Cursor' and you should find what you want.
Jonathan
|
|
|
|
|
I dont know whether i have to use cursor or simply a stored prcedure.
This is FIFO inventory system. Recieved and Issue items will be in different table say, RECIEVE & ISSUE. Each item may be recieved and issued many times. Each time may be with different rate,quantiy and date. For example let us considere the following tables,
RECIEVE TABLE
PARTNO RDATE RRATE/UNIT rQUANTITY
A 10/10/2006 15 20
A 10/10/2007 20 50
A 1/11/2006 18 10
B 10/12/2006 15 30
B 13/2/2007 25 15
ISSUE TABLE
PARTNO IDATE IRATE/UNIT iQUANTITY
A 10/5/2007 18 18
A 1/12/2007 20 45
A 13/2/2007 20 15
B 13/2/2007 20 20
B 1/5/2007 20 25
Ultimately i have to get the following table
PARTNO IDATE IRATE/UNIT iQUANTITY ShortTerm LongTerm
Here I want to find the LongTerm Value and Shorttem value depending on the difference in date between idate and rdate of each item. This is to find the gain or loss of the item in that particular date. The formula is iquatity(irate)+iquatity(irate-rRate),if the date difference between recieve and issue is >365 day then the calculated value should be place in LongTerm value column else in the Short term value column
First we take A, the first issue quanitity is 18, but the no of quantity recieved was 20 so the value will be 18(18)+18(18-15). Now the remaining no of items present in first recieved is 2.The difference between issue date 10/5 /2007 and recieve date 10/10/2006 is less than 365 days so has to be placed in ShortTerm column.
So when calculating the amount of second issue first we have issue remaining 2, then go for second recieve. Here issue quantity is 45. so, the value must be (2(20)+2(20-15)). The difference between issue date 1/12/2007 and recieve date 10/10/2006 is more than 365 days so has to be placed in LongTerm column. Then remaining 43 items, the value has to be (43(20)+(43(20-20). The difference between issue date 1/12/2007 and recieve date 1/12/2007 is less than 365 days so has to be placed in ShortTerm column. Now the remaining items in Recieve table for A item is 7+10.
Now we have to calculate the next A item as we did for second. i.e. first issuing 7 items from the remaining RECIEVE and then another 8. So we are left with 2 recieved items which will be there until next issue.
This has to be repeated for the Item B and so on.
Chaitra N
|
|
|
|
|
I have written following sqlstatements to update a column based on the no of days between two dates. but it is giving the error,
Server: Msg 512, Level 16, State 1, Line 2
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
In what other way i can get the expected result
if (select datediff(dd,transactiondate, Issuedate) from receipt)>365
begin
update receipt set longvalue=datediff(dd,transactiondate, Issuedate)
end
else
begin
update receipt set shortvalue=datediff(dd,transactiondate, Issuedate)
end
Chaitra N
|
|
|
|
|
Use a WHERE in the UPDATE
UPDATE receipt set longvalue=datediff(dd,transactiondate, Issuedate)
WHERE datediff(dd,transactiondate, Issuedate) >365
UPDATE receipt set shortvalue=datediff(dd,transactiondate, Issuedate)
WHERE datediff(dd,transactiondate, Issuedate) <= 365
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|