Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BEGIN
- DBCC CHECKIDENT (Numbers, RESEED, 0)
- DECLARE @Starter INT, @Ender INT, @CHARACTER CHAR(1), @Counter INT
- SET @Starter = 0
- SET @Ender = 1100
- SET @Counter = 0
- --Loop from 0 to 1100
- WHILE (@Starter < @Ender)
- BEGIN
- --Increase the Starter and the Counter with one for each iteration
- SET @Starter = @Starter + 1
- SET @Counter = @Counter +1
- --Here, we set the char value with the @Counter value
- SET @CHARACTER = CHAR(96+@Counter)
- --We finaly insert into the ColTwo column
- INSERT INTO Numbers (ColTwo) VALUES (@CHARACTER)
- --Once we reach 'z', reset the Counter
- IF @Counter = 26
- BEGIN
- SET @Counter = 0
- END
- END
- END
- --A Simple store proc. to count all soft vowels
- CREATE PROC sp_ShowAllSoftVowels
- AS
- BEGIN
- SELECT COUNT(ColTwo) AS [Soft Vowels] FROM NUMBERS WHERE ColTwo IN ('a', 'e', 'o', 'u')
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement