November 24, 2016 at 11:53 am
Running this:
INSERT INTO [dbo].RichTest
SELECT doc.col.value('(.)[1]', 'nvarchar(50)')
FROM @RichTests.nodes('/macs/mac') AS doc(col)
WHERE NOT EXISTS (SELECT 1 FROM [RichTest] WHERE [Name] = doc.col.value('(.)[1]', 'nvarchar(50)')
Getting this:
System.Data.SqlClient.SqlException: Database 'Doc' cannot be opened because it is offline.
Notes:
When this is run in SSMS, it fails with DB 'Doc' error outlined above
Select @@version gives
Microsoft SQL Server 2008 (SP3) - 10.0.5538.0 (X64)
November 24, 2016 at 1:15 pm
richard.wanamaker (11/24/2016)
Running this:INSERT INTO [dbo].RichTest
SELECT doc.col.value('(.)[1]', 'nvarchar(50)')
FROM @RichTests.nodes('/macs/mac') AS doc(col)
WHERE NOT EXISTS (SELECT 1 FROM [RichTest] WHERE [Name] = doc.col.value('(.)[1]', 'nvarchar(50)')
Getting this:
System.Data.SqlClient.SqlException: Database 'Doc' cannot be opened because it is offline.
Notes:
When this is run in SSMS, it fails with DB 'Doc' error outlined above
Select @@version gives
Microsoft SQL Server 2008 (SP3) - 10.0.5538.0 (X64)
What do you get when you run this query?
😎
SELECT
SDB.name
FROM sys.databases SDB
WHERE SDB.NAME = N'Doc';
November 24, 2016 at 1:19 pm
He he, didn't read the post properly:w00t:
😎
Can you post an example of the XML stored in the @RichTests variable?
November 25, 2016 at 4:15 am
It is a passed in xml variable:
@RichTest xml=null
November 25, 2016 at 4:26 am
Additional info:
This is failing just on the creation of the Stored Procedure and works in all other implementations for SS (various versions from 2005 through 2014)
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply