|
>I created an empty database for MySQL: paddock.
CREATE DATABASE PADDOCK;
USE PADDOCK;
|
|
|
|
|
Just a thought, I don't know MySQL, but is there a constraint where you cannot have an object the same name as the database. EF has such a constraint on field/table names.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
sorry. In fact, I created the database paddock in lowercase:
create database paddock;
use paddock;
(I think I was writing some SQL code at that moment with uppercase)
|
|
|
|
|
noislude wrote: I created the database paddock in lowercase: The server doesn't care about upper- or lowercase; the name is case-insensitive. Same goes for tables and column-names.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
The difference between your two statements is the additional key in the second statement. Keys are important for searching data/retrieving data. So it depends on how you would normally get the data from that table.
Also note that a References statement may not cause the creation of a key - I am not sure here with MySQL. So for the JOIN s with the other tables, additional Key s could be appropriate.
|
|
|
|
|
You haven't specified what error you're getting when you run the script.
For a start, you've got two CREATE TABLE IF NOT EXISTS VISIT blocks - only the first one will run.
I'm not overly familiar with MySQL, but in SQL you'd need to include both columns in a single foreign key:
CONSTRAINT PADDOCK_FARM_ID_PADDOCK_NUM_CON (PADDOCK_FARM_ID, PADDOCK_PADDOCK_NUM)
REFERENCES PADDOCK (FARM_FARM_ID, PADDOCK_NUM)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi All,
Im sure this is very simple but after googling for the past 4 hours i cannot seem to find the correct syntax.
I currenly have a SQL which amongst other tables has a DateTime Coloum in the folllowing Format:
2013-09-11 21:06:08:970
I am currently running the follow query from within my C# Application:
select * from table where errorcode = 448
What I would like to do is:
select * from table where errorcode = 448, where date = today
and also
select * from table where errorcode = 448, where date is between 2013-09-11 00:00:00:000 and 2013-09-11 23:59:59:999
I just cant figure out the correct syntax for the queries though.
Could anybody possible Help?
Many Thanks
SG
|
|
|
|
|
Ah, see this where to post it, not the C# forum, and now you've cross-posted. Very naughty.
|
|
|
|
|
Member 10266943 wrote: Im sure this is very simple but after googling for the past 4 hours i cannot seem to find the correct syntax. The syntax is defined in the manual. Google is a general search-engine, and whilst it's helpfull when researching a new topic, it's not the place to be when you simply need a manual.
Member 10266943 wrote: What I would like to do is: select * from table where errorcode = 448, where date = today You'd need to pick up a book on SQL. A statement has a single WHERE clause, and we add in more filters using the AND keyword. Something similar to below;
SELECT col1, col2
FROM sometable
WHERE errorcode = 448
AND somedate = GETDATE() There shouldn't be any columns in the table named "date" as it's a non-descriptive name. Also, "table" and "date" are reserved keywords.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I'm sure I don't understand the question because if you query using "WHERE [date] = '%2013-09-11%'" without any time appendix dangling from it the return will give all strings of the wildcarded nature.
Incidently, noone knows the storage datatype of [date] but the programmer who coded the procedure.
Member 10266943 wrote: the folllowing Format
Really?
Member 10266943 wrote: 2013-09-11 21:06:08:970
Check the format in Object Viewer ...
|
|
|
|
|
|
hello
Im looking for that information on the design and realization of BSC BTS site that can help me
(creates a sql server data or Oracl)
|
|
|
|
|
Member 10259811 wrote: Im looking for that information www.google.com[^].
Veni, vidi, abiit domum
|
|
|
|
|
|
what do i require to make an object-oriented database which links to a website?
fledep
|
|
|
|
|
If you do just a smidgen of research like typing into Google [^] you will find there is plenty of information easily available without someone having to retype it out for you.
Read the guidelines, do some research and then ask sensible questions.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
fledep wrote: object-oriented database which links to a website?
You probably don't. Presumably however that you actually want a website that uses a object oriented database then you do the following
1. Research creating websites
2. Write a website
3. Research object oriented databases.
4. Pick a object oriented database
5. Write a interface layer in 2 to use 4
6. Test, test, test.
|
|
|
|
|
hello everyone,
i am using vb.net2003 ( for a windows application ) along with sql server 2005 i need to display data of a sql procedure whose columns are being generated dynamically. The problem arise when i want to give header of flexgrid as i am not able to find out how many sql column will be retrieved/generated after the execution of the procedure and what their headers will be (i.e column name as i am using pivot to generate column from a temp table in which n number of distinct values can appear as rows, which will be used in pivot for which n number of column fields will be generated accordingly ). As i have to give header of grid and number of column is unknown , i am struck here...Plz help
ashish sharma
|
|
|
|
|
The short answer is if the columns are being generated dynamically and you don't know what columns will be there, guess what neither will .Net be able to work this out!
However if you return the results of the stored procedure into a Datatable you will be able to iterate through the Columns collection -> clickety[^]
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
GuyThiebaut wrote: , guess what neither will .Net be able to work this out!
Most modern databases provide a way to query for most or even all of the meta data associated with the database.
SQL Server provides a way to query for table column names.
|
|
|
|
|
The OP says:
"i need to display data of a sql procedure whose columns are being generated dynamically"
Because the columns are being generated "dynamically" there is no way to retrieve the meta data relating to the SP before the SP is run.
Also meta data relating to SPs pretty much only extends to getting the input parameters.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
GuyThiebaut wrote: "i need to display data of a sql procedure whose columns are being generated dynamically"
Misread that. I thought they were using tables which had been created by some runtime process.
|
|
|
|
|
You've got a good point there - as there is some ambiguity in the word dynamic.
I just answered the question based on how I dynamically generate columns in SPs - so yes,. if the columns were generated through the .net code or based on some meta data in a table it would be possible to know information regarding the columns before they were generated.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Please don't crosspost, and don't repeat a question without additional information.
The FlexGrid is part of Visual Studio 6. It should die along with VB6. In VB.NET, one would use the DataGridView. Once you fetch the data, you can get the schema information from the datareader.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
If you have a temporary table you can use
select * from tempdb.sys.columns where object_id = object_id('tempdb..#yourtable');
you can create a header.
From here there are a couple of ways to handle the data and not being very good at VB.NET I will let you handle that.
|
|
|
|