Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Note-pad

Author  Topic 

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-07-28 : 06:48:44
i had noticed how to change excel sheet to sql server right now i want to know how can i change a data in notepad to sql server can any body helps

With Regards
Kashyap M

Sachin.Nand

2937 Posts

Posted - 2010-07-28 : 07:17:54
What to you mean by "change a data in notepad to sql server"????

Does it mean you want to import data from notepad into sql server?


Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-07-28 : 07:20:36
The data (columns) inside your flat file should be delimited by a sign like , or ; or tab or | or another sign.
This then is called a CSV file.
Otherwise the columns should be of fixed length.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-07-28 : 07:38:01
let me explain for example if i had a data that is in the form of
1,dasdj,adshsjdh,dsjhsj
2,zfcds,asdjasjd,asjdh
3,ssjd,sajdjsdh,adjd

this not the data just an example

With Regards
Kashyap M
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-07-28 : 07:50:48
And what is your problem?
How did you make the excel-import?
I think this is a similar way.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-07-28 : 07:54:00
no i had done the excel by your help in the way the both ways are not similar i am sure i had tried already in that way

With Regards
Kashyap M
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-07-28 : 08:21:26
Use bulk insert
http://beyondrelational.com/blogs/madhivanan/archive/2010/03/17/bulk-insert-to-table-with-specific-columns.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-07-28 : 08:22:03
So in for your excel file you have used this?
SELECT * INTO Tenantdetails
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=d:\Tdetails.xls', 'SELECT * FROM [Tdetails$]')

Then for your flat file try this:
SELECT * INTO Tenantdetails
FROM OPENROWSET('MSDASQL',
'Driver={Microsoft Text Driver (*.txt; *.csv)}','SELECT * FROM file.csv')


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-07-28 : 08:25:20
exactly you are right


With Regards
Kashyap M
Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-07-28 : 08:26:12
quote:
Originally posted by madhivanan

Use bulk insert
http://beyondrelational.com/blogs/madhivanan/archive/2010/03/17/bulk-insert-to-table-with-specific-columns.aspx

Madhivanan

Failing to plan is Planning to fail


this is what i want thanks

With Regards
Kashyap M
Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-07-28 : 08:28:09
quote:
Originally posted by webfred

So in for your excel file you have used this?
SELECT * INTO Tenantdetails
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=d:\Tdetails.xls', 'SELECT * FROM [Tdetails$]')

Then for your flat file try this:
SELECT * INTO Tenantdetails
FROM OPENROWSET('MSDASQL',
'Driver={Microsoft Text Driver (*.txt; *.csv)}','SELECT * FROM file.csv')


No, you're never too old to Yak'n'Roll if you're too young to die.


i do not have clarity because i am new bee to this sql server what to do is some thing in it

With Regards
Kashyap M
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-07-28 : 08:32:05
Read about OPENROWSET in SQL Server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-07-28 : 08:50:35
i got the output from the notepad to sql

With Regards
Kashyap M
Go to Top of Page
   

- Advertisement -