All Forums Extensibility
hvganipineni 14 posts Joined 09/09
09 Nov 2010


We are trying to do the stream shredding of an xml document, and we are stuck at using the procedure SP_REGISTER_SCHEMA, I have tried different ways of using this procedure based on the earlier experience I had with other procedures. But I am not able to get this procedure function properly. Could someone give us an example as to how to use this procedure?


Harsha Ganipineni
Justin.Li 2 posts Joined 12/09
15 Aug 2011

Well, I hope my response is not very late.

SP_REGISTER_SCHEMA registers a schema into a "system" table in user sysxml. It not only insert a schema into that system table but also to consolidate that schema especially when it's a schema including/importing other schema documents. Since it's a procedure on server side, it does not really access file on your client system but files on the server side. So the parameter "schemaLocationURI" indicates something on your database system. However, it's not normal to keep things on your dbs system. Another approach is to put your schema on a web server, and give an http://www.blahblah.whatever/someloacation/yourschema.xsd as your schemaLocationURI. Well, it's a little bit overhit. There is a work around you can try that to consolidate the schema yourself as the examples in the orange document and then call SP_REGISTER_SCHEMA_LITERAL.

Of course, if your schema is a very simple one not including/importing anythings, you can just go ahead to call SP_REGISTER_SCHEMA_LITERAL to save all those troubles mentioned above.

You must sign in to leave a comment.