-
Insert From Select
I dont know why this code is not working (for MS SQL 2000)
DECLARE @Name nVarChar
@Name = SELECT DISTINCT Users.Name FROM Users ORDER BY Users.Name
INSERT INTO Local
(Numb, Name, Level) VALUES (0, @Name , 1)
I want to insert into the table Local all the Distinct Names from Users
the datatype of name :
[Name] [nvarchar] (100) NOT NULL UNIQUE NONCLUSTERED
if the name allready exists in the table Localisation I must jump over the error
how can i do it ?
thank you
Last edited by anselme; 12-07-2006 at 05:12 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|