Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Location
    Wetaskiwin, Ab, Ca
    Posts
    16

    Unanswered: SQL Statements and Data Types

    This question is probably quite stupid, but I haven't run into a situation like this before and I am still learning SQL.

    I have a database made by a predecessor that has data being dumped into it from another program via SQL. The fields in the tables of this database were all set to text data types, regardless of their real type.

    My question is : if I change the data types to what they should be, will the SQL statements still run without a hitch and just dump the data in anyway?

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Operative word being "should", yes, they should... Obviously, if they are dumping MMV instead of 2005 into a "year" column and you define that column as either an INT or a DATE, then SQL will pitch a fit, while it would happily accept either one as TEXT.

    -PatP

  3. #3
    Join Date
    Sep 2003
    Location
    Wetaskiwin, Ab, Ca
    Posts
    16
    The real crazy thing is the statement is dumping system date and time into text fields and some text into text fields and a tone of ints into text fields.

    I can partially understand why it was done like that at the time, as it was only used for ocassional reports then. But now, 6 years later, we need to pull that data for trending purposes. Perhaps I am being to greedy in wanting some thought to the future?

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by kjohnson
    Perhaps I am being to greedy in wanting some thought to the future?
    At least in most organizations, that is clearly forbidden by company policy. I wouldn't get my hopes up if I were you.

    Anywho, with an attitude like yours (trying to do a good job, in spite of technical and peronnel issues), you'll fit right in around here! feel free to drop by the Yak Corral for an opportunity to "vent your spleen" about issues like that, or just wander about dbforums to give/receive technical support!

    -PatP

Posting Permissions

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