If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > SQL Statements and Data Types

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-09-05, 16:49
kjohnson kjohnson is offline
Registered User
 
Join Date: Sep 2003
Location: Wetaskiwin, Ab, Ca
Posts: 16
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?
Reply With Quote
  #2 (permalink)  
Old 02-09-05, 16:57
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
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
Reply With Quote
  #3 (permalink)  
Old 02-09-05, 17:10
kjohnson kjohnson is offline
Registered User
 
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?
Reply With Quote
  #4 (permalink)  
Old 02-09-05, 17:35
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On