开发者

Activity displayed as one character only

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