SQLServer DTS Query

May 7, 2005

Hi,

I have a DTS query to move data from Access to an existing SQLServer table. There is a date column. When I build the query and choose "all rows" I get a good transfer. The problem is when I choose criteria (from the date column) and select a value from the box that comes up with a list of dates--the dates that are in the date column are what comes up, obviously...so if I choose one, then my query ends up looking something like this:

...WHERE [table].'CurrentEndDate'>='5/6/2005'...

If I run the DTS package like this, I get a failure and an error message that reads "data type mismatch in criteria expression". I don't understand this error message since when I run for "all rows" the data transfers just fine. The Access and SQLServer colums are both formatted "DateTime".

Can anyone help me on how to fix this...I'm trying to set up the package so when it runs, it only selects the rows added to the ACCESS table since the last transfer. If there is a way to script that, plz advise.

Thx much,

Reid C.

View 2 Replies


ADVERTISEMENT

Problem With Sub Query In Sqlserver

May 1, 2007

Hi
I am new user to sqlserver, I have been using access db for my project, and now decided to upsize it to sqlserver. I did, the db is converted to sql, using the upsize wizard in MS Access. Now I have two problems with sql server.
 No. 1: An embedded query that I wrote for data grid paging isnt working in sql server and giving me an error message, saying Incorrect syntax near the keyword 'order'. The query that is generated is:
Select cust_order.order_id as order_id,customers.fname as fname,customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from (select top 20 order_id,fname,lname,order_date,order_status from (select top 580 order_id,fname ,lname,order_date,order_status from cust_order,customers where customers.customer_id=cust_order.customer_id order by order_id) order by order_id desc) order by order_id;
There are actually three different queries, one (the simpler one) for page one is working, the other query is for page to till second last page that returns fix size of 20 records, while the last page returns the remaining 20 or less records: the above query is actually the one for last page. Here is the three queries:
If PN = 1 Then
SelectQuery = "select top " & perpage & " cust_order.order_id as order_id,customers.fname as fname , customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from cust_order,customers where customers.customer_id=cust_order.customer_id order by cust_order.order_id;"
Else
If PN = totPages And Remand > 0 Then
SelectQuery = "select cust_order.order_id as order_id,customers.fname as fname,customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from (select top " & Remand & " order_id,fname ,lname,order_date,order_status from (select top " & CLng(PN) * perpage & " order_id,fname,lname,order_date,order_status from cust_order,customers where customers.customer_id=cust_order.customer_id order by order_id) order by order_id desc) order by order_id;"
Else
SelectQuery = "select cust_order.order_id as order_id,customers.fname as fname,customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from (select top " & perpage & " order_id,fname,lname,order_date,order_status from (select top " & CLng(PN) * perpage & " order_id,fname ,lname,order_date,order_status from cust_order,customers where customers.customer_id=cust_order.customer_id order by order_id) order by order_id desc) order by order_id;"
End If
End If
I hope I can find someone help me with this. Its working in access just fine but not in sql server. 
 

View 3 Replies View Related

SqlServer Query Visualizer

Dec 4, 2007

I added the SqlServerQueryVisualizer dll to D:Program FilesMicrosoft Visual Studio 9.0Common7PackagesDebuggerVisualizers and I can see the sql statement generated by the LINQ object, however when I click on Execute an expcetion is thrown saying log in failed for user sa...
The user and password I'm using are 100% correct.
Any ideas ?

View 1 Replies View Related

Cross Tab Query In SqlServer

Nov 26, 2006

Hi,I have three tables with there fields given in brackets:User: [userId as int] (PK), [userName as navarchar]Divisions: [divisionId as int] (PK), [divisionName as nvarchar]DivisionsOfUsers: [userId as int],[divisionId as int]the "DivisionsOfUsers" tables has many-to-many relationships betweenuserid and divisionId.I would like to generate a result something like this:Division1 Division2 Division3User1 1 0 0User2 0 0 1User3 1 1 0User4 0 0 0and so on....where "1" indicates that the given User-Division combination exists and"0" denotes that it doesnt in the "DivisionOfUsers" table.I have tried all sorts of joins to get this data. But was unable to dothis.I have been told that this is possible by a cross-tab query. I dontknow how to generate this query.Can anybody give me a solution for this to be used in Sqlserver 2000 aswell as Sqlserver 2005.Thanks in advance

