TSQL + VBA Excel 2003 - Importing Data From MS Excel 2003 To SQL SERVER 2000 Using Multi - Batch Processing

Sep 11, 2007

Hi,
I need to import an SQL string from MS Excel 2003 to SQL SERVER 2000.
The string I need to import is composed by 5 different several blocks and looks like:



Code Snippet

CommandLine01 = "USE mydb"
CommandLine02 = "SELECT Block ..."
CommandLine03 = "GO
ALTER TABLE Block...
GO"
CommandLine04 = "UPDATE Block..."
CommandLine05 = "SELECT Block..."

The detail of the SQL string is at:
http://forums.microsoft.com/msdn/showpost.aspx?postid=2093921&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=1



I am trying to implement OJ's suggestion:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2117223&SiteID=1
to use multi - batch processing to import the string to SQL SERVER, something like:




Code Snippet
Dim SqlCnt, cmd1, cmd2, cmd3
'set the properties and open a connection

cmd1="use my_db"
cmd2="create table mytb"
cmd3="insert into mytb"

SqlCnt.execute cmd1
SqlCnt.Execute cmd2
SqlCnt.Execute cmd3

Below is the code (just partial) I have, and I need help to complete it.
Thanks in advance,
Aldo.




Code Snippet
Function TestConnection()
Dim ConnectionString As New ADODB.Connection
Dim RecordSet As New ADODB.RecordSet

ConnectionString = "Driver={SQL Server};Server=myServer;Database=myDBName;Uid=UserName;Pwd=Password"
ConnectionString.Open

CmdLine01 = " USE " & myDB
CmdLine02 = " SELECT ACCOUNTS.FULLNAME FROM ACCOUNTS" ...

CmdLine03 = "GO
ALTER TABLE Block...
GO"

CmdLine04 = "UPDATE Block..."
CmdLine05 = "SELECT Block..."

RecordSet.Open CmdLine01, ConnectionString
RecordSet.Open CmdLine02, ConnectionString

ConnectionString.Execute CmdLine01
ConnectionString.Execute CmdLine02

'Retrieve Field titles
For ColNr = 1 To RecordSet.Fields.Count
ActiveSheet.Cells(1, ColNr).Value = RecordSet.Fields(ColNr - 1).Name
Next

ActiveSheet.Cells(2, 1).CopyFromRecordset RecordSet

'Close ADO objects
RecordSet.Close
ConnectionString.Close
Set RecordSet = Nothing
Set ConnectionString = Nothing

End Function






View 7 Replies


ADVERTISEMENT

TSQL + VBA - Retrieve SQL SERVER 2000 Data Trough Excel 2003 - Time Out Error 80040e31

Sep 17, 2007

Hi guys,
When I thought everything is okay with this script, I got a new problem...
I have a VBA's script from Excel 2003 that builds sql script and retrieves data from SQL SERVER 2000.
in order to make the sql running, I need to use a multi - batch processing, to pass and execute every command line once a time.

Up to here, I am using a test case with Account number = '123456' and getting the desire results.
The code below is running okay with the test case, but when changing the account number (mark as yellow in the code) to include all the accounts (or just one other account), I am getting the following ERROR:
run - time error '-2147217871 (80040e31)' - [Microsoft] [ODBC SQL Server Driver] time out expired.

Now, if I take the same code, with the condition that generates the ERROR, and try it into SQL Server, I get the results without errors.
Thanks in advance,
Aldo.

Below the code:



Code Snippet
Function QuerySalesAging()
'--------------------------------------------------------------
'MUST !!! References: Microsoft ActiveX Data Object 2.1 Library
'--------------------------------------------------------------

Dim ConnString As New ADODB.Connection
Dim RecordSet As New ADODB.RecordSet

'Setting Connection String
Driver = "{SQL Server}"
ServerName = "SERVER"
DB_Name = CompanyName

ConnString = "Driver=" & Driver & ";" & "Server=" & ServerName & ";" _
& "Database=" & DB_Name & ";" & "Uid=" & SQLLoginName & ";" & "Pwd=" & SQLPassword & ";"

