Showing posts with label teh. Show all posts
Showing posts with label teh. Show all posts

Wednesday, March 28, 2012

Problem with backup and restore

When I am backuping and after restoring the DB on another server, all Users
of this DB can't connect to this DB. I am getting teh error "login failed
for user 'somebody' ".
In DB Folder Users , this user exist.
Vaidas
Search on internet for two stored procedures ('sp_help_revlogin') provided
by MS to move logins with their original SID
"Vaidas Gudas" <vaidas.gudas@.rst.lt> wrote in message
news:%23Dp$na43FHA.3880@.TK2MSFTNGP12.phx.gbl...
> When I am backuping and after restoring the DB on another server, all
> Users of this DB can't connect to this DB. I am getting teh error "login
> failed for user 'somebody' ".
> In DB Folder Users , this user exist.
>
|||Hi ,
use dts tranfer login task . It will tranfer all the logins to the
restored database server.
from
Doller
Uri Dimant wrote:[vbcol=seagreen]
> Vaidas
> Search on internet for two stored procedures ('sp_help_revlogin') provided
> by MS to move logins with their original SID
> "Vaidas Gudas" <vaidas.gudas@.rst.lt> wrote in message
> news:%23Dp$na43FHA.3880@.TK2MSFTNGP12.phx.gbl...
|||yes but not with their oridinal SID
"doller" <sufianarif@.gmail.com> wrote in message
news:1130921760.840115.43300@.g14g2000cwa.googlegro ups.com...
> Hi ,
> use dts tranfer login task . It will tranfer all the logins to the
> restored database server.
> from
> Doller
> Uri Dimant wrote:
>

Problem with backup and restore

When I am backuping and after restoring the DB on another server, all Users
of this DB can't connect to this DB. I am getting teh error "login failed
for user 'somebody' ".
In DB Folder Users , this user exist.Vaidas
Search on internet for two stored procedures ('sp_help_revlogin') provided
by MS to move logins with their original SID
"Vaidas Gudas" <vaidas.gudas@.rst.lt> wrote in message
news:%23Dp$na43FHA.3880@.TK2MSFTNGP12.phx.gbl...
> When I am backuping and after restoring the DB on another server, all
> Users of this DB can't connect to this DB. I am getting teh error "login
> failed for user 'somebody' ".
> In DB Folder Users , this user exist.
>|||Hi ,
use dts tranfer login task . It will tranfer all the logins to the
restored database server.
from
Doller
Uri Dimant wrote:
> Vaidas
> Search on internet for two stored procedures ('sp_help_revlogin') provided
> by MS to move logins with their original SID
> "Vaidas Gudas" <vaidas.gudas@.rst.lt> wrote in message
> news:%23Dp$na43FHA.3880@.TK2MSFTNGP12.phx.gbl...
> > When I am backuping and after restoring the DB on another server, all
> > Users of this DB can't connect to this DB. I am getting teh error "login
> > failed for user 'somebody' ".
> > In DB Folder Users , this user exist.
> >|||yes but not with their oridinal SID
"doller" <sufianarif@.gmail.com> wrote in message
news:1130921760.840115.43300@.g14g2000cwa.googlegroups.com...
> Hi ,
> use dts tranfer login task . It will tranfer all the logins to the
> restored database server.
> from
> Doller
> Uri Dimant wrote:
>> Vaidas
>> Search on internet for two stored procedures ('sp_help_revlogin')
>> provided
>> by MS to move logins with their original SID
>> "Vaidas Gudas" <vaidas.gudas@.rst.lt> wrote in message
>> news:%23Dp$na43FHA.3880@.TK2MSFTNGP12.phx.gbl...
>> > When I am backuping and after restoring the DB on another server, all
>> > Users of this DB can't connect to this DB. I am getting teh error
>> > "login
>> > failed for user 'somebody' ".
>> > In DB Folder Users , this user exist.
>> >
>sql

Problem with backup and restore

When I am backuping and after restoring the DB on another server, all Users
of this DB can't connect to this DB. I am getting teh error "login failed
for user 'somebody' ".
In DB Folder Users , this user exist.Vaidas
Search on internet for two stored procedures ('sp_help_revlogin') provided
by MS to move logins with their original SID
"Vaidas Gudas" <vaidas.gudas@.rst.lt> wrote in message
news:%23Dp$na43FHA.3880@.TK2MSFTNGP12.phx.gbl...
> When I am backuping and after restoring the DB on another server, all
> Users of this DB can't connect to this DB. I am getting teh error "login
> failed for user 'somebody' ".
> In DB Folder Users , this user exist.
>|||Hi ,
use dts tranfer login task . It will tranfer all the logins to the
restored database server.
from
Doller
Uri Dimant wrote:[vbcol=seagreen]
> Vaidas
> Search on internet for two stored procedures ('sp_help_revlogin') provide
d
> by MS to move logins with their original SID
> "Vaidas Gudas" <vaidas.gudas@.rst.lt> wrote in message
> news:%23Dp$na43FHA.3880@.TK2MSFTNGP12.phx.gbl...|||yes but not with their oridinal SID
"doller" <sufianarif@.gmail.com> wrote in message
news:1130921760.840115.43300@.g14g2000cwa.googlegroups.com...
> Hi ,
> use dts tranfer login task . It will tranfer all the logins to the
> restored database server.
> from
> Doller
> Uri Dimant wrote:
>

Tuesday, March 20, 2012

Problem wit sp_execute SQL

I have to make a large number of updates (about 29k) so I generated teh update statements into a table and am trying to sue sp_executesql to run them. Here is my code:

Declare @.SQLState NVARCHAR(500)

Declare Code Cursor
for
select SQLState from updates
open Code
FETCH NEXT FROM Code
into @.SQLState
While @.@.fetch_Status = 0
Begin
Exec sp_executesql @.SQLState

FETCH NEXT FROM Code
END

CLOSE Code
DEALLOCATE Code

IT appears to run succesfully, but the updates never happen - I get the following results for each update line:

UPDATE REEmployeeEvent SET UpdatedByEmployeeID= '00013' Where UpdatedByEmployeeID='00279'

(1 row(s) affected)

(0 row(s) affected)

Any ideas what I am doing wrong?

BTW - If I run the statements manually, they do work.

Thanks for any help!is there any particular reason why you want to use such a non-standard method to execute a script?

Why not execute dump them to a file, and execute the file as a single batch? At least that way you could visually inspect the scripts for correctness.

What you are trying to do here seems risky at best.