question

Noonies avatar image
Noonies asked

Generate a specified number of UIDs in SSRS or any other suggested tool

Hi again! I need to create incremental ID's that are unique in a table. These ID's will be used in a column to link to a barcode software program. The ID's and barcodes will be Code 128 and will increment by one. I need a way to allow a business user to specify a number of barcodes needed and click a button and generates the specified amount of ID's in the table. The column is called CodeID. For ex.) I need 250 ID's generated. I type 250, maybe in SSRS, and a script is ran to create 250 uniqueID's in the SQL table. From there an application is linked to the column data source and auto-generates the barcode piece. I'm trying to get the ID's portion working. I'm just not sure how to write the code to specify row creations. Hope I expained this clearly! Thank you in advance for assitsance.
automationidentity-column
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Chris shaw avatar image
Chris shaw answered
I am not sure that SSRS is the tool you are looking for. A couple questions for you. I assume that these ID's are all going to be issued by one system since you did not specify otherwise. The other columns in the table, can you share those with us to include the nullability, and default values? Where my head goes with this first is to create a procedure that will allow you to pass it in a number of ID's that you need created. Depending on the other data in the table those ID's could be generated, assigned, and used, and then the data updated once you have the bar code. I am making a lot of assumptions here. I am curious as to what other people think.
3 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi Chris! Thanks for the quick response. There are two other tables which are ItemType and ItemID. These will be NULL during the creation of ID's and later the ID's will be assigned to product. The ID's will be issued by one system. My starting point with this is just having the ID's created and ready for use when an in-house item arrives it will be assigne to that particular item then the record will be updated.
0 Likes 0 ·
We would use the software Bartender to print the ID's as barcodes. The application will allow us to assign the column ID's to the barcode image as a data source and print. That is why I am trying to generate a set number of ID's. I could write VBScript within the barcode properties of the Barteneder software but I'm not very familiar with VBScript to write to a database.
0 Likes 0 ·
If I understand this correctly it sounds like VBScript may be the way to go. You could generate a stored proc that you pass along to it the number of rows to insert. You could then create that number of records in your proc, but leave the data null. One thing you may want to keep in mind and the bigger your table get the more important this becomes. If your table is full of var data types your might end up splitting a number of pages during your update process.
0 Likes 0 ·
Shawn_Melton avatar image
Shawn_Melton answered
Well since you brought up using a script, why not go with PowerShell:

function Get-CodeID ($qty, $start)
{
	"Your quantity needed is: $qty"
	"Your starting number is: $start"
	$endSequence = $start + $qty
	$sequence = $start..$endSequence
	"Your array of numbers is: "
	$sequence
}
This is just a function to show how it could be done, not necessarily the way it should be in your circumstance. PowerShell also offers fairly easy process of getting the information into a database (SQL Server at least). This script takes the starting number you give it and just does basic match. Using the ".." will then tell PowerShell to generate the sequence between the start and ending number. An example result of this function should be below if attachments work right for pictures... ![alt text][1] [1]: http://www.flickr.com/photos/wsmelton/6730923911/
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

And no picture is attached of course...
0 Likes 0 ·
judy321 avatar image
judy321 answered
To generate specific [barcodes in SSRS 2008][1], you may add a barcode generation dll and use the following sample code: [1]: http://www.barcodelib.com/net_barcode/barcode_symbologies/barcode_microsoft_reporting_service2008.html
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.