Good Morning
I created a little procedure where I add activities to a database table. This is the code I used.
USE dbActivities
GO
CREATE PROCEDURE addActivity
@ActivityDate VARCHAR,
@description VARCHAR,
@maxPeople INT,
@Cost MONEY
AS
BEGIN
INSERT INTO Activity(ActivityDate,Description, MaxPeople, Cost)
VALUES(@ActivityDate, @description, @maxPeople开发者_JAVA技巧, @Cost)
END
GO
I then select the table to view it.
USE dbActivities
GO
CREATE PROCEDURE viewActivities
AS
SELECT * FROM Activity
GO
The strange thing however is that the Description is displayed as only one character in the datatable. So, if I added the description...say "Swimming", when I view the table it is only displayed with one character 'S'.
Why is that?
regards Arian
The VARCHAR
equals to VARCHAR(1)
. Use e.g. VARCHAR(60)
instead.
精彩评论