'Report Criterias
Criteria05 = " AND " & "Accounts.ACCOUNTKEY Between " & AccountKeyAsRange
' -- ==> With AccountKeyAsRange = '123456' AND '123456' it works okay.
' -- ==> With any other value, in example AccountKeyAsRange = '123456' AND '9999999999' it get's ERROR.

CmdLine01 = " USE " & CompanyName

' Check and drop temporary table
TemporaryTableName = "CTE" ' The table is a regular one
CmdLine02 = " if object_id('" & TemporaryTableName & "') is not null exec('DROP TABLE " & TemporaryTableName & "') "

CmdLine03 = " SELECT ..."
CmdLine03 = CmdLine03 & " INTO " & TemporaryTableName
CmdLine03 = CmdLine03 & " FROM ..."
CmdLine03 = CmdLine03 & " WHERE " & "(" & Replace(Criteria05, "AND", "") & ")"
CmdLine03 = CmdLine03 & " ORDER BY ..."

CmdLine04 = CmdLine04 & " ALTER TABLE " & TemporaryTableName ...

CmdLine05 = CmdLine05 & " UPDATE " & TemporaryTableName ...

CmdLine06 = CmdLine06 & " SELECT ..."
CmdLine06 = CmdLine06 & " FROM ..."

ConnString.Open
ConnString.Execute CmdLine01
ConnString.Execute CmdLine02

RecordSet.Open CmdLine01, ConnString
RecordSet.Open CmdLine02, ConnString
RecordSet.Open CmdLine03, ConnString
RecordSet.Open CmdLine04, ConnString
RecordSet.Open CmdLine05, ConnString
RecordSet.Open CmdLine06, ConnString

ConnString.Execute CmdLine01
ConnString.Execute CmdLine02 ' The debbuger stops here:" if object_id('CTE') is not null exec('DROP TABLE CTE') "
ConnString.Execute CmdLine03
ConnString.Execute CmdLine04
ConnString.Execute CmdLine05
ConnString.Execute CmdLine06
ConnString.Execute CmdLine02

'Retrieve Field titles
For ColNr = 1 To RecordSet.Fields.Count
ActiveSheet.Cells(1, ColNr).Value = RecordSet.Fields(ColNr - 1).Name
Next

ActiveSheet.Cells(2, 1).CopyFromRecordset RecordSet

'Cleanup & Close ADO objects
ConnString.Execute "USE master"
ConnString.Close
Set RecordSet = Nothing
Set ConnString = Nothing
End Function

View 1 Replies View Related

Importing Data From Excel 2003 To Sql Server 2005

Sep 3, 2007

Hi all. I want to export data from excel 2003 to sql server 2005. I am using the following script:
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO
Insert into Pamphlet
Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:Pamphlet.xls;HDR=YES', 'SELECT * FROM [Sheet3$]')
But it is giving the following error:
Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 2
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
The above script is working fine with Excel 2002 but not with 2003. Can someone please provide me exact script of importing data from excel 2003 to sql server 2005. I have also tried the Linked server option but it is still giving the same error.
Please help me.  
 
 

View 1 Replies View Related

Automating Taking Data From Sql Server 2000 Onto Excel 2003 Spreasheet

Jun 18, 2007



I would like to know recommendations on automate the following:



1. I want to know how to take data from various sql server 2000 data queries and load the data onto excel spreadsheets in an automated method. Some of the data loaded into the excel spreadsheets load detail data and some load data into pivot tables.



Is there any way that the data can be taken from sql server to the excel spreadsheets using odbc connections?



2. Some of the data taken from sql server 2000 database is loaded into pdf files. Is there any way this process can be automated?



Thanks!

View 1 Replies View Related

Excel 2003 To Excel 2007 Problem

Jan 2, 2008

hi,

i have one application in Microsoft excel 2003. but when i open this in Microsoft excel 2007 it gives me error saying that

error inintializing menu,
object variable or with block variable not set.

kindly guide me what i can do for this. i m not getting exactly what is happening.

thanks & regards,
Vishruti.

View 3 Replies View Related

Reg: Export Excel 2003 To Sql Server 2005

Mar 31, 2008

