开发者

Activity displayed as one character only

开发者 https://www.devze.com 2023-03-19 13:20 出处:网络
Good Morning I created a little procedure where I add activities to a database table. This is the code I used.

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

精彩评论

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

关注公众号