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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:26:51+00:00 2026-06-01T00:26:51+00:00

Like Oracle, SQL Server supports parameter defaults in stored procedures. Oracle syntax: CREATE OR

  • 0

Like Oracle, SQL Server supports parameter defaults in stored procedures. Oracle syntax:

CREATE OR REPLACE PROCEDURE p_default (
  p_in_number   IN  number   := 0,
  p_out_number  OUT number,
  p_in_varchar  IN  varchar2 := '0',
  p_out_varchar OUT varchar2,
  p_in_date     IN  date     := date '1981-07-10',
  p_out_date    OUT date
)

SQL Server syntax:

CREATE PROCEDURE p_default (
  @p_in_number       INTEGER = 0,
  @p_out_number      INTEGER OUT,
  @p_in_varchar      VARCHAR(10) = '0',
  @p_out_varchar     VARCHAR(10) OUT,
  @p_in_date         DATE = '1981-07-10',
  @p_out_date        DATE OUT
)

With Oracle, I can discover defaults using this query:

SELECT argument_name, defaulted FROM all_arguments WHERE object_id = :proc_id

How can I discover this in SQL Server selecting from sys or INFORMATION_SCHEMA tables? I don’t see any useful column in INFORMATION_SCHEMA.PARAMETERS, and the sys.parameters.has_default_value seems not to be set correctly (!)

Note, I have asked as similar question about DB2:

Discover DB2 procedure default parameters using SYSCAT tables

  • 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-06-01T00:26:52+00:00Added an answer on June 1, 2026 at 12:26 am

    There’s no simple way to do it. As the documentation for has_default_value states:

    SQL Server only maintains default values for CLR objects in this catalog view; therefore, this column has a value of 0 for Transact-SQL objects. To view the default value of a parameter in a Transact-SQL object, query the definition column of the sys.sql_modules catalog view, or use the OBJECT_DEFINITION system function.

    So you’d have to pull the whole stored proc definition out and parse it yourself to determine the value.


    Side note: I’d be wary of @p_in_date DATE = '1981-07-10'. I know that the date datatype is a bit more sensible than datetime, but I’m not sure if the above is still ambiguous – certainly if it was converted to datetime, it may result in 10th July or 7th October, depending on language settings. I’d be more comfortable with '19810710' which will always be interpreted as 10th July.

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

Sidebar

Related Questions

I am converting SQL Server stored procedures to Oracle. In SQL Server you can
In Oracle, when writing dynamic SQL one does something like this: create or replace
I have a hierarchical table on Oracle pl/sql. something like: create table hierarchical (
We have an application that currently supports Oracle and SQL Server databases. We're in
where i can download oracle system views like sql server system views map ?
Does Oracle let me include columns to index (like SQL Server INCLUDE clause in
Is there a reason why Oracle is case sensitive and others like SQL Server,
Our application supports SQL Server and Oracle as database backend. During investigation stuff database
I'm writing SQL (for Oracle) like: INSERT INTO Schema1.tableA SELECT * FROM Schema2.tableA; where
I would like to share my Oracle SQL Developer configuration across my several computers

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.