I want to export Excell 2003 to Sql Server 2005. I am having the following error while execute the query.


declare @SQL varchar(8000)
create table #temp(i int identity(1,1),SiteName varchar(100),SiteDescription varchar(5000),SiteURL varchar(500),CategoryName varchar(200))
set @SQL='Insert into #temp Select * From OPENROWSET (''Microsoft.Jet.OLEDB.4.0'',''Excel 8.0;Database=' +
'a.xls' +';HDR = YES;IMEX=0'',''SELECT * FROM [Sheet1$]'')'

exec (@SQL)



The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

I need a solution urgently. help Pls

View 3 Replies View Related

SQL 2005 X64 Linked Server To Excel 2003/2007

Aug 27, 2007

Is there a way to create a SQL 2005 x64 Linked server to an Excel (or Access) 2003/2007 file? In SQL 2005 32bit this was possible. Does anyone know of a solution or a work around?

View 3 Replies View Related

Problem With Excel 2002/2003 Add-in For SQL Server Analysis Services

Sep 6, 2005

Hi, i´m using Excel 2002/2003 Add-in for SQL Server Analysis Services and i have the following problem.

I´ve created a report with the addin and i saved it in a share directory. I have users in differents workstations with windows 2000 sp 4, excel 2003 and mdac 2.8 the problem is that sometimes when users open the report and want to do a drill down of a dimension it isn´t any data..

Some one have any idea?

Tks!!!
Pablo

View 3 Replies View Related

Sql Or Link To Import Cells/ranges (excel 2003) To Sql Server 2005

Feb 27, 2008

I have around 600 worksheets that i need to import into sql server that are in a somewhat non-table like format. Data defractor seems to be able to do what i need, but i also need to check into doing it manually. I've seen the code to import cells and ranges into sql server, but can't seem to remember what it is anymore. I've also searched through the forums and can't seem to find any examples either. Could anyone post an example or a link with some examples or explaination code. Thanks in advance.

View 4 Replies View Related

Excel 2003 To SQL Server 2005 OLAP Cube Timeout Issues

Nov 13, 2007


Hola

We are getting symptoms of a 30 second timeout irrespective of what we do, but only on certain machines. Can anyone shed any light on how the connection timeout can be set, as there seems to be a factor overiding any settings we set?

We are working in Excel (2003) connecting to an Analysis Services 2005 cube through a website https://Datasource connection. When we edit the connection string that the file is using (either by forcing use of an exterior .ODC file and editing the settings in there, or by converting the xls spreadsheet into an xml spreadsheet and manually editing the connection string in there) we get no joy: after 30 seconds the error appears:


"Either a connection cannot be made to the [my server address], or Analysis services is not running on the computer specified".

This error is itself rubbish: If a smaller query (one that takes < 30 seconds) is run in the same Excel file and Pivot Table, it connects fine.
What really doesn't make sense is that the exact same file works on some machines and not others. These machines are all inside the same network (and the machines that work have been proven to work on a number of other networks). What's more there is no pattern to the machine capabilities - some newer / faster machines get the error. These machines (that work and do not) have excel 2003 SP3. (Another of the ones that works has Excel 2007).

Changing the connection string to include "Timeout=300" or "Connect Timeout=300" makes no difference, and "Command Timeout" causes a different error so that it wont even attempt to run the query (as opposed to collapsing after 30 seconds of normal progress).
Similarly in the .ODV the tags <ODC:CommandTimeout>, <CommandTimeout>, <ODC:Connect Timeout>, <ODC:Command Timeout>, <meta name=CommandTimeout content=1000> etc. have no effect (the file still gets the 30 seconds error rather than just giving up so no way of working out correct syntax)

The only pattern we can see, and we can't fix this, is that the machines that work have Retail versions of excel, and the ones that do not have corporately licensed versions of excel. We cannot see any difference between them in the Help >Abouts, but thought it might be worth mentioning.

Any help would be fantastically appreciated, we are out of ideas.
Thanks kindly

Amundo

View 2 Replies View Related

DTS And Excel 2003

Mar 15, 2007

