Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE FUNCTION GetUrlId (@Url nvarchar(400))
- RETURNS int
- AS BEGIN
- DECLARE @UrlId int
- SELECT @UrlId = Id FROM Url WHERE Url = @Url
- RETURN @UrlId
- END
- INSERT INTO
- UrlHistory(UrlId, Visited, RemoteIp)
- VALUES
- (dbo.GetUrlId('http://www.stackoverflow.com/'), @Visited, @RemoteIp)
- stackoverflow.com -> com.stackoverflow
- blog.stackoverflow.com -> com.stackoverflow.blog
Add Comment
Please, Sign In to add comment