Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Basic Programming Questions

Author  Topic 

TO018
Starting Member

2 Posts

Posted - 2011-04-25 : 14:45:28
I am new to programming and I am stuck on a couple exercises for a class I am in.

The first is asking to create a program that calculates the sum from 1 to 100, and then displays that sum.

The second exercise is to create a program that prints out this:

1 *
2 **
3 ***
4 ****

Any help is greatly appreciated!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-04-25 : 14:47:54
It doesn't sound like you have a SQL question.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

TO018
Starting Member

2 Posts

Posted - 2011-04-25 : 14:52:39
How would I go about writing such programs? We have been using SQL server for our programming.
quote:
Originally posted by tkizer

It doesn't sound like you have a SQL question.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-04-25 : 14:54:21
SQL Server isn't a programming language. You should be writing your programs in things like Java, C#, VB.Net, etc.

To do this in T-SQL, you could use a tally table or similar. A tally table is a table with all integers from some starting number to some ending number. The tally tables that I use are numbered from 1 to 8000.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -