I am trying to do something like this:
DECLARE @MySchema VARCHAR(MAX)
SELECT @MySchema = BulkColumn
FROM OPENROWSET(BULK 'c:\\local\\path\\to\\MySchema.xsd', SINGLE_BLOB) AS x
where the local path is on my machine (or, later, on the build machine — either way, it’s on the machine where the command is actually running) without:
- copying MySchema.xsd to the server running SQL Server 2005,
- creating a file share on the local box,
- assuming that the local box will be running SQL Server, or
- using anything other than T-SQL to perform the task.
Is this possible? If so, how can it be done? If it matters, this is going to be part of an automated build/deployment procedure that will create an XML schema collection on the SQL Server instance.
No, it’s not possible.
If you want to import something into SQL Server, it has to be on that SQL Server machine; or at least on a disk that’s accessible to the SQL Server machine via an UNC path over the network.