|
Or if you have foreign keys between several tables, you could set the identity insert off to ensure that the keys remain the same as they originally were.
Another mechanism you could consider is SSIS where you could break the import/export to proper blocks, define a workflow and if necessary add logic.
|
|
|
|
|
Is it possible to supply a separate environment for their needs. Or are they really trying to reset their production environment back to a prior date.
We often have a need for a department to want a restore of a previous date for reporting/investigation reasons, this does not need to impact on the production environment as they get another database environment created specifically for their needs.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
This is more for a restore after they do something dumb ... like "I just deleted all the invoices for customer A when I meant B; can you get them back?" My answer would be I can put your data back to 3am last night, you'll loose everything you did today but your invoices will be back.
|
|
|
|
|
Ugh, nasty, especially when you mix other clients into the data, I would suggest this could only be fixed by a custom script, charge them a fortune as a lesson and hope like hell you can deliver.
I would then implement a logging/audit strategy on the database or separate each client to their own environment. If you screw up another clients data b/c of this issue your whole business case just went out the window!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi
I am trying to execute this query but its giving me an error
"Cannot find either column "D" or the user-defined function or aggregate "D.bonus", or the name is ambiguous.
"
Query:
MERGE INTO bonuses D
USING bonuses1 E
ON D.employee_id = S.employee_id)
WHEN MATCHED THEN
UPDATE SET
D.bonus = E.bonus
WHEN NOT MATCHED THEN INSERT (D.employee_id, D.bonus)
VALUES ES.employee_id, E.salary*0.1)
WHERE (E.salary <= 8000);
UPDATE bonuses
Set bonus=10000
FROM bonuses D
JOIN cbonuses1 E
ON D.employee_id = S.employee_id)
Any idea??
modified 1-Oct-12 7:56am.
|
|
|
|
|
UPDATE bonuses
Set bonus=10000
FROM bonuses D
JOIN cbonuses1 E
ON D.employee_id = S.employee_id)
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
How to Recover Deleted rows from sql 2000 Database using with some period parameter
eg: from 01/01/2012 - 20/05/2012
Display all deleted records on this period.
|
|
|
|
|
Restore the backup. AFAIK, there's no alternative for backups.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
There is no inbuilt-mechanism to restore or read deleted rows in SQL Server 2000. You must implement logical deletes instead of physical deletes to be able to achieve that. (For example, an IsDeleted(bit) column in every table).
As Eddy suggested, the only other ways is to work on a restored copy of the database.
|
|
|
|
|
Hi World!
what is the Windows Run Command for "SQLDataRoot" OR "SQLPath"
for exp:
%program files% --->open Program files.
i wanna something the open the :
c:\Program Files\SqlServer 2005 for DWebPro\MSSQL.1\MSSQL
in other word i need this path to give to my setup to copy the database to the data path of that instance is installed.
i know the instance name also but i cannot give the exact path.cause if sql server was installed in that machine there should be "MSSQL.1" and now it should change to :
c:\Program Files\SqlServer 2005 for DWebPro\MSSQL.2\MSSQL
So if i can give it something like %MSSQL$% it will solve the problem.
|
|
|
|
|
jojoba2011 wrote: for exp:
%program files% --->open Program files.
i wanna something the open the :
c:\Program Files\SqlServer 2005 for DWebPro\MSSQL.1\MSSQL
We call those "environment variable", and there's no such thing for each subdirectory of Sql Server. It's not recommended to be doing stuff there anyway, since it's the installation-folder of the app.
What are you trying to achieve that you "need" this folder?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
rem set mssqlver to the current version: 1, 2 etc
set mssqlver=1
rem set path according to the current version
set mssqlpath="C:\Program Files\SqlServer 2005 for DWebPro\MSSQL.%mssqlver%\MSSQL"
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Is it possible to change this path when wanna install sql express 2005 ?something like :
c:\Program Files\SqlServer 2005 for DWebPro\<big>MSSQL.639</big> \MSSQL
cause i can give parameter when wanna install sql server express 2005(command prompt)
|
|
|
|
|
I have shown you what you need to do, why not try some experimentation for yourself to see how you can vary that to your own needs?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
thanks for solution.
but i dont understand where should i run that command or how to use that.
My main Question is that :
Is it possible to change "MSSQL.<big>x</big> " In this address "c:\Program Files\SqlServer 2005 for DWebPro\MSSQL.1\MSSQL" while installing sql express 2005 in command line? So that it wont generate it Automatically.
I mean that i give that number while wanna install sql express 2005.
Or More Clearly :
I wanna change Instance Id and give my own Id while installing sql express 2005 !
Thanks in Advanced!
modified 30-Sep-12 0:51am.
|
|
|
|
|
Your big black writing is not appreciated, normal font size and weight is perfectly adequate for all questions. As to your query, I don't know if that will work, you will need to look at the instructions for installing SQL Express.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
thanks for attention.
But i am working on it but no idea and doesnt get ans.
Plz help!
|
|
|
|
|
jojoba2011 wrote: no idea and doesnt get ans. As I said, you need to look at the instructions for installing SQL Express. Most products come with an installer that allows you to select the destination directory, but I do not know if you can do it with environment variables.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I didnt get any thing from it.
Will you also check something for me.?
Thanks in advanced !
|
|
|
|
|
jojoba2011 wrote: I didnt get any thing from it. That probably means that there is no option to provide what you want.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
There's a difference between the installation path, and an install-ID. If I understand you correctly, you're having trouble identifying which of the Sql Server-instances that's on the machine is yours.
Is that correct, so far?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi..thanks a lot...thats exactly correct but before installing i my self should give that value to sql express setup cause that value is static in my project.
|
|
|
|
|
Member 9473809 wrote: thats exactly correct but before installing i my self should give that value to sql express setup
You're explaining what you "want" the software to do, not quite what you're trying to achieve.
One can install Sql Server from the command prompt[^]. That way you could also predefine in which directory the app will be installed.
A word of warning here; you'll be working under the assumptions that you have read/write rights in that location, and that the location exists. Both assumptions would fail on a networked PC here. What's more, most machines already have Sql Server, and it'd be preferable to hook up the database for a new app to one of the existing servers. Your app would fail again if someone moved the database to a different server.
Here's the catch; I'm still wondering why you need to "know" this path. It's defined at install, fine, you could have a custom action in there that writes to the registry where it'll be located. In fact, you can "ask" Sql Server for it's storage- and backup-locations.
What kind of data are you storing in there, and what kind of app are we talking about?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I have read that before but isnt possible to give my own number to MSSQL.x .it creates automatically when wanna install sql.
my main question is how can i give that number my self when wanna install sql express 2005 in command Prompt ?
Thanks in advanced !
|
|
|
|
|
You can't, you can only modify what's mentioned in the article.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|