Results 1 to 3 of 3

Thread: Execute OPENXML SQL statement dynamically

  1. #1
    Join Date
    Nov 2004
    Posts
    66

    Execute OPENXML SQL statement dynamically

    I am attempting to execute a dynamic SQL statement involving OPENXML. Example:

    'SELECT * FROM OPENXML (' + CAST(@idoc AS VARCHAR(10)) + ', ''' + @RowPattern + ''', 3) WITH (' + @SchemaDeclaration + ')'

    However, SQL Server generates an error when trying to process the @idoc value. The error message is something along the lines of:

    Msg 170 ... "Incorrect syntax near"

    Is there a simply way around this? This is obviously SQL Server 2000, not 2005.

    Your help is appreciated...

  2. #2
    Join Date
    Jan 2009
    Posts
    2

    Just joined

    how do I see the other posts?

  3. #3
    Join Date
    Sep 2002
    Posts
    5,938
    What do you mean?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •