How To Import Access To SQLServer With Parameter From SQLServer, Help Pls!

Jul 8, 2006

Hello Expert!

I have 2 Database €“ Access & SQLServer(ver 7)

I need to Import Data TblShift from Access to SQLServer €“ using DTS I€™ve done this successfully!

Now I want to use parameter so I only importing record within range (e.g. ShiftDate BETWEEN 05-24-2006 AND 06-23-2006)

In SQLServer, I have created table to store the date range as following:

TblParameter
DateFrom: 04/24/2006
DateTo: 05/23/2006

How do I use the date range from TblParameter(SQLServer) to import record from TblShift(Access) using DTS?

Is this possible or any better solution for this?

TIA

Regards,

View 4 Replies


ADVERTISEMENT

Class Method Is Smoking Fast When Executed Outside Of SQLServer, Dog Slow As A CLR Function Is SQLServer - Anyone?

May 10, 2007

We have a static class that makes an HTTPWebRequest to get XML data from one of our vendors. We use this as input to a stored proc in SQLServer2005. When I compile this class and call it from a console application in visual studio it executes in milliseconds, everytime. When I compile it, create the assembly and clr function and execute it in SQLServer, it takes around 14 seconds to execute the first time, then on subsequent requests it is again really fast, until I wait for 10 seconds and re-execute, once again it is slow the first time and then fast on subsequent requests. We do not see this behavior when executing outside SQLServer. Makes me think that some sort of authentication is perhaps taking place the first time the function is run in SQLServer? I have no idea how to debug this further. Anyone seen this before or have any ideas?



Here is the class:






Code Snippet

using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;

namespace Predict.Services
{
public static class Foo
{
public static string GetIntradayQuote(string symbol)
{
string returnQuote = "";

HttpWebRequest request = (HttpWebRequest)(WebRequest.Create("http://data.predict.com/predictws/detailed_quote.html?syms=" + symbol + "&fields=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,28,30"));

request.Timeout = 1000;

HttpWebResponse response = (HttpWebResponse)(request.GetResponse());

StreamReader streamReader = new StreamReader(response.GetResponseStream());

returnQuote = streamReader.ReadToEnd();

streamReader.Close();
response.Close();

return returnQuote;
}
}
}



When I run call it from a console app it is fine.



I compile it into a dll and then create the assembly and function as follows:






Code Snippet

drop function fnTestGetIntradayQuoteXML_SJS

go

drop assembly TestGetIntradayQuoteXML_SJS

go

create ASSEMBLY TestGetIntradayQuoteXML_SJS from 'c:DataBackupsCLRLibrariesTestGetIntradayQuote_SJS.dll' WITH PERMISSION_SET = EXTERNAL_ACCESS

go

CREATE FUNCTION fnTestGetIntradayQuoteXML_SJS(@SymbolList nvarchar(max)) RETURNS nvarchar(max) AS EXTERNAL NAME TestGetIntradayQuoteXML_SJS.[Predict.Services.Foo].GetIntraDayQuote

go



declare @testing nvarchar(max)

set @testing = dbo.fnTestGetIntradayQuoteXML_SJS('goog')

print @testing





When I execute the function as above, again, really slow the first time, then fast on subsequent calls. Could there be something wrong with the code, or some headers that need to be set differently to operate from the CLR in SQLServer?



Regards,



Skipper.

View 1 Replies View Related

Problem Unicode Data 0x2300 In SQLServer 2000 SQLServer 2005 Express

Sep 20, 2006

Hi experts;
I have a problem with unicode character 0x2300
I created this table
create table testunicode (Bez nchar(128))

Insert Data
insert into testunicode (Bez)values('Œ€„¢')
with 2 Unicode characters
Œ€ = 0x2300
„¢ = 0x2122

Selecting the data
select Bez from testunicode
I see
"?„¢"

„¢ = 0x2122 is ok but instead of 0x2300 there is 0x3f

When I modify the insert statement like that ( 8960 = 0x2300 )
insert into testunicode (Bez)values(NCHAR(8960)+'„¢')