View 1 Replies View Related

Query Oracle -&> Sqlserver

Aug 14, 2007

select pippofrom(select person.name as pippofrom person)This query run in oracle....in sqlserver no!what can i do!?thank's

View 1 Replies View Related

SQLServer Equivalent For Oracle Query.

Nov 30, 2004

Hi,

Could anyone tell me what is the MSSQLServer equivalent of the following Oracle query?.

SELECT v1.cat, v1.gnr, TA1.desccde, v1.type, v1.cde
FROM view1 v1, table1 TA,
table1 TA1, table1 TA2, table1 TA3
WHERE
TA.txtcde (+) = TRIM(v1.cat)
ANDTA1.txtcde (+) = TRIM(v1.gnr)
ANDTA2.txtcde (+) = v1.cde
ANDTA3.txtcde (+) = TRIM(v1.type)

Thanks,
Gopi.
Follow your DREAMS...

View 3 Replies View Related

What Is The Query To Find A 5th Highest Salary With Sqlserver.

Aug 9, 2005

What is the query to find a 5th highest salary.in emp table.i also use top1,top2,..but i don't get a result.what is new in sql server 2005.

View 11 Replies View Related

Converting Oracle Slq Quer To Sqlserver Query

Jan 14, 2001

Hi ,

I have a question for all , please help me out.

the question is : i have a query in Oracle like this
select count(*), to_char(ISL_FIRST_VISIT, 'Day, mm/dd/yyyy') from ISL_USERS
group by to_char(ISL_FIRST_VISIT, 'Day, mm/dd/yyyy')
order by to_char(ISL_FIRST_VISIT, 'Day, mm/dd/yyyy');

i want to convert this into SQLserver but in SQL server equlent function for TO_CHAR is Datename ..when i have given this i am getting error . please give me the tip on this issue .

thanks
shekhar

--------------------------------------------------------------------------------


|

View 1 Replies View Related

Query Problem: From Sybase ASA To SQLServer 2005

Apr 18, 2008

Hi,

I'm doing a migration from Sybase SQL Anywhere to SQL Server 2005.
This is one of the query that doesn't work:



select card_nr as cCard,

card_type as cType,

tab_cards_profile.profile_name as cProfile_name,

dbo.fn_name_pdcode( cCard, cType, tab_history.system_code ) as cCard_name,

dbo.fn_card_date_entry(cExit, cCard, cType, tab_history.system_code ) as cEntry,

evn_date+evn_time as cExit,

tab_history.profile_id,

payment_type,

dbo.fn_name_pdcode( param1, payment_type, tab_history.system_code ) as cPay_name,

param1,

datediff(minute, cEntry, cExit) as durata,

amount

from tab_history

LEFT OUTER JOIN tab_cards_profile ON ( tab_history.profile_id = tab_cards_profile.profile_id AND tab_history.card_type = tab_cards_profile.profile_type)

LEFT OUTER JOIN tab_personal_data ON tab_personal_data.name = cCard_name


Both the functions called

dbo.fn_name_pdcode( cCard, cType, tab_history.system_code ) as cCard_name,


dbo.fn_card_date_entry(cExit, cCard, cType, tab_history.system_code ) as cEntry


seems that can't work if I use as parameters alias of columns... This could be a problem; in sybase ASA that query can be executed.
there is any work around to help this query runs?

Thaks..

Luca



View 8 Replies View Related

Calling Encrypt2 Function From Sqlserver Select Query

Jul 23, 2005

I use a database that has user names stored in Encrypted format usingthe following API.Declare Sub Encrypt2 Lib "QPRO32.DLL" (ByVal Work As String, ByValPASSWORD As String)Every time i require the user name i have to again decrypt the nameusing the same function.My problem is that when i fetch a large number of records i have toloop through every record and call the encrypt function for eachrecord.Instead of binding the recordset to my control i need to loopthrough and fill my controlA MSHFlexGrid in Vb6.0.Is there a way out to this problem that will make my record populatiogfaster withoutout changing the current Encrypted users.Thanx in Advance

