Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No insert with insert into
Message
From
15/02/2009 23:17:27
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
No insert with insert into
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01382021
Message ID:
01382021
Views:
68
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
Next
Reply
Map
View

Click here to load this message in the networking platform