General information
Forum:
Microsoft SQL Server
Title:
How to use IDENTITY function
Hello ,everyone!
I use IDENTITY function is Error ,I don,t kown how to use IDENTITY()
This is my code:
use taxi
IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'aa')
DROP TABLE aa
GO
declare @Num as tinyint
select @Num=max(CodeId) from c_mz
select IDENTITY (tinyint,@Num ,1 ) AS id_num, MZ into aa from driverTemp where MZ IS NOT NULL group by MZ order by MZ
go
"Line 5 : '@Num' syntax error
Why IDENTITY Arguments "send" cann't use variable
What's wrong?
Help me ,thanks!
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only