We have a DTS package that imports data from a client's Excel file. Previously our client was using Excel 2000, but recently they upgraded to Office 2003, and now suddenly when I try to view the transformation task properties I get a Jet Database Engine error: "External table is not in the expected format".

Everything else with the file appears the same (layout, formatting, etc.).

Any suggestions?

View 1 Replies View Related

Excel 2003 Causes Deadlocks?

May 8, 2008

Hi guys and gals,

Since monitoring blocks on the server, I have noticed that when I have a whole lot of users thrown out of their apps, it's all because of one PC.
The program name is "Microsoft Office 2003". The user reckons that they haven't opened any Excel files that have any kind of link to the live database.
Is there any known problem that you are aware of where Excel can "remember" connection strings maybe from other files you have opened in the past and would that spuriously throw INSERT, UPDATE & SELECT statements to the database server and that then cause locks?

The idea seem ludicrous to me. I'm stumped.

View 2 Replies View Related

CopyFromRecordSet In Excel 2003

Mar 20, 2007

I want to use the CopyFromRecordSet however I am using a stored procedure that returns a recordset. Here is the code, but the recordset never opens. I have commented out the Execute

Here is a code snip, any Ideas? TIA Mike

Dim Con1 As New ADODB.Connection
Dim Cmd1 As New ADODB.Command
Dim Rs As New ADODB.Recordset


Con1.Open

Cmd1.ActiveConnection = Con1
Cmd1.CommandType = adCmdText
Cmd1.CommandText = "MyStroredProc"
Cmd1.Execute
Rs.Open Cmd1

Worksheets("T1").Range("B1").CopyFromRecordset Rs

View 7 Replies View Related

Problem In Importing Excel Data Into MS SQL 2000

Apr 7, 2007

Hi all,

I want to import MS Excel data into MS SQL 2000 and I am programming this in VB 6.0. I am referring the article http://support.microsoft.com/kb/316934/EN-US/ for this. I can able to import Excel data successfully into SQL database table. But the problem is, the order of exported data in SQL table is not matching that of MS Excel data. All the rows were jumbled, which made it totally unusable.



Please guide me how to Import Excel data into MS SQL in its original order only. Any other method other than what I am following is present; please suggest me to keep the original order.



------

Regards,

Rajeev Vandakar

Bangalore

View 4 Replies View Related

Error When Exporting To Excel Using SSRS 2003

Dec 22, 2006

Hi,

I have encountered an error when attempt to open a report which is exported to Excel using SSRS2003. It looks like this:

Microsoft Office Excel File Repair Log

Errors were detected in file 'C:Documents and SettingsTocsonEIMy DocumentsRigidReports
ptRigidTransactionSummaryReport3.xls'
The following is a list of repairs:

Damage to the file was so extensive that repairs were not possible. Excel attempted to recover your formulas and values, but some data may have been lost or corrupted.


At first I thought it was because of the sheer bulk of the report since when I break down a month's report to every 5 days, it would export without error. So I thought that if I can break a whole report into several worksheets using page break, it might work. Unfortunately, although I did succeed in exporting the whole report into several worksheets, I still encounter the same error. Now I have no idea on what the root of the error is. Note that the same report can be exported in other formats and can be opened without error. Except for a case when I tried opening the same report exported in XML using Excel, an error which might be related to the error above occurs which says that there's an invalid unicode character in the xml file.

Any help in determining the root of the problem and a solution to it?

View 1 Replies View Related

How To Use SQL Svr 2005 Express In Excel 2003 VBA Code?

Jun 23, 2006

Hello,

how can I use SQL Svr 2005 Express as database engine in background through VBA code in Excel 2003?

I want to CREATE and DELETE tables and SELECT, INSERT and UPDATE data. Is it possible to use ADO or other database objects to get in contact with SQL Svr 2005 Express?

Thanks a lot.

Christian

View 4 Replies View Related

User Instance Connection From Excel 2003

Apr 13, 2008

Hi

I am trying to connect to SQL Express from Excel VBA using an user instance.
I have tried the following connection string:

Driver={SQL Native Client};Server=.SQLExpress;AttachDbFilename=full_path_to_mdf; Database=dbname;Trusted_Connection=Yes;

