Showing posts with label schema. Show all posts
Showing posts with label schema. Show all posts

Wednesday, March 7, 2012

Cannot transfer schemabound object - error

I am trying to alter the AdventureWorks database to transfer ownership from one schema to another...

Alter schema dbo transfer Person.CountryRegion

I get the following error..

"Cannot transfer a schemabound object."

Any help would be appreciated.Person.CountryRegion has foreign key references and an indexed view referencing it. So you need to resolve those before trying to transfer ownership. In this case, it looks like you have to drop the index on the view, perform the transfer and create the index back.

Cannot start SQL Server 2005 service

I have a SQL Server 2005 instance installed. I have created databases and
schema on the SQL Server. I cannot start the service for the SQL Server. I
ahve tried using every account possible. It always errors out with the
following message:
initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating system error = 5(Access is
denied.).
The event ID in the application log is 17058.
Also the following error message appears in the system log
The SQL Server (MSSQLSERVER) service terminated with service-specific error
17058 (0x42A2).
Please help, there is not a lot of information out there on this issue
ThanksThe error message is pretty straight forward. Does the SQL Server service account have permissions
on that folder? Did you change the service account after installation. Changing service account
should only be done using the "SQL Server Configuration Manager" applet.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"batgirl" <batgirl@.discussions.microsoft.com> wrote in message
news:BAEDC4F7-3F13-44BB-8394-63B2BDC5A638@.microsoft.com...
>I have a SQL Server 2005 instance installed. I have created databases and
> schema on the SQL Server. I cannot start the service for the SQL Server. I
> ahve tried using every account possible. It always errors out with the
> following message:
> initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating system error = 5(Access is
> denied.).
> The event ID in the application log is 17058.
> Also the following error message appears in the system log
> The SQL Server (MSSQLSERVER) service terminated with service-specific error
> 17058 (0x42A2).
> Please help, there is not a lot of information out there on this issue
> Thanks
>
>|||The SQL Service acoount does have permissions on that folder. The service
account was not changed. The SQL Server was working fine. It was down for a
couple of days and then the service started giving this errors.
--
batgirl
"Tibor Karaszi" wrote:
> The error message is pretty straight forward. Does the SQL Server service account have permissions
> on that folder? Did you change the service account after installation. Changing service account
> should only be done using the "SQL Server Configuration Manager" applet.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "batgirl" <batgirl@.discussions.microsoft.com> wrote in message
> news:BAEDC4F7-3F13-44BB-8394-63B2BDC5A638@.microsoft.com...
> >I have a SQL Server 2005 instance installed. I have created databases and
> > schema on the SQL Server. I cannot start the service for the SQL Server. I
> > ahve tried using every account possible. It always errors out with the
> > following message:
> >
> > initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL
> > Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating system error = 5(Access is
> > denied.).
> >
> > The event ID in the application log is 17058.
> > Also the following error message appears in the system log
> >
> > The SQL Server (MSSQLSERVER) service terminated with service-specific error
> > 17058 (0x42A2).
> > Please help, there is not a lot of information out there on this issue
> > Thanks
> >
> >
> >
>|||Though, this means the error doesn't reflect reality. How about if you log on to the machine
interactively and try to access that folder? And add, read etc to a file in the directory...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"batgirl" <batgirl@.discussions.microsoft.com> wrote in message
news:4EEB5F4B-E834-4681-A9A8-917402FE4149@.microsoft.com...
> The SQL Service acoount does have permissions on that folder. The service
> account was not changed. The SQL Server was working fine. It was down for a
> couple of days and then the service started giving this errors.
> --
> batgirl
>
> "Tibor Karaszi" wrote:
>> The error message is pretty straight forward. Does the SQL Server service account have
>> permissions
>> on that folder? Did you change the service account after installation. Changing service account
>> should only be done using the "SQL Server Configuration Manager" applet.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "batgirl" <batgirl@.discussions.microsoft.com> wrote in message
>> news:BAEDC4F7-3F13-44BB-8394-63B2BDC5A638@.microsoft.com...
>> >I have a SQL Server 2005 instance installed. I have created databases and
>> > schema on the SQL Server. I cannot start the service for the SQL Server. I
>> > ahve tried using every account possible. It always errors out with the
>> > following message:
>> >
>> > initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL
>> > Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating system error = 5(Access is
>> > denied.).
>> >
>> > The event ID in the application log is 17058.
>> > Also the following error message appears in the system log
>> >
>> > The SQL Server (MSSQLSERVER) service terminated with service-specific error
>> > 17058 (0x42A2).
>> > Please help, there is not a lot of information out there on this issue
>> > Thanks
>> >
>> >
>> >
>>|||I have already tried that, it did not help. The only thing that has changed
on the machine is it's IP address. It is a test machine, I was going to
uninstall and reinstall SQL 2005 but it will not even let me uninstall. I
have no idea what to do next
Thanks
--
batgirl
"Tibor Karaszi" wrote:
> Though, this means the error doesn't reflect reality. How about if you log on to the machine
> interactively and try to access that folder? And add, read etc to a file in the directory...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "batgirl" <batgirl@.discussions.microsoft.com> wrote in message
> news:4EEB5F4B-E834-4681-A9A8-917402FE4149@.microsoft.com...
> > The SQL Service acoount does have permissions on that folder. The service
> > account was not changed. The SQL Server was working fine. It was down for a
> > couple of days and then the service started giving this errors.
> > --
> > batgirl
> >
> >
> > "Tibor Karaszi" wrote:
> >
> >> The error message is pretty straight forward. Does the SQL Server service account have
> >> permissions
> >> on that folder? Did you change the service account after installation. Changing service account
> >> should only be done using the "SQL Server Configuration Manager" applet.
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://www.solidqualitylearning.com/
> >> Blog: http://solidqualitylearning.com/blogs/tibor/
> >>
> >>
> >> "batgirl" <batgirl@.discussions.microsoft.com> wrote in message
> >> news:BAEDC4F7-3F13-44BB-8394-63B2BDC5A638@.microsoft.com...
> >> >I have a SQL Server 2005 instance installed. I have created databases and
> >> > schema on the SQL Server. I cannot start the service for the SQL Server. I
> >> > ahve tried using every account possible. It always errors out with the
> >> > following message:
> >> >
> >> > initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL
> >> > Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating system error = 5(Access is
> >> > denied.).
> >> >
> >> > The event ID in the application log is 17058.
> >> > Also the following error message appears in the system log
> >> >
> >> > The SQL Server (MSSQLSERVER) service terminated with service-specific error
> >> > 17058 (0x42A2).
> >> > Please help, there is not a lot of information out there on this issue
> >> > Thanks
> >> >
> >> >
> >> >
> >>
> >>
>|||Hmm, if the directory exists with the exact same name as in the error message and the service
account indeed has permissions, then you seem to have some serious problem with the installation. I
know you can get some strange errors with compressed drives...
In what way doesn't the uninstall work? Error messages? I know that there is a KB article on how to
manually uninstall 2000, perhaps there is one for 2005 as well?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"batgirl" <batgirl@.discussions.microsoft.com> wrote in message
news:6CACF67A-FC57-4722-A6E8-B12B81D36DB9@.microsoft.com...
>I have already tried that, it did not help. The only thing that has changed
> on the machine is it's IP address. It is a test machine, I was going to
> uninstall and reinstall SQL 2005 but it will not even let me uninstall. I
> have no idea what to do next
> Thanks
> --
> batgirl
>
> "Tibor Karaszi" wrote:
>> Though, this means the error doesn't reflect reality. How about if you log on to the machine
>> interactively and try to access that folder? And add, read etc to a file in the directory...
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "batgirl" <batgirl@.discussions.microsoft.com> wrote in message
>> news:4EEB5F4B-E834-4681-A9A8-917402FE4149@.microsoft.com...
>> > The SQL Service acoount does have permissions on that folder. The service
>> > account was not changed. The SQL Server was working fine. It was down for a
>> > couple of days and then the service started giving this errors.
>> > --
>> > batgirl
>> >
>> >
>> > "Tibor Karaszi" wrote:
>> >
>> >> The error message is pretty straight forward. Does the SQL Server service account have
>> >> permissions
>> >> on that folder? Did you change the service account after installation. Changing service
>> >> account
>> >> should only be done using the "SQL Server Configuration Manager" applet.
>> >>
>> >> --
>> >> Tibor Karaszi, SQL Server MVP
>> >> http://www.karaszi.com/sqlserver/default.asp
>> >> http://www.solidqualitylearning.com/
>> >> Blog: http://solidqualitylearning.com/blogs/tibor/
>> >>
>> >>
>> >> "batgirl" <batgirl@.discussions.microsoft.com> wrote in message
>> >> news:BAEDC4F7-3F13-44BB-8394-63B2BDC5A638@.microsoft.com...
>> >> >I have a SQL Server 2005 instance installed. I have created databases and
>> >> > schema on the SQL Server. I cannot start the service for the SQL Server. I
>> >> > ahve tried using every account possible. It always errors out with the
>> >> > following message:
>> >> >
>> >> > initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL
>> >> > Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating system error = 5(Access is
>> >> > denied.).
>> >> >
>> >> > The event ID in the application log is 17058.
>> >> > Also the following error message appears in the system log
>> >> >
>> >> > The SQL Server (MSSQLSERVER) service terminated with service-specific error
>> >> > 17058 (0x42A2).
>> >> > Please help, there is not a lot of information out there on this issue
>> >> > Thanks
>> >> >
>> >> >
>> >> >
>> >>
>> >>
>>

