Showing posts with label duplicate. Show all posts
Showing posts with label duplicate. Show all posts

Monday, March 19, 2012

Make duplicate db?

I am wanting to be able to take my work home with me, problem is I can access the server from there.

Is it possible to work with a local instance on my laptop, then when completed transfer it to another instance on a different pc?

Meaning, talbes,queries,etc.

Thanks

Davids Learning

You can create a backup of the database and restore it to another machine.|||

does that work with the express version?

or would I be better of using Access?

Davids Learning

|||That works very fine with SQL Express.|||

I need help with this.

How do you backup or restore to a different instance on a different machine?

I am new to SQL Server.

I can from my laptop see the server and access the files and do a backup(I believe the backup ran on the server and not on mine), but how do you get the db to my instance on my laptop?

Thanks

DavidsLearning

|||

Look in Books Online for the usage of RESTORE, and especially the WITH MOVE option.

If you don't have Books Online, download a copy here:

SQL Server 2005 Express Books Online Express Edition
http://msdn2.microsoft.com/en-us/library/ms165706.aspx


|||

I quess this is a Monday.

Is there a book for dummies?

Tried to apply what I read, and I still dont get how to assign a different instance.

Is there a way to make it simplier?

DavidsLearning

|||

You execute the RESTORE operation from the INSTANCE (after connection to that instance) where you want to install the database. (You don't 'assign an a different instance'.)

Some weeks , everyday seems like Monday...

Monday, March 12, 2012

Make a Job continue after Primary Key Violation?

i have a stored procedure that processes new incoming data. during this
procedure i have many INSERT commands that may result with a duplicate key
violation.
this kind of error should not stop the process and the algorithm continue.
when i run it manually ( EXEC SP1 ...) it behaves ok and continue even when
primary key violation occur.
BUT, when i run it via a job (single step) it quits on the 1st error!!!
WHY ?
how can i force the job/SP to continue running after data errors like key
violations '
thanks
rafiThere are errors in sql that are not trappable. Erland has some good writing
that you should take a look:
http://www.sommarskog.se/error-handling-I.html
-oj
"Rafi" <Rafi@.discussions.microsoft.com> wrote in message
news:93C834D3-71DA-48AF-B2C6-2151EC06F136@.microsoft.com...
>i have a stored procedure that processes new incoming data. during this
> procedure i have many INSERT commands that may result with a duplicate key
> violation.
> this kind of error should not stop the process and the algorithm continue.
> when i run it manually ( EXEC SP1 ...) it behaves ok and continue even
> when
> primary key violation occur.
> BUT, when i run it via a job (single step) it quits on the 1st error!!!
> WHY ?
> how can i force the job/SP to continue running after data errors like key
> violations '
> thanks
> rafi|||Hi
Why not add a where clause to the insert statement to check the PK value
does not exist? If they do exist you may want to log the fact.
It may not a good idea to SET XACT_ABORT OFF as you may miss something that
is important.
John
"Rafi" wrote:

> i have a stored procedure that processes new incoming data. during this
> procedure i have many INSERT commands that may result with a duplicate key
> violation.
> this kind of error should not stop the process and the algorithm continue.
> when i run it manually ( EXEC SP1 ...) it behaves ok and continue even whe
n
> primary key violation occur.
> BUT, when i run it via a job (single step) it quits on the 1st error!!!
> WHY ?
> how can i force the job/SP to continue running after data errors like key
> violations '
> thanks
> rafi