473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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

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
5 3200
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Oliver Stratmann | last post by:
Hello All, could anyone give me a clou about the above reason code? (Database Version 7.2 UDB on a Windows 2000 Machine) This is what i did: <Begin-Quote> db2 => insert into e_deka_einzel...
5
by: apple | last post by:
UDBV8 fp 6a - AIX 5.1 We have scheduled cron jobs to do backups. Periodically and starting to occur more frequently, a backup fails with this error: SQL2072N Unable to bind the shared library...
30
by: (Pete Cresswell) | last post by:
Just fired it up to see what it looked like. They wanted me to "Activate" the product before the 50th use. Geeze, I paid my money....now they want me to jump through their hoops? Brings back...
2
by: mike_li | last post by:
On Window 2000 Professional Server DB2 UDB Level: DB2 code release "SQL07029" with level identifie "030A0105" and informational tokens "DB2 v7.1.0.98", "n040510" and "WR21337". In the...
4
by: jason.awlt | last post by:
Greetings, I recently being bugged by the following error on my DB2. SQL0902C SQLSTATE = 58005 Reason Code = 14 This error comes out everytime i tried to insert some record to a table...
1
by: Rudolf Bargholz | last post by:
Hi, We have created triggers to log modifications to tables in our application. The triggers work fine, just on one of the tables in our database the triggers fail with the error message...
1
by: Andy B | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.