and select again voila i see
"Œ€„¢"
Does anyone have an idea?

Thanks

View 1 Replies View Related

Trying To 'load' A Copy Of A SQLServer 2000 Database To SQLServer 2005 Express

Apr 18, 2008



I am trying to 'load' a copy of a SQLServer 2000 database to SQLServer 2005 Express (on another host). The copy was provided by someone else - it came to me as a MDF file only, no LDF file.

I have tried to Attach the database and it fails with a failure to load the LDF. Is there any way to bypass this issue without the LDF or do I have to have that?

The provider of the database says I can create a new database and just point to the MDF as the data source but I can't seem to find a way to do that? I am using SQL Server Management Studio Express.

Thanks!!

View 1 Replies View Related

Import DTS File To SQLServer 7.0

Jun 4, 2004

Hy,

Do you know how I could import a .dts file to SqlServer 7.0

Thanks a lot.

Best regards.

Pierre

View 2 Replies View Related

Import Into Excel From Sqlserver

Jan 27, 2008

Hello all,

I wanted to export data from sqlserver and import into excel. My issue here is, when i import into excel, i wanted to update the records in excel if the same record exists in excel. Any one can help me on this...

Thanks

View 3 Replies View Related

Import Data To Sqlserver

Feb 5, 2008



Hi,
How to expor data from Filemaker to Sqlserver? From the Filemaker, I am exporting data into Tab File(values are separated by tab). How to put data from that file into Sqlserver tables?

Thanks

View 3 Replies View Related

MIcrosft SQLServer Best Practices Document On Securing SQLServer

Jul 29, 2005

I'm chasing after a documetn that was available on one of the Microsoftwebsites that was titled somethign like "MS SQL Server Best Practices"and detailed a nyumber of best practices about securing the server.Included in this was revoking public access to the system tableobjects.Can someone post the URL where I can pick this up, or drop me a note oncontacting them for a copy of the document?

View 2 Replies View Related

Replacing Sqlserver 2000 With Sqlserver 2005 Express

Jun 14, 2006

I have an app that uses a sqlserver 2000 jdbc driver to connect to a sqlserver 2000.

Is it possible to do a direct replacement of sqlserver 2000 with sqlserver 2005 express just by reconfiguring the app to point to the express? The app would still be using the sqlserver 2000 jdbc driver to try and make the connection.

If that is a possibility, what can be some differences in the configuration? Previously with 2000 the config information I entered is:

server name: "machinename"( or ip). I've also tried "machiname/SQLEXPRESS"

DB name: name of db instance

port: 1433(default)

user and pass.

My attempts so far results in

"java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket."

and

"java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unable to connect. Invalid URL."

View 1 Replies View Related

Upgrade SQLServer Mobile (.sdf) Database To SQLServer 2005

Feb 9, 2006

Hello,

I have an SQLServer Mobile database, and I would like to know if there is a way to upgrade it to SQLServer 2005 (.mdf) database. My database has no records in it, just the structure (tables etc). What I am actually asking is if I can create automatically a new SQLServer 2005 Database with the same structure as my existin SQLSErver Mobile database

Thanks in advance,

TassosTS

View 1 Replies View Related

Import All Tables From Sqlserver To Informix

May 19, 2008

hi
guys i need to  import all tables from sqlserver to informix ...............
 any idea really appreciated
 

View 5 Replies View Related

Import Data From Excel To SQLserver

Aug 2, 2004

Hi all!

I need to import data from excel file to SQLserver. What is the best way to do this?
Please give as much explanations as possible (code example would be very-very helpful).

Any ideas are wellcome.
Thanks.

View 3 Replies View Related

Import Data From Excel To SqlServer

Dec 28, 2004

Hello,

I want to import data from an excel sheet to SqlServer....
I use a linked server...
I execute the following code:

EXEC sp_addlinkedserver 'ExcelSource',
'Jet 4.0',
'Microsoft.Jet.OLEDB.4.0',
'c:MyExcel.xls',NULL,
'Excel 5.0'
GO

