Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Parameter in SQL Server Stored Procedure

Posted on 2008-06-26
3
Medium Priority
?
255 Views
Last Modified: 2010-04-21
I have the following lines in a stored procedure:


GO
CREATE PROCEDURE [dbo].[spBct_PhnxMrtgee_DeleteEndorsement]
(@PolicyNumber varchar(20), @EndorsementIdentifier varchar(3), @SequenceNumber smallint  null, @PolicyDateTime datetime)
AS

I have a database field that is defined as smallint NULL in the database called SEQUENCE_NUMBER.

When I am creating the parameter above, you can see may attempt to define this.  I am getting errors.  Does anyone know the correct syntax for this?

THanks,

JD

0
Comment
Question by:jamesdean666
3 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 1000 total points
ID: 21878130
try this:

CREATE PROCEDURE [dbo].[spBct_PhnxMrtgee_DeleteEndorsement]
(@PolicyNumber varchar(20), @EndorsementIdentifier varchar(3), @SequenceNumber smallint  = null, @PolicyDateTime datetime)
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 1000 total points
ID: 21878131
CREATE PROCEDURE [dbo].[spBct_PhnxMrtgee_DeleteEndorsement]
(@PolicyNumber varchar(20), @EndorsementIdentifier varchar(3), @SequenceNumber smallint =  null, @PolicyDateTime datetime)
0
 

Author Closing Comment

by:jamesdean666
ID: 31471148
Thanks.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
Integration Management Part 2
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question