Monday, March 12, 2012

Insert Statement in SQL 2000

Hi every body i had a question
i want to insert an value well i want to incerment 2 values in my table called
"adsDispalyed","clickedAds" by one each based on their webpage

so i want to send webpage as a parameter to the procedure and i want it to find that sepcificed webpage and incerment relative "adsDispalyed","clickedAds" colum values by one
but i am newbi in this can any one help me what i kind of have is

ALTER PROCEDURE UpdateAdStatus
(
@.webpage nvarchar(50)
)

AS
INSERT INTO AdvertiserProfile
(
BannerClicked,
BannerDisplayed
)
VALUES
(
BannerClicked+1,
BannerDisplayed+1
)

2 things are wrong with this
1- it says i cant have colum name in "value" section what i am trying to do is to say insert into BannerClicked value of BannerClicked plus one
2-@.webpage, how do i create a conditional Insert stament, in this example the conidition is @.webpagewhat is your table structure..

No comments:

Post a Comment