And I get the following error : Could not open new database 'dbname' CREATE DATABASE is aborted.


Any ideas on what I am doing wrong?

All I want is an Excel document to connect to a .mdf that is stored on a CD (The database will be readonly). I do not want the database to be stored on the users hard drive.

Many Thanks

MP

View 3 Replies View Related

VS 2003 - Count Rows In Excel E-mail Attachment?

Jan 4, 2007

I have a C# program that sends an e-mail with an Excel attachment. The Excel file is populated with the results of a SQL stored procedure before the e-mail program is executed. The entire process is in a DTS package (populate a temporary table, export the table to Excel, then send the e-mail). It is possible that the stored procedure will return no results, in which case the Excel file will not be populated.I'd like to know whether it is possible (and if so, how) to add some code to my e-mail program that will count the number of populated rows in the Excel file and if that number is <2 (the header row will always be populated), to quit and not send the e-mail.

An alternative would be for the DTS package to terminate if the stored procedure returns 0 records.

Thanks!

View 3 Replies View Related

Launching A Stored Procedure With Parameter From Excel 2003

Oct 2, 2007

I have a stored procedure in SQL Server which needs a parameter and returns a resultset.

sp_xxx 'parameterValue'

I'd like to know if it is possible to launch this stored procedure through Excel 2003 and get the resultset in the active spreadsheet.


I have tried to do this with Microsoft Query but it doesn't allow parameters in queries that can't be graphically represented.

I have tried also through an ODC files but I get an error.


Is it possible to do this?

View 6 Replies View Related

Problems Using Stored Procedure With Numeric Parameters In Excel 2003 / VBA

Mar 4, 2008



File Structure:


--**************************************************************************************************************************

USE [Test]

GO

/****** Object: Table [dbo].[tbl_Test] Script Date: 03/04/2008 09:51:20 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[tbl_Test](

[TestID] [int] IDENTITY(1,1) NOT NULL,

[TestValue] [numeric](18, 2) NOT NULL CONSTRAINT [DF_tbl_Test_TestValue] DEFAULT ((0)),

CONSTRAINT [PK_tbl_Test] PRIMARY KEY CLUSTERED

(

[TestID] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

) ON [PRIMARY]

--**************************************************************************************************************************

Stored Procedure:


--**************************************************************************************************************************

USE [Test]

GO

/****** Object: StoredProcedure [dbo].[proc_Ins_Test] Script Date: 03/04/2008 09:52:23 ******/

SET ANSI_NULLS OFF

GO

SET QUOTED_IDENTIFIER ON

GO

/*

Name: proc_Ins_Test

*/

ALTER PROCEDURE [dbo].[proc_Ins_Test]

(

@TestValue numeric(18,2)=0

)

AS

BEGIN TRAN

BEGIN

INSERT INTO tbl_Test (TestValue) VALUES (@TestValue)

END

COMMIT TRAN

SELECT MAX(TestID) AS MaxValue FROM tbl_Test

RETURN 1

--**************************************************************************************************************************

(I have it returning a value through SELECT to simulate returning a key value from the newly inserted record. I also use the RETURN value to fetch any error codes.)



'***************************************************************************************************************************

Public Sub PSInsertTest(cnConn As ADODB.Connection)




Dim rst As ADODB.Recordset

Dim cmd As ADODB.Command

Dim stProcName As String 'Stored Procedure name





Set rst = New ADODB.Recordset

Set cmd = New ADODB.Command





'Defines the stored procedure commands

stProcName = "dbo.proc_Ins_Test" 'Define name of Stored Procedure to execute.

cmd.CommandType = adCmdStoredProc 'Define the ADODB command

cmd.ActiveConnection = cnConn 'Set the command connection string

cmd.CommandText = stProcName 'Define Stored Procedure to run





'Append Parameters

With cmd


.Parameters.Append .CreateParameter("@return_value", adInteger, adParamReturnValue)

.Parameters.Append .CreateParameter("@TestValue", adNumeric, adParamInput)

.Parameters.Item("@TestValue").NumericScale = 2

.Parameters.Item("@TestValue").Precision = 18

.Parameters.Item("@TestValue").Value = 123.45

