|
under2811 wrote:
I have one table having two primary keys
You cannot have two primary keys. Unless you mean that you have a primary key with two columns.
You can have as many unique and non-unique indexes as you wish using what ever combination of columns you wish (including using the same column in two, or more, indexes). As I recall, there is a maximum of 16 columns per index.
under2811 wrote:
If i take these columns then what that cost on performance of query wheather time required to run query is more or less or no effect?
The only impact on performance by adding extra indexes is when you do an INSERT, UPDATE and DELETE commands because these will result in the indexes changing. Obviously SELECT statements get faster because they can use the indexes to get at the data they need more efficiently.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Hello friends!!
Here I am giving you some details of table and indexes
CREATE TABLE TEST_EMP (
SSN VARCHAR(9) NOT NULL,
CCODE VARCHAR(4) NOT NULL,
GRADE VARCHAR(2) NULL,
CONSTRAINT GRADE_SSN_CCODE_PK
PRIMARY KEY CLUSTERED (SSN, CCODE),
EMPID VARCHAR(5) NOT NULL,
EMPNAME VARCHAR(10))
--------------------------------------------
NOW I WANT TO ADD TWO COLUMNS MORE WHICH FREQUENTLY USED IN JOIN CONDITION for select & insert i.e.
AUTONUMBER int
MODIFIEDDATE DATETIME
NOW I WANT TO CREATE ANOTHER Index (IX_TEST_EMP)
FOR COLUMNS
SSN
CCODE
AUTONUMBER
MODIFIEDDATE
so including that two columns(SSN and CCODE) which already have index (GRADE_SSN_CCODE_PK),
will that cause more cost on query or that doesnot matter?
and if I exclude these two columns(SSN and CCODE) then wheather my select and insert clause
will cause same cost as when i include these two columns(SSN,CCODE)?
T.I.A
Shashank
|
|
|
|
|
I want to create strong passwords. I read an article on the Microsoft website a while ago where they said that strong passwords consisted of upper case and lower case letters, numbers, and symbols. And the symbols they mentioned are ` ~ ! @ # $ % ^ & * ( ) _ + - = { } | [ ] \ : " ; ' < > ? , . /
But some of these symbols can be used in SQL statements. Which of these symbols are not advised to be used as part of your password?
Thanks
|
|
|
|
|
|
Hi,
I need to alter column size of particular table with constraints, table which has primary key and referred to another table.
I have used like this "alter table my_table_name alter column my_column_name varchar(50)"
It shows me error as
Server: Msg 5074, Level 16, State 8, Line 7
The object 'PK_DiagnosisSummary' is dependent on column 'my_column_name'.
Server: Msg 5074, Level 16, State 1, Line 7
The index 'my_column_name' is dependent on column 'Code'.
Server: Msg 5074, Level 16, State 1, Line 7
The object 'FK__Diagnosis__DiagC__51DA19CB' is dependent on column 'my_column_name'.
Server: Msg 4922, Level 16, State 1, Line 7
ALTER TABLE ALTER COLUMN Code failed because one or more objects access this column.
Let me know how to alter field size of this table with constraints and indexed.
Be simple and Be sample.
|
|
|
|
|
|
Hi,
I am struggling in using dataset or traditional dataReader in ADO.Net.
It seems to me that if I use the dataset (direct bind it to UI), then the dataset will replace the object model layer, so it seems only good for simple application development without much object model logic.
If I insert a object layer
above the dataset, then it seems no difference from the traditional
approach by using DataReader with SQL query. Then what is the goodness
of dataset ?
And if I use dataset, the cached data by read/write in the dataset will be lost if the application hang, so the cached data by read/write should be restricted within the scope of one transaction.
Are all my perceptions on using dataset above right ? Any comments?
Thanks
|
|
|
|
|
I've create a software that uses microsoft access 2003, better it manage with ado.net a .mdb database.
To distribuite that application have to have got the final user Microsoft Access to get working the applicationo or it is not need?
|
|
|
|
|
No
the clients only need JET driver on their machines (can be obtained freely from microsoft).
|
|
|
|
|
Hi
I'm having trouble installing SQL CE. It is installed, and i can see the sql query analyzer icon, once i run that. The normal SQL CE screen comes up, but there's no tools options at the bottom. Have I installed in wrong or is it something else.
Thanks
Rossi46 -> The Doctor
|
|
|
|
|
Now that i have my database connected and my acces page doing what it needs to do...I am ready to introduce the world to my database...But how do i get the User Interface to be up all the time without building it over and over...i just want to pull it up type the entry in and update my database...but for now i can only do it on the computer i made it on...You see i am ready to put it on the computer for everyday use.......
|
|
|
|
|
Hey there,
I have two datasets with exactly the same tables and exactly the same columns. I want to merge the second dataset into the first dataset, but i want to maintain the original row version of the first dataset.
ds1.Merge(ds2, true, MissingSchemaAction.Ignore) only changes the Original Row version of ds1's rows and ds1.Merge(ds2, false, MissingSchemaAction.Ignore) changes both Original AND current value... is there no way to change only the Current version of a row??
I cannot ds2.Merge(ds1) because i have a modified dataset class which inherits datasets but also maintain a connection to a database. ds1 and ds2 are both connected to diffrent databases and changing the connection after merge doesn't work ;-(
|
|
|
|
|
thinking one step beyond solves the problem, which means I've already got a solution...
for this interested, you need two merges...
ds2.merge(ds1, true, MissingSchemaAction.Ignore)
ds1.merge(ds2, false, MissingSchemaAction.Ignore)
|
|
|
|
|
Hi!
I have written my own datatable merge function. It merges 2 datables, adding ew clumns to the source if those dont exists, and also append the new rows to the source. Hope my code is of help to you?
Michiel Erasmus
MaxCredible B.V.
Nieuwezijds Voorburgwal 44
1012 SB Amsterdam
Postbus 11079
1001 GB Amsterdam
Postbus 11079
1001 GB Amsterdam
T: +31(0)20-3449070
F: +31(0)20-3449071
I: http://www.maxcredible.com
<br />
#region MergeDataTables(), merge 2 datatables.<br />
<br />
public DataTable MergeDataTables(DataTable dtInput, DataTable dtOutput)<br />
{<br />
return MergeDataTables(dtInput, dtOutput, false);<br />
}<br />
<br />
public DataTable MergeDataTables(DataTable dtInput, DataTable dtOutput, bool addNewRowsToMerged)<br />
{<br />
if(dtInput == null)<br />
{<br />
return dtOutput;<br />
}<br />
<br />
try<br />
{<br />
if(dtOutput == null)<br />
{<br />
dtOutput = dtInput.Clone();
<br />
if(dtOutput == null)
{<br />
return dtOutput;<br />
}<br />
}<br />
<br />
try<br />
{<br />
foreach(DataColumn dc in dtInput.Columns)<br />
{<br />
if(dtOutput.Columns[dc.ColumnName] == null)<br />
{<br />
dtOutput.Columns.Add(dc.ColumnName, dc.DataType);<br />
}<br />
}<br />
}<br />
catch<br />
{<br />
string strTijdelijk;<br />
strTijdelijk = "dummy";<br />
}<br />
<br />
foreach(DataRow drInput in dtInput.Rows)<br />
{<br />
DataRow drOutput;<br />
<br />
if(dtOutput.Rows.Count == 0 || addNewRowsToMerged)<br />
{<br />
drOutput = dtOutput.NewRow();
}<br />
else<br />
{<br />
drOutput = dtOutput.Rows[0];<br />
}<br />
<br />
drOutput.BeginEdit();<br />
<br />
foreach(DataColumn dcInput in dtInput.Columns)<br />
{<br />
try
{<br />
drOutput[dcInput.ColumnName] = drInput[dcInput.ColumnName];
}<br />
catch<br />
{<br />
string strTijdelijk;<br />
strTijdelijk = "dummy";<br />
}<br />
}<br />
<br />
drOutput.EndEdit();<br />
if(dtOutput.Rows.Count == 0 || addNewRowsToMerged)<br />
{<br />
dtOutput.Rows.Add(drOutput);<br />
}<br />
dtOutput.AcceptChanges();<br />
}<br />
dtOutput.AcceptChanges();<br />
}<br />
catch(Exception ex)<br />
{<br />
throw new Exception(ex.Message + "; Stacktrace=" + ex.StackTrace, ex);<br />
}<br />
<br />
return dtOutput;<br />
}<br />
#endregion<br />
met vriendelijke groet,
Michiel Erasmus
|
|
|
|
|
Ziet er op zich wel OK uit, maar denk dat het niet een oplossing was geweest voor mijn probleem. Ik heb een selectie van data die ik uit de database trek, op een laptop zet en zonder database connectie wijzig. Daana wil ik een sync doen van de data terug naar de db. Ik heb dan twee identieke datasets (qua structuur dan) alleen is de 'sql' dataset gevuld met oude data, en de 'nieuwe' dataset gevuld met de up-to-date data. Ik moet in de 'sql' dataset dan wel de gewijzigde rijden bijhouden (nieuwe, gewijzigde en verwijderde) om aan een adapter door te geven wat hij in mijn db moet wijzigen... moeilijk verhaal allemaal (waarschijnlijk omdat ik het onhandig uitleg) maar vooral door de AcceptChanges kan ik de wijzigingen niet meer terugvinden en ben ik dus alsnog de row states kwijt.. echter, de oplossing was al gevonden middels een dubbele merge..
|
|
|
|
|
When I set a password to my access db.
myCon = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb;Password=password");
myCon->Open();
I get a exception error.
"The workgroup information file is missing or opened exclusively by another user"
..but when I remove it, it open ok. What other param's I need to set in order to open a password protected access db?
|
|
|
|
|
if its the database password and not tied to specific users then try the following connection string
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & sFullPath & ";Mode=ReadWrite;Persist Security Info=False; Jet OLEDB:Database Password=" & sPassword
Where sFullPath is the full path and filename of the db and sPassword is the db password.
Jon
|
|
|
|
|
Guys/Gals,
I've not been able to find a "neat", reliable way to fill a DataTable with the results of a DirectorySearcher. I tried multiple variations of the available DataAdapters that I could find, but none seemed to be "adaptable"... (I made a funny!)
Anyway, I'm trying to stay away from a direct LDAP call to AD, and use the DirectorySearcher/SearchResults. I wouldn't think that it would be too difficult. I'm sure there's some way that the Framework will let me do this.
Your assistance is greatly appreciated...
-Ted
|
|
|
|
|
I am in need of a third party tool for a database import/export.
I need to do these operations from a database (say mysql) to an other one (say ms sql). Can anybody suggest me an other option except MS Enterprise Manager from SQl Serv 2000? It would grately help if that application is a free one (gpl).
Thank you.
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
Enterprise Manager won't talk to MySql.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Actualy I managed to make "it talk to mysql" through ODBC adapters.
So my question remains. Can anybody help me?
All I need is a application that can read all the data from a database in a specific server and write it to an other server (like from MS sql 2000 to mysql)
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
Hi guys,
I've got a smart client application that allows the user to change, create, or delete data that's stored in an MSDE SQL database. I've rolled my own messaging queue so that the when a client updates lots of data at a time (e.g. deletes 500 rows of data, create 2 rows, update 100 rows), I send a batch message to my server application containing 602 sub-messages describing what happened (in other words, one big message containing all the actual messages describing what happened). This way I only have to go over the network from client to server only 1 time.
All that works great.
My problem is that now that the "delete 500, create 2, update 100" batch message is on the server, I have to call a stored procedure in the database for each message: call RemoveRow stored proc 500 times, call CreateRow 2 times, call UpdateRow 100 times.
Using the ANTS .NET profiler to look at my code, it is apparent that this execution of several hundred stored proc calls is a bottleneck. Is there any way to allow the MSDE database to execute a batch of commands all at once? Or better yet, is there a better way of doing this?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
Hi all
A database question.
Say for example I have a Suppliers table and a Products table in my database. If theoretically each supplier can supply millions of products what would be the most efficient and convenient?
Having a different Products table for each supplier, or a single Products table holding products of all suppliers. If the first option is better would it not be very tricky querying the data for reports and so on?
Thanks again.
Kobus
|
|
|
|
|
kbalias wrote:
what would be the most efficient and convenient?
That depends on how you are going to use the data. You can split the data by supplier and have a partitioned view to stich it back as if it were one big table - you can then query through the view.
Personally, I would keep it as one supplier table and one products table unless you run into performance problems then do work on eliminating the performance issues. I find that second guessing SQL Server on performance is often counter productive because the usage patterns are often not what was originally envisaged.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
I have a column with type datetime in an employee's table. I want to delete the records that older than 3 working days. The problem is I can't use getdate()-3 in where clause because I don't know about the holidays and all.. Can anyone help me out ?
Regards,
Zishan
|
|
|
|