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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 declaring and updating variables

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-06-19 : 08:31:19
hrubesh writes "itemcode is the PK- which am using s to insert
s is not incrementing, how to do this?

declare @s as int
set @s=0
INSERT INTO [Costing].[dbo].[Item]
([ItemName]
,[ItemCode]
,[TypeCode]) SELECT [a],@s, 'CA' FROM [master].[dbo].[XLImport3]
set @s =@s+1"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-19 : 08:36:00
Refer point 1
http://weblogs.sqlteam.com/mladenp/archive/2005/08/01/7421.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -