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 7022721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:37:07+00:00 2026-05-27T23:37:07+00:00

I’m working on a local and a remote SQL Server instance with SSMS. I

  • 0

I’m working on a local and a remote SQL Server instance with SSMS. I create a tiny function like:

create function ufnTestFunc ()
returns int
begin
    return 1
end

When I try to ‘modify’ it, or choose ‘script function as -> alter’, I get an error like:

Script failed for UserDefinedFunction ‘dbo.ufnTestFunc’.
(Microsoft.SqlServer.Smo)

– Syntax error in TextHeader of UserDefinedFunction ‘ufnTestFunc’.
(Microsoft.SqlServer.Smo)

This also happens on already existing functions. What may be the reason?


Notes:

  • All the functions work as intended
  • I can script the function as ‘create’ with no problem.
  • It’s not related with comments, as there are no comments in the test function
  • Same happens with different DBs on the remote server

Local Server:
Microsoft SQL Server Express Edition (64-bit) – 10.50.2500.0

Remote Server:
Microsoft SQL Server Web Edition (64-bit) – 10.50.1600.1

SSMS:

Microsoft SQL Server Management Studio    10.50.2500.0
Microsoft Data Access Components (MDAC)   6.1.7601.17514
Microsoft MSXML                           3.0 6.0 
Microsoft .NET Framework                  2.0.50727.5448
  • 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-27T23:37:08+00:00Added an answer on May 27, 2026 at 11:37 pm

    Ok like someone mentioned before, but with a little difference.

    The problem is the AS keyword. Although the AS keyword before the function content is optional, SSMS can’t handle functions without it. They work, but make trouble. It’s a bug and not mentioned anywhere in the BOL.

    I normally use the AS keyword, but this time the DB is from a previous coder, who didn’t use it. In my test function I also didn’t use it to make the function as small as possible.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I want to construct a data frame in an Rcpp function, but when I
I'm trying to create an if statement in PHP that prevents a single post

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.