sp_addlinkedsrvlogin N'ExcelSource', false, sa, N'ADMIN', NULL
GO

SELECT * FROM ExcelSource...Sheet1$
GO

and I get the error:

Server: Msg 7314, Level 16, State 1, Line 2
OLE DB provider 'ExcelSource' does not contain table 'Sheet1$'. The table either does not exist or the current user does not have permissions on that table.
OLE DB error trace [Non-interface error: OLE DB provider does not contain the table: ProviderName='ExcelSource', TableName='Sheet1$'].

When I execute the command:

select * from OpenRowset('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=c:ook1.xls',Sheet1$)

I get the same error...

Can anyone help me?

Thanks
Korina

View 7 Replies View Related

SQLServer 2005 -Import/Export

Sep 8, 2006

I need to export tables/views/stored procs and user functions from one DB to another on a regular schedule. It would be good if I can make a deployable application so that it can be scheduled with sql agent.
I tried to use DTSWizard with Management studio but it does not seem to export stored procedures. Can someone walk me though this ?
Thankyou

View 1 Replies View Related

Import Text File In SqlServer ...

Oct 21, 2007

dear all,
I have a text file that contains data that i need to insert into sql server... the file size is about 800 MB .. and contains about 17,000,000 lines ..
some one told me that there is a way in sql server to import this data automatically by writting some scripts ...
the file looks like this

xxxxxxxxx
xxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
yyyy .. yyyyy "I Need only These fields (the Ys).. I don't care about the rest of the file"
yyyy .. yyyyy
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx

any help is really appriciated

View 3 Replies View Related

Import Text File To Sqlserver

Nov 9, 2007

Hi,
I am using DTS to import data from text file to database tables in SQL server2005.
there is one big column thay I dont know what data type I should use to import it, I tried both nvarchar(MAX) and varchar(MAX).

but I am getting the following error:

for nvarchar(MAX) , getting the below error:

Error 0xc02020ed: Data Flow Task: Columns "Column 2" and "VendorDesc" cannot convert between unicode and non-unicode string data types.
(SQL Server Import and Export Wizard)

for varchar(MAX) , getting the below error:


Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column "Column 2" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
(SQL Server Import and Export Wizard)



Could you please let me know what data type I can use to handle this column?

Thanks,
Gelareh

View 1 Replies View Related

Excel Import To Sqlserver Database

Sep 13, 2006

Hi all,

this is thiru from India, hope i shall get answers here for my questions.

1. I need to import an Excel spread sheet to a remote sql server database through ASP.Net web application. I brief the process im following now please go through it.

Import Process:

a. select a fiile(.xls) and upload it to server.
b. using M/S Odbc Excel driver, and the uploaded excel file as datasource,
c. query the excel sheet to populate a dataset.
d. iterate through the rows of the dataset(I could not bulk copy the excel data, because
have to check the database, if record exists then update, else insert) to import to the
SQL Database

Performance issues:
1. I have to import spreadsheets having upto 60,000 records or even more at a time.
2. Is this a good option to use a webapplication for this task (I use this approach because
my boss wants to do so).
3. some times the excel file size grows up to 7 mb(Though i shall adjust config settings,
uploading and then querying a 7 mb file shall be an ovverhead i think.)
4. is there any possibility to get the datasource with out uploading the file to the server (Like
modifying the connection string as "datasource=HtmlFileControl.PostedFile" instead,)(I
tried this but it gives me "unspecified error").

please analyse my problem and suggest me a possible solution.
I thank all, for your efforts, of any kind.
have a nice time,
........thiru

View 7 Replies View Related

SQLSERVER Parameter

Jan 19, 2005

Hie,
I have change the lock_timout value with the command set lock timeout nn
but when in stop/start the instance i lost my new value.
How can i do to change definitively the value.

Thanks in advance.

View 1 Replies View Related

Import Tabbed Text File To The Sqlserver

Jun 1, 2008

I m working with tabbed text file, i manually import it to databases and so on.. i want to make a function which automatically call that text file and convert it to sql server database..  anybody knows how to achieve this..thx 