View 2 Replies View Related

Difference Of Sqlserver Management Studio With Query Analyzer?

Nov 21, 2005

what are the new features provided by SQL management studio

View 4 Replies View Related

Update Set Of Columns Using Select Query In Sqlserver 2000

Feb 14, 2008

hi !!!!!!!!!!!!!!!!!!!!!!!
I have 3 tables

let say Employee,Employee_temp,emp_approval

i want to update employee table by selecting columns from employee_temp

i do that using oracle but i want it using sql server 2000

Sample syntax Below: for oracle

update employee e set (col1,col2,col3,col4)=
(select t1.col1,t1.col2,t1.col3,t1.col4 from employee_temp t where t.col1=:new.col1) where e.col1=:new.col1


this syntax for oracle....

plsease provide sql 2000 syntax and sql 2005 syntax please.........


thank you.

View 6 Replies View Related

Plz Help Me To Upload My Sqlserver Data Base With Query Analyzer Method

Jul 27, 2004

plz help me to upload my sqlserver data base with query analyzer method
plz write the code i should write in query analyzer box to uplode
my database(db) in my server(h_server)
and is it neccessary to uplode log file or not
,or guide me with intruducing a site

View 2 Replies View Related

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

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

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

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 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

How To Transfer Data From A SqlServer Database To A SqlServer Express Database

Mar 29, 2006

Is there a way to transfer data from a SqlServer db to a SqlServer Express db. I tried to use the backup file of SqlServer, but this file is not valid for SqlServer Express. Or there any alternatives?

thanks,

Henk

View 7 Replies View Related

Not Be Able To Reinstall SQLServer 2005 After SQLServer 2005 SP I

May 9, 2006

Hi every body,

I have SQLServer 2005 runs well for months and stop working after install SqlServer2005 SP1. I try to reinstall the SQLServer 2005 but I have problem when install work station component on my and the error is "There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor". Please help me to fix this bug. I do not want to reformat my machine.

John Dang



View 1 Replies View Related

SqlServer

Mar 8, 2007

When I am trying to insert values into a table which is created using Sql Server.
I am gettin Sql Exception : " String or Binary Data would be truncated.The Statement has been terminated. "
Please help me out to trouble shoot this error.
 
With regards
Khasim

View 2 Replies View Related

Sqlserver LOB !!!

Jan 17, 2008

 
Good day ... I need to know how to make a LOB column in sqlserver...
In table creation I definde the column that will receive the binary data as nvarchar(MAX)
the problem now that whenever I try to read it back I get this error
Unable to cast object of type 'System.String' to type 'System.Byte[]'.and when I define the column as varbinary(MAX) it cant real handle large objects
I have a method that will return a DataTable Here's the code that I use to write
DataTable dt = fm.getFileData(fileID);Response.ContentType = dt.Rows[0][4].ToString();Response.BinaryWrite((byte[])dt.Rows[0][2]);
 
Thanks in advance ...

View 2 Replies View Related

Sqlserver

Mar 6, 2008

what are the minimum tables required to many to many relation ship?

View 2 Replies View Related

Vb-Sqlserver

Mar 23, 2002

when i delete the row from VB using transact sql statement
it returns with an error 'TIMEOUT EXPIRED'

View 1 Replies View Related

DB2---> SQLServer

Aug 8, 2000

hi,

I have a dynamic table in DB2 which I want it to Sychronize it into SQL Server. I was thinking to Dump the Changes and New data into a flat file and Pull that flat file thru DTS...IS that a right way?

OR

Just Pull changed and new data it with the help of CR DB2 ODBC drivers periodically...

or

Any other way? Pelase Advice the Right Choice


Thanks in Advance for Help

Aakash

View 2 Replies View Related

MCP -- (MS SqlServer)

Feb 16, 2001

Hi,
I am interested in getting a MCP (for MS SqlServer, Exam #: 70-028),Can someone refer me some good book and sample tests for preparing for this exam.

Thanks
Ellen

View 3 Replies View Related

Sqlserver

Aug 10, 1998

> Hello,
> Is there a possibility for password expiration in SQL 6.5?
> Thank you

View 1 Replies View Related







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