Advertisement

04.17.2007 at 07:59PM PDT, ID: 22517743
[x]
Attachment Details

Stored Procedure or DTS: Create Table identity seed max value from old table identity column

Asked by michael801 in MS SQL DTS, MS SQL Server

Tags: , , , ,

Trying to create a stored procedure that could run on SQL Server Agent, or a DTS package.  
On day 1 of each month, create a new table, with the same structure as last month's table.
Old table would be renamed UPSMM,where MM = month,  while new table would be named UPS01
The application software does not recognize any table not named 'UPS01'
1st column - IDENTITY ; need to use the last identity column value from previous month table as seed value for new month table.  
Remaining 3 columns are pkg_id varchar(5), date_shipped smalldatetime, weight decimal (5.2)
Using SQL Server 2000.
Start Free Trial
 
Loading Advertisement...
 
[+][-]04.17.2007 at 09:17PM PDT, ID: 18929363

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL DTS, MS SQL Server
Tags: identity, procedure, create, seed, table
Sign Up Now!
Solution Provided By: Gokulm
Participating Experts: 2
Solution Grade: B
 
 
[+][-]04.18.2007 at 02:49PM PDT, ID: 18935453

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.18.2007 at 07:04PM PDT, ID: 18936415

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.22.2007 at 02:06PM PDT, ID: 18955187

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.23.2007 at 06:33PM PDT, ID: 18962963

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32