View 1 Replies View Related

IMPORT Multiple CSV Files To SQLSERVER Table

Jan 21, 2005

Dear All,

I am importing all the files from a particular folder to a table on my database KB. It is working perfectly if i use it on the same system where the DB exists and not working from the network.


USE TESTDB

--Table Creation Starts here

Create table Account([ID] int IDENTITY PRIMARY KEY, Name Varchar(100),
AccountNo varchar(100), Balance money)

Create table logtable (id int identity(1,1),
Query varchar(1000),
Importeddate datetime default getdate())

--Table Creation ends here

---Stored Procedure Starts here

Create procedure usp_ImportMultipleFiles @filepath varchar(500),
@pattern varchar(100), @TableName varchar(128)
as
set quoted_identifier off
declare @query varchar(1000)
declare @max1 int
declare @count1 int
Declare @filename varchar(100)
set @count1 =0
create table #x (name varchar(200))
set @query ='master.dbo.xp_cmdshell "dir '+@filepath+@pattern +' /b"'
insert #x exec (@query)
delete from #x where name is NULL
select identity(int,1,1) as ID, name into #y from #x
drop table #x
set @max1 = (select max(ID) from #y)
--print @max1
--print @count1
While @count1 <= @max1
begin
set @count1=@count1+1
set @filename = (select name from #y where [id] = @count1)
set @query ='BULK INSERT '+ @Tablename + ' FROM "'+ @Filepath+@Filename+'"
WITH ( FIELDTERMINATOR = ",",ROWTERMINATOR = "")'
--print @query
exec (@query)
insert into logtable (query) select @query
end

drop table #y

--sp ends here

Exec usp_ImportMultipleFiles 'c:myimport', '*.csv', 'Account'

If i use the above Exec like

Exec usp_ImportMultipleFiles '\kb-02C$MyImport', '*.csv', 'Account'
I am getting the following error:

Could not bulk insert because file '\kb-02C$MyImportAccess is denied.' could not be opened.
Operating system error code 5(Access is denied.).

C Drive and MyImport folder is shared on system kb-02

Would appreciate your valuable HELP.

thanking your valuable help in advance.
K006B

View 2 Replies View Related

How To Export/import A Sqlserver Diagram From A Database To Another

Jul 2, 2007

Hi everybody,



Is there a way to export and import a database modeling (diagram) from a database to another?

and how could I script my relationship between tables ?

Thanks

Sophie

View 6 Replies View Related

SQLSERVER 2005 X64 Linked Server To SQLSERVER 7.0

Jun 20, 2007

Hello people.

I am in the process of planning a server upgrade to sql2005 x64.

I created 2 linked servers: one to a SQL2000 sp4 server and one to a SQL7.0 SP3.

I have the following error when I query the linked servers.
OLE DB provider "SQLNCLI" for linked server "IVDM2K" returned message "Unspecified error".
OLE DB provider "SQLNCLI" for linked server "IVDM2K" returned message "The stored procedure required to complete this operation could not be found on the server. Please contact your system administrator.".
Msg 7311, Level 16, State 2, Line 1
Cannot obtain the schema rowset "DBSCHEMA_TABLES_INFO" for OLE DB provider "SQLNCLI" for linked server "IVDM2K". The provider supports the interface, but returns a failure code when it is used.

I am aware of KB 906954.
http://support.microsoft.com/default.aspx?scid=kb;en-us;906954

I applied the instcat.sql on the SQL2000SP4 server and my linked server issues for that one are gone.

However, I ran the instcat.sql script on the SQL7.0 sp3 server and the linked server is still giving me an issue.

Can someone help me find a solution to this?

View 1 Replies View Related

Post Update For SQLServer SP2--is There One For SQLServer Express?

Apr 18, 2007

Regarding KB935356, is there a "post" service pack 2 update for SQLServer Express?



Thanks.

View 7 Replies View Related

Implementing Export And Import Functionality Of Sqlserver Through Code Behind (vb.net???)

Jan 5, 2007

Hi All,
can some body help me out ?????
Requirement: i want to export a complete database into an excel file... i can do this from wizard available in sql server 2000/2005 (DTS Export/Import wizard).
but i need to do it through an application (windows or web)....
and i also want to import the same excel file on single button click...
 can some body help me out
 
with regards,
Bhanukiran M  R

View 1 Replies View Related

Can't Access To Db In My Sqlserver

May 23, 2008

with this message
Cannot open database "hayat" requested by the login. The login failed.Login failed for user 'NT AUTHORITYIUSR'.
but i have 'NT AUTHORITYIUSR' user n my sql srver and my db how can i mak th permission right and i don't to us user and passwordx

View 6 Replies View Related

Access To SQLServer

Aug 23, 2006

Hi all,

I have to transfer an Access Database to SQLserver. There're hundred of tables in the original DB which use True, False value. Those will be translated to -1, 0 in SQLserver. I need them to be 0 , 1 instead (-1=>1).

Is there a way to tell SQLServer to process this modification during the transfer or is there a store procedure which can go through all tables and modify those values ?

Any help will be appreciate..

Thank you all

View 8 Replies View Related

Access To Sqlserver Transfering ?

Nov 14, 2006

I am having Access database in my local system . Values in the access database will be updated for every 5 min . I am also having Sqlserver database online  with the same structure database of Access in my local system . What i want is my Access database values must be updated in my online sqlserver at every 5 min automatically .How to do that ?

View 3 Replies View Related

Cannot Edit SQLServer Using MS ACCESS

Mar 31, 1999

We are using MS Access as a front end to a SQL Server 6.5
Database using ODBC & linking tables in Access.


We are unable to edit certain records using access. We
get the following error message:

"This record has been changed by another user since you started
editing it. If you save the record, you will overwrite the changes
the other user made.

Copying the changes to the clipboard will let you look at the values
the other user entered, and then paste your changes back in if you
decide to make changes."

What the message says is untrue in our case. Worse, there is
no way to recover and have the desired change posted. This error
occurs only with certain records. This error occurs when there are
no locks active (and only 1 client logged in).

I am inclined to think that this error may be the fault of ODBC.

Updating the same change directly into ISQL works fine. SQL Server Permissions
have beeen checked & double checked.

If you have suggestions as to how this error can be rectified, please contact
me:
Mark Blackburn
mark@mbari.org
http://www.mbari.org/~mark

View 3 Replies View Related

Differences Between Sqlserver 2000 And Sqlserver 7.0

Dec 29, 2005

Hi Friends,
 
Can some please let me know the differences between sqlserver 2000 and sqlserver 7.0

View 1 Replies View Related

Difference In SQLSERVER/sqlExpress And SQLSERVER

Jun 6, 2007

Hi,
I am new to SQL Server 2005. I tried connecting to my local machine by using my machine name as Server name and then tried running the following query:
SELECT * FROM SYS.Objects. It gives me following error:
Invalid object name 'sys.objects'.

Whereas, if I connect to my local machine using mahcinenameSQLEXPRESS, then the above mentioned query runs fine.

Why is this difference? What is the difference when I login in these 2 different ways.
Any help would be appreciated.

Thanks in advance.

Any help

View 1 Replies View Related

Data Access From Sqlserver 2000

Sep 7, 2007

Hello
      i have one prob . i m using   sql server 2000 . and i have write a store procedure to fetch data from multiple table using cursor  .  this query exculate in sql server .  but i can't fetch this data from  in our page . how to fetch data from using multiple table  .plz help
     thnx

View 8 Replies View Related

Access Multiple Sqlserver Database Using VB

Aug 31, 2004

How can i access multiple sqlserver database using VB
eg. insert 1 record in a database from other databse.

View 1 Replies View Related

Sqlserver Access Datatype Differences

Jul 20, 2005

can someone point me to the differences in the datatypes between accessand sqlserver?I've writen a program that creates a table in access using an sql createquery. However, if I point to a sqlserver odbc datasource the querybombs

View 4 Replies View Related







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