End With





'Execute stored procedure and return to a recordset

Set rst = cmd.Execute





If Not rst.EOF Then

rst.MoveFirst

MsgBox (rst.Fields("MaxValue").Value)

Else


MsgBox ("No Value")

End If





'Close database connection and clean up

If CBool(rst.State And adStateOpen) = True Then rst.Close

Set rst = Nothing



End Sub
'***************************************************************************************************************************

It goes ahead and inserts the record, but gets an error when I try to retrieve the "SELECT"ed value. I get the same results with the following statement:


rst.Open cmd, , adOpenStatic, adLockReadOnly


The error is: Operation is not allowed when the object is closed





If I use the following command, I get the error below:


rst.Open cmd.Execute

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.



Any insights would be helpful




Bob

View 19 Replies View Related

DTS Error: Importing From Excel File To SQL Server 2000

Nov 30, 2007

 Data for Source Column 15 'Notes' is too large for the specified buffer size. How do I get around this, I can see some of the notes entries are beyond 255 chars so I changed the destination datatype to textI have never seen this error when importing before. What do I do? 

View 1 Replies View Related

Win 2003 X64 - SSIS Error Importing Xls And Access Data

Dec 14, 2005

I am having a problem importing data from xls and access into my SQL2005 DB using SSIS. Would appreciate any help in getting this resolved.  Environment: Xeon 64 bit processor machine/Win 2003 64 bit (x64)/SQL 2005 64 bit  Some of the resources that I have dug up so far have pointed to Jet Engine SP8 and WOW64.  A search on the box shows this: C:WindowsSysWOW64Msjet40.dll €“ File version is 4.0.9025.0 Not sure what is missing. The following is the error from the import from xls. The one from access is very similar. ================================================================================== Task Import abc_xls Validation has started [DTS.Pipeline] Information: Validation phase is beginning. Progress: Validating - 0 percent complete [Excel Source [1]] Error: The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009. [DTS.Pipeline] Error: component "Excel Source" (1) failed validation and returned error code 0xC020801C. Progress: Validating - 50 percent complete [DTS.Pipeline] Error: One or more component failed validation. Error: There were errors during task validation. Validation is completed [Connection manager "Excel Connection Manager"] Error: An OLE DB error has occurred. Error code: 0x80040154. An OLE DB record is available.  Source: "Microsoft OLE DB Service Components"  Hresult: 0x80040154  Description: "Class not registered".

View 41 Replies View Related

Win 2003 X64 + SQL 2005 &< Win 2003 32 + SQL 2000?

Jul 23, 2005

I may not be the best forum for this post, however I believe some onecan still help me or direct me somewhere else.I'm finding that win 2003 x64 and SQL 2005 CTP is slower than win 2003and SQL 2000.Machine A: Opteron 2.2 (248) w/ 2 cpus. 8GB memory. SCSI disk array.Windows Enterprise 2003 x64 final release. SQL Server 2005 enterpriseCTP.Machine B: Opeteron 2.2 (248) w/ 2 CPUs. 4GB Memory. IDE Drives.Windows Server 2003 (32bit) and SQL Server 2005 (standard).I'm using Cognos' DecisionStream as the ETL tool (32bit). I have theidentical job on both machines. Machine A is slower to do my nightlybuild (1h 20m) vs. Machine B (50m).I've done no tweaking of the databases. I Used SQL 2005's studio tocopy the database from Machine B to Machine A.The only major difference is the O/S and SQL, the machines are samespeed, however Machine A has twice the memory and faster disk; so Iwould expect it to be faster.Can anyone think of smoking guns I might be missing?TIA

View 2 Replies View Related

Importing Data From Excel To SQL Server

Sep 14, 2004

I have a Excel 2000 column which looks like this:

Column A
23456
234-67
2-56
354899865

When I create a DTS package to import this column, only the values without a hyphen get imported correctly..and a null value will show for the numbers that have a hyphen in it.

I've set my datatype to varchar, float, nvarchar, text, etc in SQL Server 2000...but nothing seems to work. I have also changed the datatype in my excel spreadsheet to text, general, etc.

