How to insert 1000 rows in table

  • My table:

    CREATE Table kund(

    kund_id int IDENTITY(1,1) NOT NULL,

    kundansvarig_id int Constraint c_kund_ansvar_id References personal(personal_id),

    fornamn char(20) NOT NULL,

    efternamn char(20) NOT NULL,

    telefonnr char(15) NOT NULL,

    mobiltelefonchar(15) NOT NULL,

    ring_ej_flaggabit NOT NULL,

    CONSTRAINT pk_kund_id primary key (kund_id));

    My teacher gave me a exel file whit 1000 rows...

    But the column ring_ej_flagga is datatype of "Bit" and he he gave me the values in seperate file.

    I don't really know how to insert "bit" values on my column.

    And i don't really know what tool i must use.

    Can someone tell me what tool i shall use

  • a bit xolumn is still an integer value...it's just limited to 0 or 1.

    does that help? i assume your excel file has that value in one of the columns?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • But what tool shoed i use to insert 1000 rows?

  • that depends on the assignment your teacher gave you right?

    the easiest is to simply use the built in wizards from SSMS: right click...Tasks..Import/Export.

    Other options are to use the SSIS todo the job, or to add the files as linked servers, use BULK INSERT, or to use bcp.exe.

    It really depends on your assignment that the teacher gave you when he gave you the raw data.

    he probably gave you two files so you'd have to import both, then insert from Excel, and then Update from the other file.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I have try it whit import/export but it only allows 100 rows.

  • 100 rows is probably what you see in the preview screen, it will import all of them, it can be used to import a lot more than 1000 rows.

    Cheers,

    J-F

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply