I'm experiencing a problem with HTML code being slightly messed up when
sending a subscription via email in web archive format.
The report displays fine in the Report Manager. However, went emailed some
whitespace is seemingly randomly added to the HTML page. Depending on where
that whitespace is, this might not be a problem. But if the whitespace is
inserted in some places within an HTML tag, then the tag isn't rendered
properly.
Example: a space is added following the "<" in "</DIV>", thus giving "<
/DIV>". Since this is invalid HTML, it displays as text in the report.
Example: a cell in a table is defined as right-aligned and in a specific
font. All 25 rows in the table (x 3 columns = 75 cells) all display
correctly:
<P class=MsoNormal style="TEXT-ALIGN: right" align=right><FONT
face="Eras Medium ITC" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Eras
Medium ITC'">
*EXCEPT* one cell, where the following HTML is used:
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt">
Why did RS render this cell differently?This might be an issue with the local SMTP. Are you using the pickup
directory to send email?
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Columbia Kai" <Columbia Kai@.discussions.microsoft.com> wrote in message
news:A0190874-9273-4F1C-9BD1-CF0CEB79616D@.microsoft.com...
> I'm experiencing a problem with HTML code being slightly messed up when
> sending a subscription via email in web archive format.
> The report displays fine in the Report Manager. However, went emailed
> some
> whitespace is seemingly randomly added to the HTML page. Depending on
> where
> that whitespace is, this might not be a problem. But if the whitespace is
> inserted in some places within an HTML tag, then the tag isn't rendered
> properly.
> Example: a space is added following the "<" in "</DIV>", thus giving "<
> /DIV>". Since this is invalid HTML, it displays as text in the report.
> Example: a cell in a table is defined as right-aligned and in a specific
> font. All 25 rows in the table (x 3 columns = 75 cells) all display
> correctly:
> <P class=MsoNormal style="TEXT-ALIGN: right" align=right><FONT
> face="Eras Medium ITC" color=black size=2><SPAN
> style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Eras
> Medium ITC'">
> *EXCEPT* one cell, where the following HTML is used:
> <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
> style="FONT-SIZE: 12pt">
> Why did RS render this cell differently?|||Thanks for your reply, Daniel.
I've tried this with two SMTP mail servers, both with the same result. I
changed the definition via the RSReportServer.config file.
Neither SMTP server is on my local machine.
One resides on a Win2003 box and is a MS mail server; the other resides on a
Win2000 Server box and is a product called Merak Mail Server. Ultimately
they send via the Columbia University mail server, which is sendmail, I
believe.
(I'm not a systems guy so sorry if my answers aren't dead-on what you asked
for.)
Please also see my comments on another post title "Web archive subrsciption
gets messed up" (note misspelling of 'subscription'). I ran into an
identical problem like this when sending email from an Oracle PL/SQL program.
The resolution is to intersprese CRLF into the msg at least every 990 bytes.
Thanks Daniel. This is the one problem that's keeping me from implementing
RS and beginning to retire Crystal Enterprise.
"Daniel Reib [MSFT]" wrote:
> This might be an issue with the local SMTP. Are you using the pickup
> directory to send email?
> --
> -Daniel
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Columbia Kai" <Columbia Kai@.discussions.microsoft.com> wrote in message
> news:A0190874-9273-4F1C-9BD1-CF0CEB79616D@.microsoft.com...
> > I'm experiencing a problem with HTML code being slightly messed up when
> > sending a subscription via email in web archive format.
> >
> > The report displays fine in the Report Manager. However, went emailed
> > some
> > whitespace is seemingly randomly added to the HTML page. Depending on
> > where
> > that whitespace is, this might not be a problem. But if the whitespace is
> > inserted in some places within an HTML tag, then the tag isn't rendered
> > properly.
> >
> > Example: a space is added following the "<" in "</DIV>", thus giving "<
> > /DIV>". Since this is invalid HTML, it displays as text in the report.
> >
> > Example: a cell in a table is defined as right-aligned and in a specific
> > font. All 25 rows in the table (x 3 columns = 75 cells) all display
> > correctly:
> > <P class=MsoNormal style="TEXT-ALIGN: right" align=right><FONT
> > face="Eras Medium ITC" color=black size=2><SPAN
> > style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Eras
> > Medium ITC'">
> > *EXCEPT* one cell, where the following HTML is used:
> > <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
> > style="FONT-SIZE: 12pt">
> > Why did RS render this cell differently?
>
>|||I haven't done this yet but what was suggested to me (I too am having
problems and am using an external smtp server too) was to use Windows 2003
smtp service and have it forward/route (not sure the term) to the external
smtp server. The Windows 2003 smtp server is configured to be looking at a
directory and forwarding things on from there. Then you have your report
saved to the pickup directory. Note that I haven't done this so I am a
little vague on how it all works.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Columbia Kai" <ColumbiaKai@.discussions.microsoft.com> wrote in message
news:8995F878-CB68-4766-BB00-654D7580BAF1@.microsoft.com...
> Thanks for your reply, Daniel.
> I've tried this with two SMTP mail servers, both with the same result. I
> changed the definition via the RSReportServer.config file.
> Neither SMTP server is on my local machine.
> One resides on a Win2003 box and is a MS mail server; the other resides on
> a
> Win2000 Server box and is a product called Merak Mail Server. Ultimately
> they send via the Columbia University mail server, which is sendmail, I
> believe.
> (I'm not a systems guy so sorry if my answers aren't dead-on what you
> asked
> for.)
> Please also see my comments on another post title "Web archive
> subrsciption
> gets messed up" (note misspelling of 'subscription'). I ran into an
> identical problem like this when sending email from an Oracle PL/SQL
> program.
> The resolution is to intersprese CRLF into the msg at least every 990
> bytes.
> Thanks Daniel. This is the one problem that's keeping me from
> implementing
> RS and beginning to retire Crystal Enterprise.
>
> "Daniel Reib [MSFT]" wrote:
>> This might be an issue with the local SMTP. Are you using the pickup
>> directory to send email?
>> --
>> -Daniel
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Columbia Kai" <Columbia Kai@.discussions.microsoft.com> wrote in message
>> news:A0190874-9273-4F1C-9BD1-CF0CEB79616D@.microsoft.com...
>> > I'm experiencing a problem with HTML code being slightly messed up when
>> > sending a subscription via email in web archive format.
>> >
>> > The report displays fine in the Report Manager. However, went emailed
>> > some
>> > whitespace is seemingly randomly added to the HTML page. Depending on
>> > where
>> > that whitespace is, this might not be a problem. But if the whitespace
>> > is
>> > inserted in some places within an HTML tag, then the tag isn't rendered
>> > properly.
>> >
>> > Example: a space is added following the "<" in "</DIV>", thus giving "<
>> > /DIV>". Since this is invalid HTML, it displays as text in the report.
>> >
>> > Example: a cell in a table is defined as right-aligned and in a
>> > specific
>> > font. All 25 rows in the table (x 3 columns = 75 cells) all display
>> > correctly:
>> > <P class=MsoNormal style="TEXT-ALIGN: right" align=right><FONT
>> > face="Eras Medium ITC" color=black size=2><SPAN
>> > style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY:
>> > 'Eras
>> > Medium ITC'">
>> > *EXCEPT* one cell, where the following HTML is used:
>> > <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
>> > style="FONT-SIZE: 12pt">
>> > Why did RS render this cell differently?
>>sql
Showing posts with label archive. Show all posts
Showing posts with label archive. Show all posts
Wednesday, March 21, 2012
Saturday, February 25, 2012
Problem with DBO after restore
Hi,
I support an application and part of it has an archive function. It takes
backups of a main database (using the SQL backup command) and saves them to
be restored at a later date to an archive database on the same SQL Server
instance for reporting on past events. All of this has worked fine until
recently. The user that we do this under is a SQL Server login and until
recently was a sysadmin. Based on customer requests we have lowered the
permissions on this user to be DBO on the databases it needs to backup and
restore to and also a member of the dbcreator fixed server role. Everything
still works fine except in one case. When the user moves everything to a ne
w
SQL Server. When this happens and they try to restore one of the backups to
the archive database, after it restores our user is no longer the DBO and ha
s
no access to the database. I originally thought this was because the SIDs
were different between the two machines so I used the sp_help_revlogin
procedure to create the user on the new SQL Server with the SID from the old
machine. This worked because I do not see our user as an orphan when runnin
g
sp_change_users_login but unfortunately this did not fix the problem. After
the restore it is still not DBO. I can give our user access again by runnin
g
sp_Changedbowner after the database restore but that isn't practical for
customers especially since it requires sysadmin authority and the need for
our user to not be a sysadmin was what prompted this change in the first
place. Thanks in advance for any help.
WayneWayne
Well , it is well known issue
Please search on internet for "sp_help_revlogin script" and read the
explanation
"Wayne" <Wayne@.discussions.microsoft.com> wrote in message
news:51F9F2CC-E47F-45F0-B9D6-76B21F1E3E02@.microsoft.com...
> Hi,
> I support an application and part of it has an archive function. It takes
> backups of a main database (using the SQL backup command) and saves them
> to
> be restored at a later date to an archive database on the same SQL Server
> instance for reporting on past events. All of this has worked fine until
> recently. The user that we do this under is a SQL Server login and until
> recently was a sysadmin. Based on customer requests we have lowered the
> permissions on this user to be DBO on the databases it needs to backup and
> restore to and also a member of the dbcreator fixed server role.
> Everything
> still works fine except in one case. When the user moves everything to a
> new
> SQL Server. When this happens and they try to restore one of the backups
> to
> the archive database, after it restores our user is no longer the DBO and
> has
> no access to the database. I originally thought this was because the SIDs
> were different between the two machines so I used the sp_help_revlogin
> procedure to create the user on the new SQL Server with the SID from the
> old
> machine. This worked because I do not see our user as an orphan when
> running
> sp_change_users_login but unfortunately this did not fix the problem.
> After
> the restore it is still not DBO. I can give our user access again by
> running
> sp_Changedbowner after the database restore but that isn't practical for
> customers especially since it requires sysadmin authority and the need for
> our user to not be a sysadmin was what prompted this change in the first
> place. Thanks in advance for any help.
> Wayne|||Thanks Uri,
Ok, just wanted to confirm that is how it is and that I wasn't missing
something.
Wayne
"Uri Dimant" wrote:
> Wayne
> Well , it is well known issue
> Please search on internet for "sp_help_revlogin script" and read the
> explanation
>
>
>
>
> "Wayne" <Wayne@.discussions.microsoft.com> wrote in message
> news:51F9F2CC-E47F-45F0-B9D6-76B21F1E3E02@.microsoft.com...
>
>|||The SQL 2000 SP4 version of sp_changedbowner proc has a hard-coded check for
sysadmin role membership. A possible work-around (unsupported) is to create
a special version of this system proc, changing the role check from
'sysadmin' to 'dbcreator' (see script below). I don't know if this is
palatable in your case but I can't think of another solution.
Backup/restore really isn't intended for routine application functionality
and even 'dbcreator' is a very powerful role.
-- create a system proc (unsupported) --
sp_configure 'allow', 1
GO
RECONFIGURE WITH OVERRIDE
GO
--*** create new sp_changedbowner_dbcreator here ***
GO
EXEC sp_MS_marksystemobject 'sp_changedbowner_dbcreator'
GO
sp_configure 'allow', 0
GO
RECONFIGURE
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Wayne" <Wayne@.discussions.microsoft.com> wrote in message
news:51F9F2CC-E47F-45F0-B9D6-76B21F1E3E02@.microsoft.com...
> Hi,
> I support an application and part of it has an archive function. It takes
> backups of a main database (using the SQL backup command) and saves them
> to
> be restored at a later date to an archive database on the same SQL Server
> instance for reporting on past events. All of this has worked fine until
> recently. The user that we do this under is a SQL Server login and until
> recently was a sysadmin. Based on customer requests we have lowered the
> permissions on this user to be DBO on the databases it needs to backup and
> restore to and also a member of the dbcreator fixed server role.
> Everything
> still works fine except in one case. When the user moves everything to a
> new
> SQL Server. When this happens and they try to restore one of the backups
> to
> the archive database, after it restores our user is no longer the DBO and
> has
> no access to the database. I originally thought this was because the SIDs
> were different between the two machines so I used the sp_help_revlogin
> procedure to create the user on the new SQL Server with the SID from the
> old
> machine. This worked because I do not see our user as an orphan when
> running
> sp_change_users_login but unfortunately this did not fix the problem.
> After
> the restore it is still not DBO. I can give our user access again by
> running
> sp_Changedbowner after the database restore but that isn't practical for
> customers especially since it requires sysadmin authority and the need for
> our user to not be a sysadmin was what prompted this change in the first
> place. Thanks in advance for any help.
> Wayne
I support an application and part of it has an archive function. It takes
backups of a main database (using the SQL backup command) and saves them to
be restored at a later date to an archive database on the same SQL Server
instance for reporting on past events. All of this has worked fine until
recently. The user that we do this under is a SQL Server login and until
recently was a sysadmin. Based on customer requests we have lowered the
permissions on this user to be DBO on the databases it needs to backup and
restore to and also a member of the dbcreator fixed server role. Everything
still works fine except in one case. When the user moves everything to a ne
w
SQL Server. When this happens and they try to restore one of the backups to
the archive database, after it restores our user is no longer the DBO and ha
s
no access to the database. I originally thought this was because the SIDs
were different between the two machines so I used the sp_help_revlogin
procedure to create the user on the new SQL Server with the SID from the old
machine. This worked because I do not see our user as an orphan when runnin
g
sp_change_users_login but unfortunately this did not fix the problem. After
the restore it is still not DBO. I can give our user access again by runnin
g
sp_Changedbowner after the database restore but that isn't practical for
customers especially since it requires sysadmin authority and the need for
our user to not be a sysadmin was what prompted this change in the first
place. Thanks in advance for any help.
WayneWayne
Well , it is well known issue
Please search on internet for "sp_help_revlogin script" and read the
explanation
"Wayne" <Wayne@.discussions.microsoft.com> wrote in message
news:51F9F2CC-E47F-45F0-B9D6-76B21F1E3E02@.microsoft.com...
> Hi,
> I support an application and part of it has an archive function. It takes
> backups of a main database (using the SQL backup command) and saves them
> to
> be restored at a later date to an archive database on the same SQL Server
> instance for reporting on past events. All of this has worked fine until
> recently. The user that we do this under is a SQL Server login and until
> recently was a sysadmin. Based on customer requests we have lowered the
> permissions on this user to be DBO on the databases it needs to backup and
> restore to and also a member of the dbcreator fixed server role.
> Everything
> still works fine except in one case. When the user moves everything to a
> new
> SQL Server. When this happens and they try to restore one of the backups
> to
> the archive database, after it restores our user is no longer the DBO and
> has
> no access to the database. I originally thought this was because the SIDs
> were different between the two machines so I used the sp_help_revlogin
> procedure to create the user on the new SQL Server with the SID from the
> old
> machine. This worked because I do not see our user as an orphan when
> running
> sp_change_users_login but unfortunately this did not fix the problem.
> After
> the restore it is still not DBO. I can give our user access again by
> running
> sp_Changedbowner after the database restore but that isn't practical for
> customers especially since it requires sysadmin authority and the need for
> our user to not be a sysadmin was what prompted this change in the first
> place. Thanks in advance for any help.
> Wayne|||Thanks Uri,
Ok, just wanted to confirm that is how it is and that I wasn't missing
something.
Wayne
"Uri Dimant" wrote:
> Wayne
> Well , it is well known issue
> Please search on internet for "sp_help_revlogin script" and read the
> explanation
>
>
>
>
> "Wayne" <Wayne@.discussions.microsoft.com> wrote in message
> news:51F9F2CC-E47F-45F0-B9D6-76B21F1E3E02@.microsoft.com...
>
>|||The SQL 2000 SP4 version of sp_changedbowner proc has a hard-coded check for
sysadmin role membership. A possible work-around (unsupported) is to create
a special version of this system proc, changing the role check from
'sysadmin' to 'dbcreator' (see script below). I don't know if this is
palatable in your case but I can't think of another solution.
Backup/restore really isn't intended for routine application functionality
and even 'dbcreator' is a very powerful role.
-- create a system proc (unsupported) --
sp_configure 'allow', 1
GO
RECONFIGURE WITH OVERRIDE
GO
--*** create new sp_changedbowner_dbcreator here ***
GO
EXEC sp_MS_marksystemobject 'sp_changedbowner_dbcreator'
GO
sp_configure 'allow', 0
GO
RECONFIGURE
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Wayne" <Wayne@.discussions.microsoft.com> wrote in message
news:51F9F2CC-E47F-45F0-B9D6-76B21F1E3E02@.microsoft.com...
> Hi,
> I support an application and part of it has an archive function. It takes
> backups of a main database (using the SQL backup command) and saves them
> to
> be restored at a later date to an archive database on the same SQL Server
> instance for reporting on past events. All of this has worked fine until
> recently. The user that we do this under is a SQL Server login and until
> recently was a sysadmin. Based on customer requests we have lowered the
> permissions on this user to be DBO on the databases it needs to backup and
> restore to and also a member of the dbcreator fixed server role.
> Everything
> still works fine except in one case. When the user moves everything to a
> new
> SQL Server. When this happens and they try to restore one of the backups
> to
> the archive database, after it restores our user is no longer the DBO and
> has
> no access to the database. I originally thought this was because the SIDs
> were different between the two machines so I used the sp_help_revlogin
> procedure to create the user on the new SQL Server with the SID from the
> old
> machine. This worked because I do not see our user as an orphan when
> running
> sp_change_users_login but unfortunately this did not fix the problem.
> After
> the restore it is still not DBO. I can give our user access again by
> running
> sp_Changedbowner after the database restore but that isn't practical for
> customers especially since it requires sysadmin authority and the need for
> our user to not be a sysadmin was what prompted this change in the first
> place. Thanks in advance for any help.
> Wayne
Problem with DBO after restore
Hi,
I support an application and part of it has an archive function. It takes
backups of a main database (using the SQL backup command) and saves them to
be restored at a later date to an archive database on the same SQL Server
instance for reporting on past events. All of this has worked fine until
recently. The user that we do this under is a SQL Server login and until
recently was a sysadmin. Based on customer requests we have lowered the
permissions on this user to be DBO on the databases it needs to backup and
restore to and also a member of the dbcreator fixed server role. Everything
still works fine except in one case. When the user moves everything to a new
SQL Server. When this happens and they try to restore one of the backups to
the archive database, after it restores our user is no longer the DBO and has
no access to the database. I originally thought this was because the SIDs
were different between the two machines so I used the sp_help_revlogin
procedure to create the user on the new SQL Server with the SID from the old
machine. This worked because I do not see our user as an orphan when running
sp_change_users_login but unfortunately this did not fix the problem. After
the restore it is still not DBO. I can give our user access again by running
sp_Changedbowner after the database restore but that isn't practical for
customers especially since it requires sysadmin authority and the need for
our user to not be a sysadmin was what prompted this change in the first
place. Thanks in advance for any help.
WayneWayne
Well , it is well known issue
Please search on internet for "sp_help_revlogin script" and read the
explanation
"Wayne" <Wayne@.discussions.microsoft.com> wrote in message
news:51F9F2CC-E47F-45F0-B9D6-76B21F1E3E02@.microsoft.com...
> Hi,
> I support an application and part of it has an archive function. It takes
> backups of a main database (using the SQL backup command) and saves them
> to
> be restored at a later date to an archive database on the same SQL Server
> instance for reporting on past events. All of this has worked fine until
> recently. The user that we do this under is a SQL Server login and until
> recently was a sysadmin. Based on customer requests we have lowered the
> permissions on this user to be DBO on the databases it needs to backup and
> restore to and also a member of the dbcreator fixed server role.
> Everything
> still works fine except in one case. When the user moves everything to a
> new
> SQL Server. When this happens and they try to restore one of the backups
> to
> the archive database, after it restores our user is no longer the DBO and
> has
> no access to the database. I originally thought this was because the SIDs
> were different between the two machines so I used the sp_help_revlogin
> procedure to create the user on the new SQL Server with the SID from the
> old
> machine. This worked because I do not see our user as an orphan when
> running
> sp_change_users_login but unfortunately this did not fix the problem.
> After
> the restore it is still not DBO. I can give our user access again by
> running
> sp_Changedbowner after the database restore but that isn't practical for
> customers especially since it requires sysadmin authority and the need for
> our user to not be a sysadmin was what prompted this change in the first
> place. Thanks in advance for any help.
> Wayne|||Thanks Uri,
Ok, just wanted to confirm that is how it is and that I wasn't missing
something.
Wayne
"Uri Dimant" wrote:
> Wayne
> Well , it is well known issue
> Please search on internet for "sp_help_revlogin script" and read the
> explanation
>
>
>
>
> "Wayne" <Wayne@.discussions.microsoft.com> wrote in message
> news:51F9F2CC-E47F-45F0-B9D6-76B21F1E3E02@.microsoft.com...
> > Hi,
> > I support an application and part of it has an archive function. It takes
> > backups of a main database (using the SQL backup command) and saves them
> > to
> > be restored at a later date to an archive database on the same SQL Server
> > instance for reporting on past events. All of this has worked fine until
> > recently. The user that we do this under is a SQL Server login and until
> > recently was a sysadmin. Based on customer requests we have lowered the
> > permissions on this user to be DBO on the databases it needs to backup and
> > restore to and also a member of the dbcreator fixed server role.
> > Everything
> > still works fine except in one case. When the user moves everything to a
> > new
> > SQL Server. When this happens and they try to restore one of the backups
> > to
> > the archive database, after it restores our user is no longer the DBO and
> > has
> > no access to the database. I originally thought this was because the SIDs
> > were different between the two machines so I used the sp_help_revlogin
> > procedure to create the user on the new SQL Server with the SID from the
> > old
> > machine. This worked because I do not see our user as an orphan when
> > running
> > sp_change_users_login but unfortunately this did not fix the problem.
> > After
> > the restore it is still not DBO. I can give our user access again by
> > running
> > sp_Changedbowner after the database restore but that isn't practical for
> > customers especially since it requires sysadmin authority and the need for
> > our user to not be a sysadmin was what prompted this change in the first
> > place. Thanks in advance for any help.
> >
> > Wayne
>
>|||The SQL 2000 SP4 version of sp_changedbowner proc has a hard-coded check for
sysadmin role membership. A possible work-around (unsupported) is to create
a special version of this system proc, changing the role check from
'sysadmin' to 'dbcreator' (see script below). I don't know if this is
palatable in your case but I can't think of another solution.
Backup/restore really isn't intended for routine application functionality
and even 'dbcreator' is a very powerful role.
-- create a system proc (unsupported) --
sp_configure 'allow', 1
GO
RECONFIGURE WITH OVERRIDE
GO
--*** create new sp_changedbowner_dbcreator here ***
GO
EXEC sp_MS_marksystemobject 'sp_changedbowner_dbcreator'
GO
sp_configure 'allow', 0
GO
RECONFIGURE
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Wayne" <Wayne@.discussions.microsoft.com> wrote in message
news:51F9F2CC-E47F-45F0-B9D6-76B21F1E3E02@.microsoft.com...
> Hi,
> I support an application and part of it has an archive function. It takes
> backups of a main database (using the SQL backup command) and saves them
> to
> be restored at a later date to an archive database on the same SQL Server
> instance for reporting on past events. All of this has worked fine until
> recently. The user that we do this under is a SQL Server login and until
> recently was a sysadmin. Based on customer requests we have lowered the
> permissions on this user to be DBO on the databases it needs to backup and
> restore to and also a member of the dbcreator fixed server role.
> Everything
> still works fine except in one case. When the user moves everything to a
> new
> SQL Server. When this happens and they try to restore one of the backups
> to
> the archive database, after it restores our user is no longer the DBO and
> has
> no access to the database. I originally thought this was because the SIDs
> were different between the two machines so I used the sp_help_revlogin
> procedure to create the user on the new SQL Server with the SID from the
> old
> machine. This worked because I do not see our user as an orphan when
> running
> sp_change_users_login but unfortunately this did not fix the problem.
> After
> the restore it is still not DBO. I can give our user access again by
> running
> sp_Changedbowner after the database restore but that isn't practical for
> customers especially since it requires sysadmin authority and the need for
> our user to not be a sysadmin was what prompted this change in the first
> place. Thanks in advance for any help.
> Wayne
I support an application and part of it has an archive function. It takes
backups of a main database (using the SQL backup command) and saves them to
be restored at a later date to an archive database on the same SQL Server
instance for reporting on past events. All of this has worked fine until
recently. The user that we do this under is a SQL Server login and until
recently was a sysadmin. Based on customer requests we have lowered the
permissions on this user to be DBO on the databases it needs to backup and
restore to and also a member of the dbcreator fixed server role. Everything
still works fine except in one case. When the user moves everything to a new
SQL Server. When this happens and they try to restore one of the backups to
the archive database, after it restores our user is no longer the DBO and has
no access to the database. I originally thought this was because the SIDs
were different between the two machines so I used the sp_help_revlogin
procedure to create the user on the new SQL Server with the SID from the old
machine. This worked because I do not see our user as an orphan when running
sp_change_users_login but unfortunately this did not fix the problem. After
the restore it is still not DBO. I can give our user access again by running
sp_Changedbowner after the database restore but that isn't practical for
customers especially since it requires sysadmin authority and the need for
our user to not be a sysadmin was what prompted this change in the first
place. Thanks in advance for any help.
WayneWayne
Well , it is well known issue
Please search on internet for "sp_help_revlogin script" and read the
explanation
"Wayne" <Wayne@.discussions.microsoft.com> wrote in message
news:51F9F2CC-E47F-45F0-B9D6-76B21F1E3E02@.microsoft.com...
> Hi,
> I support an application and part of it has an archive function. It takes
> backups of a main database (using the SQL backup command) and saves them
> to
> be restored at a later date to an archive database on the same SQL Server
> instance for reporting on past events. All of this has worked fine until
> recently. The user that we do this under is a SQL Server login and until
> recently was a sysadmin. Based on customer requests we have lowered the
> permissions on this user to be DBO on the databases it needs to backup and
> restore to and also a member of the dbcreator fixed server role.
> Everything
> still works fine except in one case. When the user moves everything to a
> new
> SQL Server. When this happens and they try to restore one of the backups
> to
> the archive database, after it restores our user is no longer the DBO and
> has
> no access to the database. I originally thought this was because the SIDs
> were different between the two machines so I used the sp_help_revlogin
> procedure to create the user on the new SQL Server with the SID from the
> old
> machine. This worked because I do not see our user as an orphan when
> running
> sp_change_users_login but unfortunately this did not fix the problem.
> After
> the restore it is still not DBO. I can give our user access again by
> running
> sp_Changedbowner after the database restore but that isn't practical for
> customers especially since it requires sysadmin authority and the need for
> our user to not be a sysadmin was what prompted this change in the first
> place. Thanks in advance for any help.
> Wayne|||Thanks Uri,
Ok, just wanted to confirm that is how it is and that I wasn't missing
something.
Wayne
"Uri Dimant" wrote:
> Wayne
> Well , it is well known issue
> Please search on internet for "sp_help_revlogin script" and read the
> explanation
>
>
>
>
> "Wayne" <Wayne@.discussions.microsoft.com> wrote in message
> news:51F9F2CC-E47F-45F0-B9D6-76B21F1E3E02@.microsoft.com...
> > Hi,
> > I support an application and part of it has an archive function. It takes
> > backups of a main database (using the SQL backup command) and saves them
> > to
> > be restored at a later date to an archive database on the same SQL Server
> > instance for reporting on past events. All of this has worked fine until
> > recently. The user that we do this under is a SQL Server login and until
> > recently was a sysadmin. Based on customer requests we have lowered the
> > permissions on this user to be DBO on the databases it needs to backup and
> > restore to and also a member of the dbcreator fixed server role.
> > Everything
> > still works fine except in one case. When the user moves everything to a
> > new
> > SQL Server. When this happens and they try to restore one of the backups
> > to
> > the archive database, after it restores our user is no longer the DBO and
> > has
> > no access to the database. I originally thought this was because the SIDs
> > were different between the two machines so I used the sp_help_revlogin
> > procedure to create the user on the new SQL Server with the SID from the
> > old
> > machine. This worked because I do not see our user as an orphan when
> > running
> > sp_change_users_login but unfortunately this did not fix the problem.
> > After
> > the restore it is still not DBO. I can give our user access again by
> > running
> > sp_Changedbowner after the database restore but that isn't practical for
> > customers especially since it requires sysadmin authority and the need for
> > our user to not be a sysadmin was what prompted this change in the first
> > place. Thanks in advance for any help.
> >
> > Wayne
>
>|||The SQL 2000 SP4 version of sp_changedbowner proc has a hard-coded check for
sysadmin role membership. A possible work-around (unsupported) is to create
a special version of this system proc, changing the role check from
'sysadmin' to 'dbcreator' (see script below). I don't know if this is
palatable in your case but I can't think of another solution.
Backup/restore really isn't intended for routine application functionality
and even 'dbcreator' is a very powerful role.
-- create a system proc (unsupported) --
sp_configure 'allow', 1
GO
RECONFIGURE WITH OVERRIDE
GO
--*** create new sp_changedbowner_dbcreator here ***
GO
EXEC sp_MS_marksystemobject 'sp_changedbowner_dbcreator'
GO
sp_configure 'allow', 0
GO
RECONFIGURE
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Wayne" <Wayne@.discussions.microsoft.com> wrote in message
news:51F9F2CC-E47F-45F0-B9D6-76B21F1E3E02@.microsoft.com...
> Hi,
> I support an application and part of it has an archive function. It takes
> backups of a main database (using the SQL backup command) and saves them
> to
> be restored at a later date to an archive database on the same SQL Server
> instance for reporting on past events. All of this has worked fine until
> recently. The user that we do this under is a SQL Server login and until
> recently was a sysadmin. Based on customer requests we have lowered the
> permissions on this user to be DBO on the databases it needs to backup and
> restore to and also a member of the dbcreator fixed server role.
> Everything
> still works fine except in one case. When the user moves everything to a
> new
> SQL Server. When this happens and they try to restore one of the backups
> to
> the archive database, after it restores our user is no longer the DBO and
> has
> no access to the database. I originally thought this was because the SIDs
> were different between the two machines so I used the sp_help_revlogin
> procedure to create the user on the new SQL Server with the SID from the
> old
> machine. This worked because I do not see our user as an orphan when
> running
> sp_change_users_login but unfortunately this did not fix the problem.
> After
> the restore it is still not DBO. I can give our user access again by
> running
> sp_Changedbowner after the database restore but that isn't practical for
> customers especially since it requires sysadmin authority and the need for
> our user to not be a sysadmin was what prompted this change in the first
> place. Thanks in advance for any help.
> Wayne
Subscribe to:
Posts (Atom)