I've tried so many combinations, I forget which ones I've tested...Anybody have an idea what I should try ?

Thank you

View 3 Replies View Related

ASP .NET--Problem With Importing Data From Excel To SQL Server..

Feb 21, 2008

Is there any way to import the excel data to SqlServer 2000 without using OleDb Connection in the code...??
Help Me with this??
Thanks in advance..

View 5 Replies View Related

Importing Data From Excel File Into SQL Server

Apr 9, 2000

Can anybody please give an example of how to import data from an Excel file to SQL Server in a VB Application using DTS.

I am particularly facing problems creating the connection for the Excel file. An example for that would be aprticularly helpful.

Thanks in adv,
Rahul.

View 1 Replies View Related

Problem In Importing Data From Excel To Sql Server

Apr 19, 2007

I have excel file that has field named Purpose. Its max length is 400 character. I import this file to sql server database table. And also i change the purpose field in sql server database table with nvarchar 400. But when i run this job, it gave me error message:

Error at source for row number 1215. Errors encountereed so far in this task: 1.
Data for source column 18 ('Purpose') is too large for the specified buffer size.

What should i do so that i still can import the data from excel to sql server database?

Thanks for your help.

View 1 Replies View Related

Importing Data From Excel To SQL SERVER Database

Aug 23, 2006

Hello all:

I have gone through most of the question posed by people, about importing data from EXCEL sheet to some table using SQL server database. I have a slight variation of this problem.

My excel file contains some information apart from the normal data.
Lets say some 5-6 lines always gives me some info about the data, like its purpose, client info, date etc...
After this INFO my actually data start, which I want to load into table.

I have found some wizard for the same, "EMS SQL MANAGER 2005", which supports most of the file formats, and load data into the database.

But we are planning to not use this tool, instead everything should be done using TSQL.

If somebody can please gives me some idea how this problem can be tackle, it would be a great help. We won't be using any Third party tools, like scripting etc...

We want to stick with just TSQL for this problem.

Thanks a bunch,
sabegh

View 1 Replies View Related

Importing Excel Data Into New Table In MS SQL Server

Jul 10, 2007

I have installed SQL Server Managemert Server Express .... I am wondering how to import data from an excel spreadsheet?



.. Silent Running

View 3 Replies View Related

Importing Excel Data Into SQL Server 2005 With A Twist!

Jun 11, 2007

Hi,
I would like to import an Excel spreadsheet into SQL Server 2005. I can do this quite easily using the Import/Export wizard, and have each row in the spreadsheet transfer to a new row in the database table.
However, I want to import the first few columns of the spreadsheet row into one table (called Products), but put the remaining columns into a related, three-column table, called Product_Details. In the Product_Details table, one column would hold the spreadsheet column value, the other column would be a FK integer value linked to the PK in the Products table, and the third column the primary key as normal.
So, somehow, I would need to get hold of the primary key value when the first spreadsheet columns are inserted into the Products table and then insert the remaining columns into the Product_Details table with two values per row - one value being the spreadsheet cell value, the second being the primary key of the new product in the Products table.
TIA,
Graham.

View 1 Replies View Related

Importing Data From Excel Sheets Into SQL Server Database

Feb 15, 2006

Hi,
Would like some help on how do I go about coverting an Excel File with columns of info into my SQL Server Database. The excel file will be uploaded from a user from my web application. I completely have no idea on where to start so any form of help is much appreciated thanks.

View 3 Replies View Related

Installing Onto Windows 2003 Server For Multi-user Application

Apr 22, 2006

Good Day,

I have an application that is being developed on Visual Studio 2005 (VB) and SQL Express. The application is set up to use the SQL Express on the development computer, and if an Internet or CD install is built, it installs SQL Express as expected. The question is, when it is time to deploy and put the SQL Express database on the 2003 server, how should the install on the server be done and how should we set the database path to the server?

Thanks,

Dave

View 1 Replies View Related

Importing Excel Xp To Sql 2000

Feb 3, 2004

i have a spreadsheet with 4 workfiles and i want to import into sql. i want to make one workfile into one table in sql
how do i go by doing this? and spreadsheet has a lot of macro too
thanks

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved