Code Monkey home page Code Monkey logo

Comments (3)

pbolduc avatar pbolduc commented on September 13, 2024

I spent some time looking at this problem. When I used DacExplorer, I can see the column is defined as a ComputedColumn and type type references the origin table's column. My guess is the correct way to determine the view's column type is to look up the data type of the source table's column.

from sqlsharpener.

aeslinger0 avatar aeslinger0 commented on September 13, 2024

Not sure if we can loop through the source columns used in the expression, but if we can we might be able to derive a type that will work. For example, if all columns are int then use int, else if all are numeric, but at least one is decimal or float then use float, else if any are a string then use string.

I think a work-around might be to wrap your expression in the view with CAST as in Cast((col1 + col2) as int) AS ColName.

from sqlsharpener.

chad206548 avatar chad206548 commented on September 13, 2024

I received a similar error in any table script where a column is a calculated column. I ended up having to modify my T4 to simple ignore any table that had a calculated column, as I tried multiple solutions to try to get it to work with the calculated column but had no luck.

from sqlsharpener.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.