Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXECUTING/RUN A PROCEDURE

Status
Not open for further replies.

ijitnoin

Programmer
Jan 26, 2006
18
US
Sorry, no message was sent on the last thread. I hit the Enter Key.

After creating the procedure, as follows:
Create Procedure x
@Y datetime
Set nocount off
Select mmm, nnn FROM dbo.ttt
WHERE ttt.date = @Y
Set nocount on
GO
EXEC x 1

You can not tell what happen, no output/result/listing is seen or prompt is made for unkown value/date - @Y.
 
What you expect?
You execute this SP with @y=1 and get exactly the expected result, all records in dbo.ttt which have date equal to 02 Jan 1900 00:00 :)

Borislav Borissov
 
1 is not a useful date, see below
select convert(datetime,1) ='1900-01-02 00:00:00.000'

change WHERE ttt.date >= @Y and you will get back records

Also that code should give an error since you are missing 'as' after Create Procedure x
@Y datetime



Denis The SQL Menace
SQL blog:
Personal Blog:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top