|
I'd immediately rule out the second option. You should always try to avoid storing multiple values in a single column.
Assuming the data is meant to be a set of look-ups for other records, I'd also try avoid the first option. Put each list in its own table - Departments, Roles, etc. That way, you'll be able to define foreign key relationships from the tables that reference them.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
It is a complex system where I don't know upfront what all possible reference list may exist in the runtime environment. Also, these value will never be referenced from any other table or column. A kind of auto-suggest list and user is always free to choose new value if not like any of the suggestions.
|
|
|
|
|
Listen to Richard, I recently got told that us old folks did not know the modern way of doing things the "architect" want to put all the lookup data into 1 table. He ended up with 5 table and a dogs breakfast of different relationships maintained in the business layer and not the database where I wanted it.
Use 1 table for each different type of lookup data, use a primary key (not a code) and foreign keys.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am new to the Pivot operator in SQL Server.
I see that the Pivot operator requires an aggregate function in order to work.
However, I need to pivot a text column, and I can't find any examples that show how to do it.
Am I barking up the wrong tree, or is there a way to pivot a text column?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
Thank you, Richard.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
As long as you never have more than one value per row and column it doesn't matter very much which function you use as long as it works with text. (Min, Max or user defined).
But depending on your data it might be possible to get more than one value per cell, then you need to choose what to show. That's what the aggregate function is for.
|
|
|
|
|
Thank you Jörgen.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
This is a call for resources.
I have been to 2 interviews recently and totally blew the technical written tests that involved SQL and SQL Server.
Though I've used SQL and done database design in the past, my current role hasn't afforded me any substantial experience in the last 5 or 6 years.
Can you recommend any books or online courses on SQL, T-SQL, and SQL Server programming to get me back up to speed?
I was on Amazon and found a bunch, but I figure you people would know better.
Cheers,
Mike Fidler
"I intend to live forever - so far, so good." Steven Wright
"I almost had a psychic girlfriend but she left me before we met." Also Steven Wright
"I'm addicted to placebos. I could quit, but it wouldn't matter." Steven Wright yet again.
|
|
|
|
|
|
Thanks. Looks great. I signed up.
Cheers,
Mike Fidler
"I intend to live forever - so far, so good." Steven Wright
"I almost had a psychic girlfriend but she left me before we met." Also Steven Wright
"I'm addicted to placebos. I could quit, but it wouldn't matter." Steven Wright yet again.
|
|
|
|
|
Hi
How to get information from one database.
like only required columns by select * from sys.sysdatabase
|
|
|
|
|
|
Your question is not very clear.
Are you after certain columns from the sys.sysdatabase view?
Are you after looking at certain information about a database?
Are you looking at comparing tables within one or more databases?
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Hello All,
I am trying to schedule to run a trace file, around 12:30am to 1:00am. Our client is sending us some data, that we need to analyze.
With that said, i can see we can set an "Enable Trace stop time", on the file, but not able to find an option to set the begin time?
Is there a way we can do this in the SQL Profiler?
Thanks!
|
|
|
|
|
|
VK19 wrote: Our client is sending us some data, that we need to analyze.
Why would you need to schedule this? Is the 'client' putting the data directly into the database?
|
|
|
|
|
Client sends us the data between 12:30am and 1:00am EST.
|
|
|
|
|
Not sure that answers the question.
Is the client themselves directly putting data into your database?
Or do they send you 'something" (file, stream, etc) which is then processed by your (company) code and that process itself puts the data in the database?
Or could be that your code is pulling something from the client, processing it, and then putting it in the database.
|
|
|
|
|
Sorry - the second option, wherein the client sends us a file, with test cases. Apparently one test case at a time. Our company then processes this test case and inserts into our database.
thanks!!
|
|
|
|
|
So then you can do the following
1. Keep the file
2.During the day run the same process/processes on that in a development environment.
3.Profile the applications and turn on tracing every where you can.
4. Analyze the results.
5. Update as needed based on 4 including the possibility of modify the process/processes to provide addition trace data so you can further refine and define future problems.
|
|
|
|
|
Hi
I wrote this code in notepad ++ :
<?php
ini_set("memory_limit",-1);
$myArray = Array();
$connection = mysqli_connect("localhost","my_user","my_password","my_db");
$result = mysqli_query($connection, "SELECT * FROM tablename");
while(($row = mysqli_num_rows($result))== null){
array_push($myArray,$row);
}
echo json_encode($myArray);
mysqli_close($connection );
?>
And run it with wamp localhost . Then I got this error in my browser :
Fatal error: Out of memory (allocated 408944640) (tried to allocate 805306376 bytes) in D:\...\page1.php on line 10
What's problem ? Can anybody says ?
|
|
|
|
|
The problem is that you are trying to create some variable that is too big for the amount of available memory. Most likely you are extracting too many records from the database.
|
|
|
|
|
Ok Thanks , Now What's the true format of this code ?
|
|
|
|
|
The true format is to understand how computers handle and store information, and not to assume that memory is infinite.
|
|
|
|