Drop User problem in Sql 2005 with agent



In sql 2000 we had a tsql job that ran each day and restored a backup of a
database to a qa server. Because the backup was of a different user we ran a
follow up job that dropped one of the sql server users from the database and
re-added it with a login from the qa system.I updated the syntax to use the
new drop user commands so it's like

use [thedatabase]
go
DROP USER theUser
go
CREATE USER [theUser] FOR LOGIN [theLogin] WITH DEFAULT_SCHEMA=[dbo]
go

This works perfectly from a management studio window but from the job we get
the message below. It is the drop user statement that causes the error. I
have verified that this user does not own any schema's, and the error that
generates is different anyway. Suggestions?

Executed as user: PLANADMIN\servsql. String or binary data would be
truncated. [SQLSTATE 22001] (Error 8152) The statement has been terminated.
[SQLSTATE 01000] (Error 3621). The step failed.





.



Relevant Pages

  • RE: How do I restore from mdf and ldf files?
    ... Tasks -> Backup Database ... Tasks -> Restore Database ... Windows 2003 Server with Latest Service Pack ... Pre-requisites for Sharepoint Backup and Restore: ...
    (microsoft.public.sharepoint.portalserver)
  • RE: Backups have Shadow Copy Problems
    ... and restarted the server. ... suggested and changed the recovery model to simple on the one database called ... I understand the issue to be: the backup task failed ... You back up data from a volume that contains a Microsoft SQL Server ...
    (microsoft.public.windows.server.sbs)
  • Re: How do I delete backed-up databases?
    ... specific database backup file, not all databases with expiration based on ... are older than 2 days(this is not an issue for SQL 2000). ... Server Management Studio? ...
    (microsoft.public.sqlserver.setup)
  • Re: upsizing to sql 2005
    ... the word SERVER in it, ... You can access to the database by multiple means (Access, ... and how does it update the SQL database with the new records in Access? ... Query Name: Arcadia - ARC ...
    (microsoft.public.access.queries)
  • RE: ESENT Logging
    ... SBS server 2003 has a backup job that will ... 145881 How to Use Jetpack.exe to Compact a WINS or DHCP Database ... newsgroups so that they can be resolved in an efficient and timely manner. ...
    (microsoft.public.windows.server.sbs)