Import table from notepad to SQL server 2005

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Raman Pahwa
    New Member
    • Jul 2008
    • 43

    Import table from notepad to SQL server 2005

    I have a notepad with different fields.I want to import it in sql 2005.
    In Sql 2005,there are rows and columns.
    Just want to know which option should select for rows and column delimiters.
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    If this is one time, just use the IMPORT wizard. If not use BCP, BULK INSERT or OPENROWSET

    -- CK

    Comment

    • Raman Pahwa
      New Member
      • Jul 2008
      • 43

      #3
      When i am using Import wizard,I am getting all the fields in single column.there are options for rows and column delimiter in which CR,LF,tab,(CR,L F),vertical bars etc .which option i should use so that different fields should be in different columns

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        That would depend on your column delimiter.

        Could you post some sample data?

        -- CK

        Comment

        • Raman Pahwa
          New Member
          • Jul 2008
          • 43

          #5
          sending you the sample data .copy this in notepad n then try. there are 5 columns and 4 rows.

          12 99 FD 8/6/2008 0:00 9/6/2008 0:00
          23 99 FD 8/6/2008 0:00 9/6/2008 0:00
          34 99 FD 8/6/2008 0:00 9/6/2008 0:00
          45 99 FD 8/6/2008 0:00 9/6/2008 0:00

          if u have no issue,Could u plz tell me when u b online,so that i can solve my problem ASAP.

          Thanks

          Comment

          • ck9663
            Recognized Expert Specialist
            • Jun 2007
            • 2878

            #6
            Choose delimited. Your delimiter could be space or tab.

            -- CK

            Comment

            • Raman Pahwa
              New Member
              • Jul 2008
              • 43

              #7
              Hi,


              But there is no option of space in sql 2005.plz suggest something else.

              Comment

              • ck9663
                Recognized Expert Specialist
                • Jun 2007
                • 2878

                #8
                You might be forced to just use a fixed-length and specify the length of each column.

                -- CK

                Comment

                • Raman Pahwa
                  New Member
                  • Jul 2008
                  • 43

                  #9
                  but the length of all the columns is not same.

                  Then wat to do???

                  Comment

                  • ck9663
                    Recognized Expert Specialist
                    • Jun 2007
                    • 2878

                    #10
                    A fix length means your column's content have the same length. It does not mean all columns have the same length. You can define length of each column on the wizard.

                    -- CK

                    Comment

                    • Raman Pahwa
                      New Member
                      • Jul 2008
                      • 43

                      #11
                      Its still not working becoz there is not such option.plz help me online if u can

                      Comment

                      • ck9663
                        Recognized Expert Specialist
                        • Jun 2007
                        • 2878

                        #12
                        1. Right Click on your db

                        2. Choose Task-Import Data

                        3. Click browse and locate your data file.

                        4.Format: Delimited

                        5. Header Row Delimiter: {CR}{LF}

                        6. Click Columns

                        7. Click Reset Columns

                        8. In Column Delimeter, put space (not the word 'space', but press your spacebar)

                        9. Click Refresh


                        -- CK

                        Comment

                        • Raman Pahwa
                          New Member
                          • Jul 2008
                          • 43

                          #13
                          Thanks, i have reached till the end of my problem.

                          but the option RESET COLUMN is disabled

                          Comment

                          • ck9663
                            Recognized Expert Specialist
                            • Jun 2007
                            • 2878

                            #14
                            No problem with my test.

                            Try changing the file name. It will say that the wizard will reset. Confirm it. Then change it back to your original file.

                            -- CK

                            Comment

                            • radhakrishna04
                              New Member
                              • Jan 2009
                              • 1

                              #15
                              Originally posted by ck9663
                              That would depend on your column delimiter.

                              Could you post some sample data?

                              -- CK
                              pl;s send me reply for this Import table from notepad to SQL server 2005

                              Comment

                              Working...