Tuesday, February 14, 2012

Cannot schema bind function 'fn_xxxx' because it contains an EXECUTE statement

Does anyone have any pointers on this error message?
Funny thing is that no where in the SQL documentation does it say that an
EXEC is not allowed in a function with SCHEMABINDING option set.Dynamic SQL is not allowed within a function at all, schemabinding or not...
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Steve Clark" <steve3264@.hotmail.com> wrote in message
news:e8o#nMX4EHA.4092@.TK2MSFTNGP14.phx.gbl...
> Does anyone have any pointers on this error message?
>
> Funny thing is that no where in the SQL documentation does it say that an
> EXEC is not allowed in a function with SCHEMABINDING option set.
>|||The rules for the allowable constructs in functions are not well documented.
This one is almost there though. EXEC is only permitted if it references an
extended proc (or another function - but that's pretty much redundant).
Extended procs reside in Master but schema binding requires that "All
objects referenced by the function must be in the same database as the
function". So as documented, you could only ever create functions containing
EXEC as schemabound if they were in Master... but in reality that doesn't
seem to work either - not that it would be very useful anyway... :)
As Aaron says, dynamic SQL isn't permitted in functions ever. Nor are calls
to regular SPs.
--
David Portas
SQL Server MVP
--

Cannot schema bind function 'fn_xxxx' because it contains an EXECUTE statement

Does anyone have any pointers on this error message?
Funny thing is that no where in the SQL documentation does it say that an
EXEC is not allowed in a function with SCHEMABINDING option set.
Dynamic SQL is not allowed within a function at all, schemabinding or not...
http://www.aspfaq.com/
(Reverse address to reply.)
"Steve Clark" <steve3264@.hotmail.com> wrote in message
news:e8o#nMX4EHA.4092@.TK2MSFTNGP14.phx.gbl...
> Does anyone have any pointers on this error message?
>
> Funny thing is that no where in the SQL documentation does it say that an
> EXEC is not allowed in a function with SCHEMABINDING option set.
>
|||The rules for the allowable constructs in functions are not well documented.
This one is almost there though. EXEC is only permitted if it references an
extended proc (or another function - but that's pretty much redundant).
Extended procs reside in Master but schema binding requires that "All
objects referenced by the function must be in the same database as the
function". So as documented, you could only ever create functions containing
EXEC as schemabound if they were in Master... but in reality that doesn't
seem to work either - not that it would be very useful anyway...
As Aaron says, dynamic SQL isn't permitted in functions ever. Nor are calls
to regular SPs.
David Portas
SQL Server MVP