Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6176751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:09:22+00:00 2026-05-24T00:09:22+00:00

Is there a way to validate programmability objects in SQL Server 2008? I have

  • 0

Is there a way to validate programmability objects in SQL Server 2008?

I have a database with ~500 programmability objects which depend on other programmability objects (not only tables).

If I do some refactoring, it is very hard find other objects which are broken by the changes. For example if I change the parameter count…

Original state of database:

CREATE FUNCTION [dbo].[GetSomeText]() RETURNS nvarchar(max) AS BEGIN RETURN 'asdf' END

/* uses "GetSomeText()" function */
CREATE FUNCTION [dbo].[GetOtherText]() RETURNS nvarchar(max) AS BEGIN RETURN [dbo].[GetSomeText]() + '-qwer' END

Now I do some refactoring (add parameter @Num to GetSomeText() function):

ALTER FUNCTION [dbo].[GetSomeText](@Num int) RETURNS nvarchar(max) AS BEGIN RETURN 'asdf' + CAST(@Num as nvarchar(max)) END

Now the function GetOtherText() is broken, because it is calling GetSomeText() function without a required parameter.

Is there a way to get information about this error?

Currently I script every programmability object as ALTER, run the alter script, and check for errors. This way looks to be too complex (and is hard to use in T-SQL only enviroment).

EDIT:

Thanks for answers! I know how to get dependenices or list of all objects.
The problem is in checking the body of object. If I get the dependency, is there other way to check validity than run ALTER script?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:09:22+00:00Added an answer on May 24, 2026 at 12:09 am

    Perhaps you could try introducing some automated database developer/unit testing.

    With 500 SQL objects it would be onerous to go back and ‘retro fit’ for them all. Best approach might be to incrementally create these tests as the need to refactor/change existing APIs/create new SQL objects arises

    These automated tests could then be included as part of your overall continous integration approach. Note for the example given you would still have the issue of finding existing dependencies. But once there was sufficient test coverage the tests should highlight any breaking changes introduced.

    I have created a test tool that might be of use – but there are a number of others out there:

    http://dbtestunit.wordpress.com/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to validate this code I have below? I mean I
Is there a way to have eclipse validate javascript within a <script> block on
Is there any way to validate mappings at compile time? For example, I have
Is there a way to validate on the client side browser whether the size
Is there any way to validate the contents of a CEdit box without subclassing?
Is there some way to validate the image size (height and width) before upload
Is there any way to validate spring context xml files in eclipse? Features like:
Is there any way to validate using DataAnnotations in WPF & Entity Framework?
Is there a way to validate an XML file against a DTD with Qt's
I'm getting warnings about CSS3.0 properties like text-overflow. Is there a way to validate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.