Click here to Skip to main content
15,915,508 members
Home / Discussions / Database
   

Database

 
GeneralRe: Design question - adding soft links to tables Pin
RyanEK20-Aug-13 12:29
RyanEK20-Aug-13 12:29 
Suggestionsql server2012 Pin
rajeshi4you19-Aug-13 5:35
rajeshi4you19-Aug-13 5:35 
AnswerRe: sql server2012 Pin
Maciej Los19-Aug-13 8:35
mveMaciej Los19-Aug-13 8:35 
QuestionConverting Val function in access to SQL Server Pin
Morore_Charles_00719-Aug-13 4:25
Morore_Charles_00719-Aug-13 4:25 
AnswerRe: Converting Val function in access to SQL Server Pin
GuyThiebaut19-Aug-13 4:43
professionalGuyThiebaut19-Aug-13 4:43 
GeneralRe: Converting Val function in access to SQL Server Pin
Morore_Charles_00719-Aug-13 21:05
Morore_Charles_00719-Aug-13 21:05 
GeneralRe: Converting Val function in access to SQL Server Pin
GuyThiebaut19-Aug-13 21:41
professionalGuyThiebaut19-Aug-13 21:41 
AnswerRe: Converting Val function in access to SQL Server Pin
Simon_Whale19-Aug-13 5:13
Simon_Whale19-Aug-13 5:13 
QuestionRe: Converting Val function in access to SQL Server Pin
Maciej Los19-Aug-13 8:38
mveMaciej Los19-Aug-13 8:38 
QuestionCan use SQL Server 2005 to Connection (link table) mySQL table ? Pin
Member 245846718-Aug-13 18:15
Member 245846718-Aug-13 18:15 
AnswerRe: Can use SQL Server 2005 to Connection (link table) mySQL table ? Pin
Mycroft Holmes18-Aug-13 19:41
professionalMycroft Holmes18-Aug-13 19:41 
AnswerRe: Can use SQL Server 2005 to Connection (link table) mySQL table ? Pin
Simon_Whale18-Aug-13 20:09
Simon_Whale18-Aug-13 20:09 
GeneralRe: Can use SQL Server 2005 to Connection (link table) mySQL table ? Pin
Mycroft Holmes18-Aug-13 21:18
professionalMycroft Holmes18-Aug-13 21:18 
GeneralRe: Can use SQL Server 2005 to Connection (link table) mySQL table ? Pin
Member 245846719-Aug-13 20:37
Member 245846719-Aug-13 20:37 
QuestionMS Access SQL: Turn rows into column Pin
Katvillan18-Aug-13 10:09
Katvillan18-Aug-13 10:09 
AnswerRe: MS Access SQL: Turn rows into column Pin
Mycroft Holmes18-Aug-13 11:45
professionalMycroft Holmes18-Aug-13 11:45 
QuestionOOP Pin
candz_kritz18-Aug-13 0:30
candz_kritz18-Aug-13 0:30 
AnswerRe: OOP Pin
Richard MacCutchan18-Aug-13 1:27
mveRichard MacCutchan18-Aug-13 1:27 
AnswerRe: OOP Pin
PIEBALDconsult18-Aug-13 5:21
mvePIEBALDconsult18-Aug-13 5:21 
AnswerRe: OOP Pin
Eddy Vluggen18-Aug-13 6:54
professionalEddy Vluggen18-Aug-13 6:54 
AnswerRe: OOP Pin
SaqibRasheed18-Aug-13 11:30
SaqibRasheed18-Aug-13 11:30 
QuestionMySQL view definition oddity Pin
PIEBALDconsult15-Aug-13 8:01
mvePIEBALDconsult15-Aug-13 8:01 
Much of my current job involves combining data from various sources into one SQL Server database. One of the sources is a MySQL database and I have noticed something odd.
One of the first steps I take when I get access to a new data source is to investigate the schema. As a fan of ADO.net and database-agnosticism, my main tools for doing this are:
System.Data.Common.DbConnection.GetSchema() , System.Data.Common.DbConnection.GetSchema(string) , and System.Data.IDataReader.GetSchemaTable()
which every compliant ADO.net provider should implement.
The way I use GetSchemaTable is to cobble up a SELECT * FROM name WHERE 0=1 query for each table and view, call ExecuteReader, call GetSchemaTable, and display the results.
The WHERE 0=1 clause is intended to keep the server from doing a bunch of needless work, but just return an empty dataset. This works, but I have since found that it hides problems -- mostly related to views that are out of sync with their sources. So I removed the WHERE clause and was surprised that one column in one of the MySQL views was reported as Int64 rather than Int32 as it is when I use the WHERE clause.
I got the latest version of the MySQL Connector/net and the situation persists.

What I then found, by using GetSchema("VIEWS"), is that the column is defined like IF((id IS NOT NULL),id,NULL) AS 'id' (id is involved in a JOIN among several tables).
I don't have access the tables so I don't know what type the actual field is. And I see comments on the Web that IF can return unexpected types. I have been unable to reproduce the oddity in my own test database.

But my question is, "why use the IF function in this case?" How is this better than just returning id whether it's NULL or not? Is there some historical reason?
AnswerRe: MySQL view definition oddity Pin
Jörgen Andersson15-Aug-13 8:44
professionalJörgen Andersson15-Aug-13 8:44 
GeneralRe: MySQL view definition oddity Pin
PIEBALDconsult15-Aug-13 10:21
mvePIEBALDconsult15-Aug-13 10:21 
GeneralRe: MySQL view definition oddity Pin
Jörgen Andersson15-Aug-13 11:02
professionalJörgen Andersson15-Aug-13 11:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.