Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No insert with insert into
Message
De
15/02/2009 23:17:27
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
No insert with insert into
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01382021
Message ID:
01382021
Vues:
67
This is some standard code I am executing from time to time:
SET IDENTITY_INSERT [Issue] ON
IF EXISTS(SELECT * FROM Test.dbo.Issue)
	 EXEC('INSERT INTO Issue  (
[Date],[Released],[Url],[Numero],[AddUser],[AddDate],[ModUser],[ModDate])
		SELECT [Date],[Released],[Url],[Numero],[AddUser],[AddDate],[ModUser],[ModDate]
                   FROM [Issue] WITH (HOLDLOCK TABLOCKX)')
SET IDENTITY_INSERT [Issue] OFF
If I do:
SELECT * FROM Test.dbo.Issue
I have some records.

If I do:
SELECT * FROM Issue
I have no record, which is normal.

So, the goal here is to populate the table Issue from the one containing records from the Test database. However, when I execute that, there is no error but no record gets inserted. What am I missing?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform