09 diciembre 2007

CTE Expressions en SSIS

Hace algunas semanas a mi compañera Elizabeth Córdova le sucedió algo bastante extraño al intentar usar “expresiones CTE” en uno de sus paquetes, pueden ver el siguiente link para ver más de CTE http://msdn2.microsoft.com/en-us/library/ms190766.aspx.

Lo extraño del caso es que logró usar CTEs en sus paquetes en el entorno de desarrollo pasando la validación en tiempo de diseño que hace SSIS sin problema alguno tal como se muestra en la siguiente imagen:




Pero como se ve en la siguiente imagen, esto no funcionaba cuando movía el paquete al entorno de producción donde el OLEDB Source Component daba el siguiente mensaje de error cuando se quería hacer una vista preliminar de la data obtenida por el query:


Como ven, el mensaje de error menciona un error de sintaxis con el mensaje “Statement could not be prepared””Incorrect sintax near the keyword with” y finalmente la solución sugerida que dice ”if this is a CTE the previous statement must be terminated with a semicolon”, o mejor dicho cierre la expresión anterior con un punto y coma (;).

Finalmente el problema se solucionó poniendo el famoso punto y coma al inicio de la expresión CTE, algo como “; WITH Temp (……” (thanks to Jamie Thomson for his help and fast response!). Como empecé este post, lo extraño del caso es que en el entorno de desarrollo el paquete pasa la validación sin el punto y coma, pero en producción sí lo requiere. Obviamente lo único que podemos pensar es en alguna configuración diferente entre ambos entornos. Ambos tienen SQL 2005 SP2 y Windows Server 2003 SP1. Las ediciones de SQL usadas son Development y Enterprise respectivamente. Las ediciones de Windows 2003 también son Standard y Enterprise respectivamente.

Alguien sabe a ciencia cierta la explicación detallada para este funcionamiento irregular??

Alan.

24 comentarios:

  1. This information really worth saying, i think you are master of the content and thank you so much sharing that valuable information and get new skills after refer that post.
    Python Training in Chennai

    ResponderEliminar
  2. Great article, really very helpful content you made. Thank you, keep sharing.

    Application Quality Management Services | Austere Technologies

    ResponderEliminar
  3. Very good informative article. Thanks for sharing such nice article, keep on updating such good articles.

    Internet Of Things Services | IOT | Austere Technology Solutions

    ResponderEliminar
  4. MSBI is the newest powerful and useful tool used for business analysis. Thank you for sharing with us.

    Python Training in Chennai
    Python Training institute in Chennai

    ResponderEliminar
  5. Needed to compose one little word yet thanks for the suggestions that you are contributed here...
    Best Online Software Training Institute | Artificial Intelligence Training

    ResponderEliminar
  6. Great article, really very helpful content you made. Thank you, keep sharing.

    Best Degree Colleges Hyderabad | Avinash College of Commerce

    ResponderEliminar
  7. Really great blog, it's very helpful and has great knowledgeable information.

    Best Blockchain services | Massil Technologies

    ResponderEliminar
  8. Very Informative blog thank you for sharing. Keep sharing.

    Best software training institute in Chennai. Make your career development the best by learning software courses.

    informatica classes in chennai
    cloud computing courses in chennai
    rpa training in chennai

    ResponderEliminar