Thursday, March 22, 2012
Backing up a database that was been moved from another server
I have a database where we have moved the mdf/ldf files to another
server and reattached the database on the new server
I am now trying to backup this database up, but the wizard tell you
the backup has complete but it is too quick for it to be valid as the
db is 2gb
I also always get a message telling me 'The connection to the SQL
Server is broken' Do you want to try recoonecting to it
Any help?
Well ,try to restore your backup with a different name and you will get an
error message if the backup file is corrupted.
<satshergill@.yahoo.co.uk> wrote in message
news:1137407538.287495.195210@.g14g2000cwa.googlegr oups.com...
> HI all
> I have a database where we have moved the mdf/ldf files to another
> server and reattached the database on the new server
>
> I am now trying to backup this database up, but the wizard tell you
> the backup has complete but it is too quick for it to be valid as the
> db is 2gb
> I also always get a message telling me 'The connection to the SQL
> Server is broken' Do you want to try recoonecting to it
> Any help?
>
Backing up a database that was been moved from another server
I have a database where we have moved the mdf/ldf files to another
server and reattached the database on the new server
I am now trying to backup this database up, but the wizard tell you
the backup has complete but it is too quick for it to be valid as the
db is 2gb
I also always get a message telling me 'The connection to the SQL
Server is broken' Do you want to try recoonecting to it
Any help?Well ,try to restore your backup with a different name and you will get an
error message if the backup file is corrupted.
<satshergill@.yahoo.co.uk> wrote in message
news:1137407538.287495.195210@.g14g2000cwa.googlegroups.com...
> HI all
> I have a database where we have moved the mdf/ldf files to another
> server and reattached the database on the new server
>
> I am now trying to backup this database up, but the wizard tell you
> the backup has complete but it is too quick for it to be valid as the
> db is 2gb
> I also always get a message telling me 'The connection to the SQL
> Server is broken' Do you want to try recoonecting to it
> Any help?
>
Backing up a database that was been moved from another server
I have a database where we have moved the mdf/ldf files to another
server and reattached the database on the new server
I am now trying to backup this database up, but the wizard tell you
the backup has complete but it is too quick for it to be valid as the
db is 2gb
I also always get a message telling me 'The connection to the SQL
Server is broken' Do you want to try recoonecting to it
Any help?Well ,try to restore your backup with a different name and you will get an
error message if the backup file is corrupted.
<satshergill@.yahoo.co.uk> wrote in message
news:1137407538.287495.195210@.g14g2000cwa.googlegroups.com...
> HI all
> I have a database where we have moved the mdf/ldf files to another
> server and reattached the database on the new server
>
> I am now trying to backup this database up, but the wizard tell you
> the backup has complete but it is too quick for it to be valid as the
> db is 2gb
> I also always get a message telling me 'The connection to the SQL
> Server is broken' Do you want to try recoonecting to it
> Any help?
>sql
Sunday, March 11, 2012
Awkward question
Here's my problem/question:
I have a report which can provide details based upon a Command/Battalion selection. I want the user to be able to choose the the Command and a filtered list of associated Battalions for that Command. The choices then populate the report with appropriate data.
I've used a stored procedure to acquire the data for the report and it works beautifully . . . if you have memorized the Commands and Battalions so that you get the right data. I do not understand how to present the Command and Battalion information to user and then pass the user selection to my procedure to get the right data.
Any assistance is very gratefully received!
Peter MorrisThere is more than one way to skin this cat, but none of them are very difficult. Here is a general solution:
I assume (hope) you have a table of Commands with a unique key, and then a table of Battalions with a field linked to the primary key of the Commands table. The battalions table should also include a unique index, since I suppose it is possible for two battalions to have the same name if they are in different commands?
Create a form, (it does not have to have a datasource) and add a combo box do it that uses the Commands table as its source and includes the primary key field.
Create a second dropdown on the form for battalions, but leave it's rowsource blank and leave it disabled by default.
Next, create an ON CHANGE event for the Command dropdown that performs the following actions
1) Set the value of the battalion dropdown to null, clearing any existing value.
2) Set the datasource of the battalion query to an SQL query string similar to this: "select battalion_id, battalion from battalion_table where command_id = " + [command_dropdown].
3) Requiries the battalion dropdown
Add a button to your form that opens the report.
Modify the report to filter on the battalion_ID field from your form.
...yes, the details of this are going to depend on your table structure, but this should give you an idea of the direction you need to go.
Now MOVE IT, MAGGOT!
blindman|||Thanks so much for the reply! I'll get on it as soon as events allow!
Sir, YES SIR!|||Blindman:
OK, took a look at your directions and the structural elements are already in place. Where I get stuck is little things like: "1) Set the value of the battalion dropdown to null, clearing any existing value." I'm a novice, and while I have examples of what the orignal programmer did, when I copied and suitably modified (I thought) his code, it didn't work.
Would you be willing to communicate directly via email so I could show the code I have and perhaps you could point out what I'm missing? [I will not be offended with a no. 8-)]
I certainly appreciate you assistance!
Peter
Friday, February 24, 2012
Avoid interrupting of BEGIN-END?
I am searching for a way to get data moved from table to table. Meanwhile, data is being added to the table.
The batch query I thought of was the following:
BEGIN
SELECT (Column1, Column2) INTO Table2 (Column1, Column2)
FROM Table1;
TRUNCATE Table1;
(process data from Table2)
TRUNCATE Table2;
END
Problem is, it musn't be interrupted.
But data is being inserted continuously by another process, so the data from that process need to be copied to a cache table of sql server, or something like that.
Another thought of mine was letting that process insert it's data via a synonym (in this example called "Synonym1"). The application making use of Table 2 can either make use of Table1, that doesn't matter.
The batch query would be like the following:
BEGIN
ALTER Synonym1=Table1_Temp;
(process data from Table1);
TRUNCATE Table1;
ALTER Synonym1=Table1;
SELECT (Column1, Column2) INTO Table1 (Column1, Column2)
FROM Table1_Temp;
TRUNCATE Table1_Temp;
END
But the ALTER function does not exist for the SYNONYM function in SQL Server.
It needs to be done with drop and create.
Problem is, in that split second the other program wich is adding data to the database, will make an error because it cannot find that synonym.
Does anybody know how to make such processes uninterruptible?
Thanks in advance
Can you modify the structure of the tables in question or are they set?
If you can change them then I would add a processing field to table1 which defaults to Null (or possibly 0 if bit). The first step is to set that flag for all the records in table1. Then all your other operations (copying and deleting) use that in a where clause to only affect those records. Any records added after you start will have that value at the default and therefore not be affected (until the process runs the next time.
The only problem I can see is if this process runs twice with overlap - and the old version would have that problem as well. In that case what you could do is use a unique ID for each run and place that rather than simply a flag value in to the processing field. The most obvious is a GUID but as those are 16-bytes there is probably a better solution (particularly if this is as active a table as you imply).
A problem with transferring between tables as you show in your sample is if you try to use automatic identity columns as these will probably not be unique between the tables.
Friday, February 10, 2012
autonumber is resetting
yeah, it's strange. i added that data via webform interface and it was 1. then i tried adding directly in db but it gave me 10 as new value which is correct.
so just wondering if there is any settings i need to use just to make sure that it doesn't happen again.