Showing posts with label excel. Show all posts
Showing posts with label excel. Show all posts

Wednesday, March 28, 2012

How to transfered the data?

Hai,
this ankan here by this side ,
IAm facing a problem itis that i want to export & import data from sql server 2000 . to & from microsoft Excel . and the data should be in the understanding fromat in which it was exprot or import to sql server 2000.
Reply me asap
With best regards
ANKAN
REPLY ME ASAP

Quote:

Originally Posted by daffurankan

Hai,
this ankan here by this side ,
IAm facing a problem itis that i want to export & import data from sql server 2000 . to & from microsoft Excel . and the data should be in the understanding fromat in which it was exprot or import to sql server 2000.
Reply me asap
With best regards
ANKAN
REPLY ME ASAP


Hey let use "Data Transformation Service Wizard for import/export datas"

How to Transfer data from Excel to SQL SERVER 2000

hi!
i want to transfer data from MS Excel Sheets to SQL Server. is there any
way.
Thanks
Ahmad Jalil QarshiThe simplest way is to use the DTS Import Wizard.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"Ahmad Jalil Qarshi" <ahmaddearNO@.SPAMhotmail.com> wrote in message
news:ec7wd8abFHA.3712@.TK2MSFTNGP09.phx.gbl...
hi!
i want to transfer data from MS Excel Sheets to SQL Server. is there any
way.
Thanks
Ahmad Jalil Qarshi|||YOu can import that from SQL Server using
-DTS
-Linked Servers
-OPENROWSET
-OPENDATASOURCE
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Ahmad Jalil Qarshi" <ahmaddearNO@.SPAMhotmail.com> schrieb im Newsbeitrag
news:ec7wd8abFHA.3712@.TK2MSFTNGP09.phx.gbl...
> hi!
> i want to transfer data from MS Excel Sheets to SQL Server. is there any
> way.
>
> Thanks
> Ahmad Jalil Qarshi
>|||Make sure you have header records in your excel file. Then click in first
column first row and hit ctrl+shift+end which should highlight everything.
Then go to file save as then for the type choose csv. Then in Enterprise
Manager click on database you want it to go into then right click and choose
import data. For Source choose text which is the last option, then browse
for file you made .csv then on destination choose db its going into if not
alreay specificed and then when you get to the import format screen click
first row has column names and then click next. You should see all data wit
h
proper column names. Then next and run and you should have all data.
You might have to go back and change fields size specifications because it
makes all columns 255 which is not a good practice for final table. Also
when you save the file as type csv it will give you errors and ask you if yo
u
want to save over file. Just say yes it will also do the same thing when you
go to close out of file just click save again and over right otherwise the
file might get messed up if you hit cancel or no to saving file.
Hope this helps.
"Ahmad Jalil Qarshi" wrote:

> hi!
> i want to transfer data from MS Excel Sheets to SQL Server. is there any
> way.
>
> Thanks
> Ahmad Jalil Qarshi
>
>|||If you don't choose .csv format, you can use .xls. In .csv format all colum
n
will be interpreted as varchar. But if you transfer from excel, it can be
different respect to the column types in excel. But, there is an important
point.
"Ahmad Jalil Qarshi" wrote:

> hi!
> i want to transfer data from MS Excel Sheets to SQL Server. is there any
> way.
>
> Thanks
> Ahmad Jalil Qarshi
>
>|||Excuse, my message is ongoing.
...But, there is an important point. Look your .xls file. Sometimes a colon
s
can be different types such as half of one column date and remaining is
string. In this position sql will interpret this column as DateTime. But
there can be error in string part. So, string part can be null.
"huseyin_akturk" wrote:
> If you don't choose .csv format, you can use .xls. In .csv format all col
umn
> will be interpreted as varchar. But if you transfer from excel, it can be
> different respect to the column types in excel. But, there is an important
> point.
> "Ahmad Jalil Qarshi" wrote:
>

Monday, March 26, 2012

How to tranfer excel data to sqlserver2000 ?

In our project we r having a task such that to convert the excel data to sqlserver2000 . what is the procedure ? (Bulk amount of data )

Try the thread below for code to create a linked server with Excel. Hope this helps.
http://forums.asp.net/926047/ShowPost.aspx|||If you want to convert excel data permanently into SQL server
Right Click database -> All Task -> Import data ...-> Choose data source to be Excel, specify file path, choose destination, new table name .. map columns if necessary... just follow the wizard.
Happy programming!

Sunday, February 19, 2012

How to stop execution of DTS package (during loop)

I have a MSSQL DTS Package where it needs to loop/execute 3 times because the main task is to import data from 3 excel files (different location) into 1 SQL table. I used a global variable vCounter and I use an ActiveX Script.

ActiveX Script 1

Option Explicit

Function Main()

Dim vDate, vCounter, vBranchCode, vPath

vDate="011207"

vCounter=DTSGlobalVariables("gVarCounter").Value

IF vCounter<=3 THEN

IF vCounter=1 THEN
vBranchCode="ALB"
vPath= "D:\PROJECTS\HRIS\ALB\"
ELSEIF vCounter=2 THEN
vBranchCode="MOA"
vPath= "D:\PROJECTS\HRIS\MOA\"
ELSEIF vCounter=3 THEN
vBranchCode="PSQ"
vPath= "D:\PROJECTS\HRIS\PSQ\"
END IF

DTSGlobalVariables("gVarPath").Value=vPath & vDate & "_" & vBranchCode & ".xls"

Main = DTSTaskExecResult_Success

ELSE
<This is where i will initialize the global variable gVarCounter, so in the next execution..the value should be back to 1>
DTSGlobalVariables("gVarCounter").Value=1
<DTS Process should stop execution...how is this?>
END IF

End Function

After excel to sql dts
ActiveX Script2

Function Main()

IF gVarCounter<=3 then
DTSGlobalVariables("gVarCounter").Value=DTSGlobalVariables("gVarCounter").Value+1
DTSGlobalVariables.Parent.Steps("DTSStep_DTSActiveScriptTask_1").ExecutionStatus=DTSStepExecStat_Waiting
Main = DTSTaskExecResult_Success
END IF

End Function

Thanks a lot.there are many ways to stop a DTS. u can simply write

Main = DTSTaskExecResult_Failure

in the ELSE part and link the next step with "on success" workflow. or u can even write a blank ActiveX step and redirect the flow to that step in the ELSE part with "...DTSStepExecStat_Waiting" as u r already doing|||sorry, i pressed the save button twice... and the same thing got posted twice... there sould be an option to delete a post....|||hi upalsen,

thanks a lot. it's now working. great!
god bless.|||hi LimaCharlie,

thanks for your acknowledgement. many here do not acknowledge the solution they have accepted. an acknowledgement is (1) a recognition for support (2) helps in closing the post (3) helps a third user who is viewing the post at a later date (or coming from search engine) to understand what the final solution could be.