How can I resolve the following error when I try to script out some procs. In SSMS I right click the db and I choose 'Tasks > Generate Script', then I select 10 stored procs (without changing any of the default options). If I don't include the proc mentioned in the error below, then it works OK.
TITLE: Microsoft.SqlServer.SqlEnum
Failed to retrieve dependency information (object_id(System.Int32) 1271727633.object_type(System.Int16) 4.relative_id(System.Int32)
1879729799.relative_type(System.DBNull) .object_name(System.String) usp_SEL_RCEPCompanyHistory.object_schema(System.String)
dbo.relative_name(System.DBNull) .relative_schema(System.DBNull) .).
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476
ADDITIONAL INFORMATION:
Specified cast is not valid. (Microsoft.SqlServer.SqlEnum)
Please help us understand what kind of object caused the problem better by running the following queries and telling us what do they return.
select * from sys.objects where object_id = xxxx
select * from sys.sql_dependencies where object_id = xxxx or referenced_major_id=xxxx
select * from sys.assembly_modules where object_id = xxxx
You want to replace xxxx with the number that shows in the error message after relative_id.
Thanks,
Ciprian Gerea
|||
The object is a user-defined aggregate function ('Microsoft.Samples.SqlServer.Concatenate'). I think this problem has already been submitted in feedback here:
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=125881
|||I set up my machine as directed in the above issue report, using our current sp2 build, and was unable to reproduce the error reported here.
It may be the case that the two feedback items are evidence of two issues, with distinct repro scenarios, but I am assuming that we have fixed this, and that you can expect to see it in the upcoming release of sql server sp2.
|||I was experiencing the same type of error. Your script above was helpful to me in identifying the SQL_dependencies for the procs that was throwing the errors. It turns out in my situation there were procs which were referencing the service queue objects and for what ever reasons it did not like those procs. I excluded those procs from my script generator and it worked.
No comments:
Post a Comment