|
Thanks for the reply. Your suggestions are similiar to the previous response and I have the same questions.
Actually, you anticipated the problem with the Attributes table, but it applies to the Tasks table as well. That problem is: What is the type of the field that identifies the Task or Attribute? What does your Tasks table look like? What is the field that identifies the task (TaskName?)? I suppose one could use a string, but then I have to know those strings when I do my SELECTs. This doesn't seem right.
This is how/why I arrived at tables for each task: the table itself implied that it only contained employees who perform the given task. This also eliminated the problem of attributes for a given task. But this design yields tables containing only one field and that didn't seem right either.
Thanks again for the reply and any more suggestions are welcome.
|
|
|
|
|
Four tables
Employees
ID
Employee details....
Tasks
ID
Task details....
Task Attributes
ID
TaskID
Attribute details....
LinkEmpTask
ID
EmployeeID
TaskID
Link file is a many to many relationship table. A task can have many attibute, an employee can do many tasks and a task can be done by many employees. This is a basic normalisation excercise and examples can be in any textbook
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
OK, this has same possibilities, but...
What (type) is the Tasks.TaskDetails field? Put another way: What identifies the task as a bricklayer, cook, or brain surgeon? I suppose a string would be OK...
The same questions apply to the TaskAttributes.AttributeDetails field, though it is more complicated here. For instance, how do I represent a cook's specialty (Italian, Chinese) as well as a brain surgeon's preferred nurse? Also, how do I represent mutliple attributes for a single task? Again, I am wondering about the type of the field. A string can be used, but then you probably end up encoding information in the string (e.g. "Specialty: Italian").
Thanks for the feedback.
|
|
|
|
|
You need to do some basic study on relational data structures, these question would all be answered. Rule 1, your IDs should have NO MEANING except to identify a record. EG where you see an ID field it should be an identity integer field and the primary key index (index is optional). Your tables will have additional fields for descriptions etc.
Your cook structure requires a knowledge of your requirements and goals. This is where you get a professional if it is a commercial project or some training if it is personal. I can make suggestions but there will always be a "what about/if" that someone not involved will not be able to answer.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
how to use SQL language to destroy SQL Server 2000?
I just kidding with a friend.
|
|
|
|
|
?!
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
ChinaTJBoy wrote: I just kidding
Huh? Don't litter garbage like this all over the forum.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
But, why would you destroy SQL server 2000?
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|
|
My Virtual memory size is increasing when i am using Insert operation and select operation.
which is leading to hang the system.
It is prompting that the virtual size is low. system will increase the virtual size.
Kindly help to come out of this problem.
|
|
|
|
|
Are you using transactions during this processing ? If so, you need to ensure that you are issuing a commit periodically.
|
|
|
|
|
Hi I am Doing Insert and Select operations.
And the 30 records per second will be inserted.
|
|
|
|
|
that really didnt answer his question, he was asking about logging, if you issue a commit the log should get truncated so it wont just keep growing. however i've only had problems with that makeing a system low on disk space not virtual memory or ram. if you are running SQL Server 2k it wants 2gb of memory and will take all it can find..the 64bit version wants 4GB..and i imagine the newer versions take even more.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
no iam not doing any logging.
|
|
|
|
|
you might not be logging, but did you turn it off for the database on the server? it will automatically log inserts and updates, so that if you or something cancels the query that is bieng run it can roll back any changes. you can disable it but i've never done so and was told that it was a pain, and can cause issues. If you have any indecies on those tables you'll have to rebuild them unless your data is in order when its bieng inserted, either way the indecies will slow down inserts and if they've been corrupted will slow down any table scan, select, update etc..
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Logging, logging, what logging, BBbbrrrrr [fires up the chain saw] wheres the log I'll truncate the bloody log for you....
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i would have loved to use a chain saw on our damn dev server the other day..my boss was updating 3 columns based on a 4th column in a table with over 400M rows, and the database was 23gb w/ a logfile 36gb and the array it was sitting on had 8MB left on it, we were wondering why the command wouldnt finish...but thats on SQL Server 2k, hopefully the new ones do it differently. cant wait for the new dev server 2TB of storage.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hello All,
I have a table with some Columns. I am inserting the records in this table by bulk insert query. The problem is that in the last column the data is inserted by name with FIELDTERMINATOR $. I just need to wirte a query by which I can remove this $ and just have name in that column.
Any suggestions...
Thanks in advance...
|
|
|
|
|
To this and your other question below.
What is the row delimiter used in the file? If it's a newline, just add
BULK INSERT dbo.tb_DEMO
FROM 'C:\DEMO08Q1.TXT'
WITH
(
FIELDTERMINATOR ='$'
ROWTERMINATOR = '$\n'
)
BTW, does your file have only 1 row?
|
|
|
|
|
hello SimulationofSai,
Thanks for the reply. Its working now. File contains almost 104411 rows.
I did this :
BULK INSERT dbo.tb_DEMO
FROM 'C:\DEMO08Q1.TXT'
WITH
(
FIRSTROW = 2
,FIELDTERMINATOR ='$'
,ROWTERMINATOR = '$\n'
)
FirstRow = 2 solved my first problem and ur suggestion helped me to solve my 2nd problem.
Thanks again...
|
|
|
|
|
Anyone know or use a tool that let's you point it at a table in a DB and it will then generate a SQL script for you that drops/creates all the indexes on the table? Thanks.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
Chris Meech wrote: Anyone know or use a tool that let's you point it at a table in a DB and it will then generate a SQL script for you that drops/creates all the indexes on the table? Thanks.
SQL Management Studio?
You've to script twice, once for drop and once for create. And when you script a table, it'll also script CREATE TABLE which you've to remove manually.
Yeah, it can't be done in one step. But it's not too complicated either...
|
|
|
|
|
Sorry, I should have mentioned that it's not for SQL Server, but for Oracle specifically, though I was hoping for a tool that would be database 'agnostic'.
I done lots of Google searching and found lots of scripts that will tell me how to determine what indexes are defined, but I'm searching for something that goes a step further and puts a drop/create script together for me. Though I also know that may be kind of tough when it comes to unique/primary keys for a table. Thanks, though.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
There are a number of tools out there, TOAD is one, used to be for Oracle only but I think it is agnostic now. A goole search should turn up plenty (paid), I don't know of any free ones.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: TOAD is one, used to be for Oracle only but I think it is agnostic now.
Yes, it also works with MS SQL Server now. A nice tool to have around
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hello All,
I am developing a Windows Service in which I download some data from net. Data which I download is in text file. Text file contains the data and column name of the Table and is seperated by $.
Something like this :
C1$C2$C3$C4$C5$C6$C7$C8$C9$C10$C11$C12$C13$C14$C15$C16$C17$C18$C19$C20$C21$C22$C23$
5476771$6638853$I$$5476771-2$$$20071003$DIR$$$$$$N$$$20071003$OT$$N$N$UNITED STATES$
5476957$6689344$I$$5476957-7$20070927$$20071002$DIR$$$59$YR$F$N$142$LBS$20070930$OT$$N$Y$UNITED STATES$
I worte the following Query for Bulk Insert:
BULK INSERT dbo.tb_DEMO
FROM 'C:\DEMO08Q1.TXT'
WITH
(
FIELDTERMINATOR ='$'
)
I am facing 2 problems in this:
1: I have to delete the column Names from the file and then fire this query.
2: If I delete the column Names then it works but in the last column the data is inserted with $. example: UNITED STATES$
Please help me....
Thanks in Advance.
|
|
|
|