By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,812 Members | 1,288 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,812 IT Pros & Developers. It's quick & easy.

How to create an "activation code" and store it in sql server 2005 database?

P: n/a
I am making a web application that would randomly create an activation code
and put it in a database. The web application would then send it in an email
to the user with a link to go to and enter the activation code. How would I
do this? and what sql server data type would I use? I want the activation
code to be no longer than 12 characters, have a mix of numbers and letters
and have no special symbols.
Aug 8 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Aug 8, 7:47*am, "Andy B" <a_bo...@sbcglobal.netwrote:
I am making a web application that would randomly create an activation code
and put it in a database. The web application would then send it in an email
to the user with a link to go to and enter the activation code. How wouldI
do this? and what sql server data type would I use? I want the activation
code to be no longer than 12 characters, have a mix of numbers and letters
and have no special symbols.
System.Guid would be the easiest in my opinion.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Aug 8 '08 #2

P: n/a
On Aug 8, 8:08*am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 8, 7:47*am, "Andy B" <a_bo...@sbcglobal.netwrote:
I am making a web application that would randomly create an activation code
and put it in a database. The web application would then send it in an email
to the user with a link to go to and enter the activation code. How would I
do this? and what sql server data type would I use? I want the activation
code to be no longer than 12 characters, have a mix of numbers and letters
and have no special symbols.

System.Guid would be the easiest in my opinion.

Thanks,

Seth Rowe [MVP]http://sethrowe.blogspot.com/
Though I neglected to read the "no longer than 12 characters" part.
Oops.

The benefit of using System.Guid (or Unique Identifier in SQL) is that
you could have SQL Server create the Guids for you and not have to
worry about handling duplicate activation codes. Though if the 12
character rule is a must, this benefit is negated.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Aug 8 '08 #3

P: n/a
Couldn't you have sql server take a sub set of characters of the guid it
creates and use that instead?
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:d5**********************************@l64g2000 hse.googlegroups.com...
On Aug 8, 8:08 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 8, 7:47 am, "Andy B" <a_bo...@sbcglobal.netwrote:
I am making a web application that would randomly create an activation
code
and put it in a database. The web application would then send it in an
email
to the user with a link to go to and enter the activation code. How
would I
do this? and what sql server data type would I use? I want the
activation
code to be no longer than 12 characters, have a mix of numbers and
letters
and have no special symbols.

System.Guid would be the easiest in my opinion.

Thanks,

Seth Rowe [MVP]http://sethrowe.blogspot.com/
Though I neglected to read the "no longer than 12 characters" part.
Oops.

The benefit of using System.Guid (or Unique Identifier in SQL) is that
you could have SQL Server create the Guids for you and not have to
worry about handling duplicate activation codes. Though if the 12
character rule is a must, this benefit is negated.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Aug 8 '08 #4

P: n/a
On Aug 8, 12:49*pm, "Andy B" <a_bo...@sbcglobal.netwrote:
Couldn't you have sql server take a sub set of characters of the guid it
creates and use that instead?

"rowe_newsgroups" <rowe_em...@yahoo.comwrote in message

news:d5**********************************@l64g2000 hse.googlegroups.com...
On Aug 8, 8:08 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 8, 7:47 am, "Andy B" <a_bo...@sbcglobal.netwrote:
I am making a web application that would randomly create an activation
code
and put it in a database. The web application would then send it in an
email
to the user with a link to go to and enter the activation code. How
would I
do this? and what sql server data type would I use? I want the
activation
code to be no longer than 12 characters, have a mix of numbers and
letters
and have no special symbols.
System.Guid would be the easiest in my opinion.
Thanks,
Seth Rowe [MVP]http://sethrowe.blogspot.com/

Though I neglected to read the "no longer than 12 characters" part.
Oops.

The benefit of using System.Guid (or Unique Identifier in SQL) is that
you could have SQL Server create the Guids for you and not have to
worry about handling duplicate activation codes. Though if the 12
character rule is a must, this benefit is negated.

Thanks,

Seth Rowe [MVP]http://sethrowe.blogspot.com/
You'd run a greater risk of getting duplicates is all.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Aug 8 '08 #5

P: n/a
I think that a 25 digit guid can be converted from 25 characters of
Hex.. to what is it, 16 characters of Alpha-Numeric?


On Aug 8, 9:49*am, "Andy B" <a_bo...@sbcglobal.netwrote:
Couldn't you have sql server take a sub set of characters of the guid it
creates and use that instead?

"rowe_newsgroups" <rowe_em...@yahoo.comwrote in message

news:d5**********************************@l64g2000 hse.googlegroups.com...
On Aug 8, 8:08 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Aug 8, 7:47 am, "Andy B" <a_bo...@sbcglobal.netwrote:
I am making a web application that would randomly create an activation
code
and put it in a database. The web application would then send it in an
email
to the user with a link to go to and enter the activation code. How
would I
do this? and what sql server data type would I use? I want the
activation
code to be no longer than 12 characters, have a mix of numbers and
letters
and have no special symbols.
System.Guid would be the easiest in my opinion.
Thanks,
Seth Rowe [MVP]http://sethrowe.blogspot.com/

Though I neglected to read the "no longer than 12 characters" part.
Oops.

The benefit of using System.Guid (or Unique Identifier in SQL) is that
you could have SQL Server create the Guids for you and not have to
worry about handling duplicate activation codes. Though if the 12
character rule is a must, this benefit is negated.

Thanks,

Seth Rowe [MVP]http://sethrowe.blogspot.com/
Aug 11 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.