Search Results

Search found 5380 results on 216 pages for 'primary'.

Page 5/216 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • SQL SERVER Create Primary Key with Specific Name when Creating Table

    It is interesting how sometimes the documentation of simple concepts is not available online. I had received email from one of the reader where he has asked how to create Primary key with a specific name when creating the table itself. He said, he knows the method where he can create the table and then [...]...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • CakePHP. How can i make a model test in a table with another primary key?

    - by Marcelo
    I have this table CREATE TABLE myexamples.problems ( id INT, name VARCHAR(45) NULL , pk_id INT AUTO_INCREMENT PRIMARY KEY ); But when I try test a model in cakephp, it fails because the table has two autoincrement attributes. The following query CREATE TABLE `test_suite_problems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(45) DEFAULT NULL, `pk_id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`pk_id`) ) DEFAULT CHARSET=latin1, COLLATE=latin1_swedish_ci, ENGINE=InnoDB; raise this error: "1075: Incorrect table definition; there can be only one auto column and it must be defined as a key" I have in the model class <?php class Problem extends AppModel { var $name = 'Problem'; var $displayField = 'name'; var $primaryKey='problems'; } ?> But I don't know how to make the field ID not having an autoincrement attribute, and I can't change the table structure.

    Read the article

  • one primary key column foreign key to 2 other table columns.How to resolve data entry issue.

    - by Rohit
    I have a requirement according to which I have to create a central Login system.We have 2 things Corporate and Brand each represented by tables "Corporate" and "Brand". When a corporate gets registered,corporateID is given,When a user under that corporate gets registered there is a table corporateuser in which corporateID is a foreign key and CorporateUserID is a primary key.Similarly in the case of a brand. So we have CorporateUserId and BrandUserID. Now i have a table called RegisteredUsers in which i want to have corporate as well as brand users.UserID is a primary key in this table which is a foreign key to both corporateuser as well as Branduser. now when i enter a corporateuser,I do an entry to corporateuser as well as RegisteredUsers.When i enter CorporateUserID in userID for RegisteredUsers.It gives foreign key violation error. I fully understand this error.How can i achieve this.This requirement is very rigid.Please tell a workaround

    Read the article

  • Why can I create a table with PRIMARY KEY on a nullable column?

    - by AlexKuznetsov
    The following code creates a table without raising any errors: CREATE TABLE test( ID INTEGER NULL, CONSTRAINT PK_test PRIMARY KEY(ID) ) Note that I cannot insert a NULL, as expected: INSERT INTO test VALUES(1),(NULL) ERROR: null value in column "id" violates not-null constraint DETAIL: Failing row contains (null). ********** Error ********** ERROR: null value in column "id" violates not-null constraint SQL state: 23502 Detail: Failing row contains (null). Why can I create a table with a self-contradictory definition? ID column is explicitly declared as NULLable, and it is implicitly not nullable, as a part of the PRIMARY KEY. Does it make sense? Edit: would it not be better if this self-contradictory CREATE TABLE just failed right there?

    Read the article

  • Google Apps Email for new Primary Youtube Email

    - by MLM
    I have a YouTube account that I want to change the primary email for but every time I try to add a alternate address it says it is already associated with another google account. The email is a google apps user because I want to manage my domains email through gmail. I have already tried deleting the account and re-creating it to make sure it is not associated with anything. The only way I can add it is if I delete the google apps account but then I can not verify since I need to access the verification email.

    Read the article

  • Primary domain in vps in vps has been deactivated

    - by manix
    This is my scenario: I have a vps with two domains (example1.com, example2.com). When I started with this vps I set example1.com as primary domain and the nameserver were configured with the pattern ns1.example.com, ns2.example1.com. The domains were brought in name.com. Across the time, I usually only work whit the domain example2.com, for that reason I stopped to pay example1.com anual registration and just keep the example2.com. But, today my vps is unreacheable because the main domain was deactivated last ago 23th. I never imagined that it could affect my server. So, I am so worried because I don't know if rebuild the vps is the solution here because I could lost my data. Can you take me to the right direction in order to recover my vps?

    Read the article

  • Why is Ubuntu unmounting my primary hard drive?

    - by Twisol
    I'm running Ubuntu 10.10 on my laptop (an Asus G73j), dual-booting Windows 7 if that matters. After using the computer for couple of hours or so, I get a popup complaining that a file was unmounted, then my GNOME desktop panels disappear. I can't save any unsaved work (the file browser shows "Filesystem" as totally empty), and other programs break in odd ways (like Chrome can't browse to any new pages, but keeps current ones going... at least I still have Pandora to listen to when this happens!). I've tried looking in the system logs to no avail; I'm assuming that it can't write any errors to the logs because, of course, the logs are on the primary hard drives. This started happening maybe a few days ago. Yesterday I upgraded from 10.4, but I believe it was happening before then. Any advice for figuring this out?

    Read the article

  • Primary domain in vps has been deactivated

    - by manix
    This is my scenario: I have a vps with two domains (example1.com, example2.com). When I started with this vps I set example1.com as primary domain and the nameserver were configured with the pattern ns1.example.com, ns2.example1.com. The domains were brought in name.com. Across the time, I usually only work whit the domain example2.com, for that reason I stopped to pay example1.com anual registration and just keep the example2.com. But, today my vps is unreacheable because the main domain was deactivated last ago 23th. I never imagined that it could affect my server. So, I am so worried because I don't know if rebuild the vps is the solution here because I could lost my data. Can you take me to the right direction in order to recover my vps?

    Read the article

  • Using IE 9 as my primary browser

    - by Robert May
    With the release of Internet Explorer 9 RC the browser looks to be in a usable state.  So far, my experience has been positive. However, one area where I am having problems is when people are using the jQueryUI library.  Versions older than 1.8 cause IE 9.0 to be unable to drag and drop.  This is a real pain, especially at sites like Agile Zen, where dragging and dropping is a primary bit of functionality. Now that IE 9 is a release candidate, we’ll see how quickly these things improve.  I expect things to be rough, but so far, I’m really liking IE 9.  There’s more real estate than Chrome (it’s the tabs inline with the address bar) and its faster than Chrome 9.0 and FF 3.6.8 (as tested on my own machine). The biggest drawback so far is that because IE has been so badly behaved in the past, sites expect it to be badly behaved now, which is breaking things now. Technorati Tags: Internet Explorer

    Read the article

  • Merging free space of hard drive to primary partition

    - by Dibya Ranjan
    I have purchased a new HDD, I tried to format making 1 primary partition, I converted the rest unallocated space to extended partition then to logical drive now I have 3 logical drives. I feel that the size allocated to the primary partition is less so I used shrink option to the 3 logical partitions in diskmgmt but each partition is resulting in one memory block of Free space. Now I want to merge these free spaces to my primary partition.

    Read the article

  • Drbd Primary/Primary + iSCSI: accessing to different files avoids split brain?

    - by Eddie C.
    I have a question / curiosity about split-brain on a Drbd Primary/Primary configuration. Supposing two nodes (hosts), host1 and host2 configured with Drbd Primary/Primary and two different shares (NFS, CIFS o iSCSI) of a replicated area (saying /drbd) /drbd/file1.data /drbd/file2.data If a pool of client would access only by host1 share reading and wrinting only file1.data and another pool only by host2 share to file2.data, this scenario should avoid split brain situation in case of one node failure or it's just a conjecture? The final purpose is load balance between the two nodes in normal condition and collapsing to one node only in case of failure. Thank you! Eddie

    Read the article

  • Seamlessly Authenticate with a Secondary Active Directory Server (when primary is down)

    - by LonnieBest
    How do you get workstations to (seamlessly) authenticate with a secondary Active Directory server when the primary one is down? Background: I added a secondary Active Directory server to a company's network, hoping that it would do authentication in the event that the primary Active Directory server was down. Although, the Secondary Active Directory server seems to be replicating correctly, authentication doesn't occur while rebooting the primary Active Directory server. Do I have a misunderstanding regarding the role of a secondary Active Directory server, or are there additional settings I must set to get the workstations to authenticate with it when the primary is down?

    Read the article

  • trying to setup multiple primary partitions on ubuntu linux [migrated]

    - by JohnMerlino
    I currently have ubuntu desktop installed on a harddrive. I want to partition the harddrive so that I can reserve 30 gigs for ubuntu server and 30 gigs for ubuntu desktop. The drive has 300 gigs available. Right now I am booting from dvd drive and installing ubuntu server. I selected "Guided partitioning" and created a 30 gig primary partition of Ext4 journaling filesystem, set "yes, format it" for format partition and set bootable flag to on. I intend to use this 30 gig partition to hold ubuntu server and allow me to boot from it. Now I have two other partitions. They are both set to "logical", one is currently using 285.8 gigs and is using ext4 (when I try to set bootable flag to true, it gives a warning "You are trying to set the bootable flag on a logical partition. The bootable flag is only useful on the primary partitions"). More alarming it says "No existing file system was detected in this partition". Actually, Im thinking that this is the parittion that is supposed to be holding my current Ubuntu Desktop. And of course I want this to be bootable and be a primary partition, so I could dual boot from this and the server partition. Now the third partition is also set to logical and it is being used as swap area. My question is regarding that second partition. Its supposed to be a primary partition thats holding my existing ubuntu desktop edition. How do I switch it to primary and to make sure that its pointing to my existing desktop installation?

    Read the article

  • Why is Ubuntu unmounting my primary hard drive?

    - by Twisol
    I'm running Ubuntu 10.10 on my laptop (an Asus G73j), dual-booting Windows 7 if that matters. After using the computer for couple of hours or so, I get a popup complaining that a file was unmounted, then my GNOME desktop panels disappear. I can't save any unsaved work (the file browser shows "Filesystem" as totally empty), and other programs break in odd ways (like Chrome can't browse to any new pages, but keeps current ones going... at least I still have Pandora to listen to when this happens!). I've tried looking in the system logs to no avail; I'm assuming that it can't write any errors to the logs because, of course, the logs are on the primary hard drives. This started happening maybe a few days ago. Yesterday I upgraded from 10.4, but I believe it was happening before then. Any advice for figuring this out? EDIT: It just happened again, and I heard a small little clicky sound from the hard drive about five seconds before things went south. I'm thinking I should start backing up ASAP. In response to a comment, here's the dmesg output: http://askubuntu.pastebin.com/uYGshBay Also, the SMART status says the disk has a few bad sectors, and the detailed data says there are 14. It says it passed the self-assessment though. Lastly, this doesn't seem to be happening when I'm on Windows. I recently re-enabled ureadahead (which I disabled ages ago because it was causing Ubuntu to hang at the startup logo), could that be the source of the problem? I've disabled it again to see.

    Read the article

  • foreign key constraints on primary key columns - issues ?

    - by zzzeek
    What are the pros/cons from a performance/indexing/data management perspective of creating a one-to-one relationship between tables using the primary key on the child as foreign key, versus a pure surrogate primary key on the child? The first approach seems to reduce redundancy and nicely constrains the one-to-one implicitly, while the second approach seems to be favored by DBAs, even though it creates a second index: create table parent ( id integer primary key, data varchar(50) ) create table child ( id integer primary key references parent(id), data varchar(50) ) pure surrogate key: create table parent ( id integer primary key, data varchar(50) ) create table child ( id integer primary key, parent_id integer unique references parent(id), data varchar(50) ) the platforms of interest here are Postgresql, Microsoft SQL Server.

    Read the article

  • How to create an entity with a composite primary key containing a generated value.

    - by David
    Using Hibernate + annotations, I'm trying to do the following: Two entities, Entity1 and Entity2. Entity1 contains a simple generated value primary key. Entity2 primary key is composed by a simple generated value + the id of entity one (with a many to one relationship) Unfortunately, I can't make it work. Here is an excerpt of the code: @Entity public class Entity1 { @Id @GeneratedValue private Long id; private String name; ... } @Entity public class Entity2 { @EmbeddedId private Entity2PK pk = new Entity2PK(); private String miscData; ... } @Embeddable public class Entity2PK implements Serializable { @GeneratedValue private Long id; @ManyToOne private Entity1 entity; } void test() { Entity1 e1 = new Entity1(); e1.setName("nameE1"); Entity2 e2 = new Entity2(); e2.setEntity1(e1); e2.setMiscData("test"); Transaction transaction = session.getTransaction(); try { transaction.begin(); session.save(e1); session.save(e2); transaction.commit(); } catch (Exception e) { transaction.rollback(); } finally { session.close(); } } When I run the test method I get the following errors: Hibernate: insert into Entity1 (id, name) values (null, ?) Hibernate: call identity() Hibernate: insert into Entity2 (miscData, entity_id, id) values (?, ?, ?) 07-Jun-2010 10:51:11 org.hibernate.util.JDBCExceptionReporter logExceptions WARNING: SQL Error: 0, SQLState: null 07-Jun-2010 10:51:11 org.hibernate.util.JDBCExceptionReporter logExceptions SEVERE: failed batch 07-Jun-2010 10:51:11 org.hibernate.event.def.AbstractFlushingEventListener performExecutions SEVERE: Could not synchronize database state with session org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:254) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1001) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:339) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at test.App.main(App.java:32) Caused by: java.sql.BatchUpdateException: failed batch at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source) at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(Unknown Source) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:247) ... 8 more Note that I use HSQLDB. Any ideas about what is wrong ?

    Read the article

  • How do I update my primary key in MySQL?

    - by Wesley
    Ok, this is probably really simple, but I just can't figure it out. I have a primary key in a table that goes from 1-5,000. I need to manually update that id (for other table update purposes) so that it says 5,000-10,000. Can't I manually update this column? Please help!!! Thank you

    Read the article

  • How do I use a Rails ActiveRecord migration to insert a primary key into a MySQL database?

    - by Terry Lorber
    I need to create an AR migration for a table of image files. The images are being checked into the source tree, and should act like attachment_fu files. That being the case, I'm creating a hierarchy for them under /public/system. Because of the way attachment_fu generates links, I need to use the directory naming convention to insert primary key values. How do I override the auto-increment in MySQL as well as any Rails magic so that I can do something like this: image = Image.create(:id => 42, :filename => "foo.jpg") image.id #=> 42

    Read the article

  • Primary key/foreign Key naming convention

    - by Jeremy
    In our dev group we have a raging debate regarding the naming convention for Primary and Foreign Keys. There's basically two schools of thought in our group: 1) Primary Table (Employee) Primary Key is called ID Foreign table (Event) Foreign key is called EmployeeID 2) Primary Table (Employee) Primary Key is called EmployeeID Foreign table (Event) Foreign key is called EmployeeID I prefer not to duplicate the name of the table in any of the columns (So I prefer option 1 above). Conceptually, it is consisted with a lot of the recommended practices in other languages, where you don't use the name of the object in its property names. I think that naming the foreign key EmployeeID (or Employee_ID might be better) tells the reader that it is the ID column of the Employee Table. Some others prefer option 2 where you name the primary key prefixed with the table name so that the column name is the same throughout the database. I see that point, but you now can not visually distinguish a primary key from a foreign key. Also, I think it's redundant to have the table name in the column name, because if you think of the table as an entity and a column as a property or attribute of that entity, you think of it as the ID attribute of the Employee, not the EmployeeID attribute of an employee. I don't go an ask my coworker what his PersonAge or PersonGender is. I ask him what his Age is. So like I said, it's a raging debate and we go on and on and on about it. I'm interested to get some new perspective.

    Read the article

  • How to skip all the column names in MySQL when the table has auto increment primary key?

    - by Jian Lin
    A table is: mysql> desc gifts; +---------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------+-------------+------+-----+---------+----------------+ | giftID | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(80) | YES | | NULL | | | filename | varchar(80) | YES | | NULL | | | effectiveTime | datetime | YES | | NULL | | +---------------+-------------+------+-----+---------+----------------+ the following is ok: mysql> insert into gifts -> values (10, "heart", "heart_shape.jpg", now()); Query OK, 1 row affected (0.05 sec) but is there a way to not specify the "10"... and just let each one be 11, 12, 13... ? I can do it using mysql> insert into gifts (name, filename, effectiveTime) -> values ("coffee", "coffee123.jpg", now()); Query OK, 1 row affected (0.00 sec) but the column names need to be all specified. Is there a way that they don't have to be specified and the auto increment of primary key still works? thanks.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >