Convert access to sql server

please help
I have sql  work in access  but in sql server I get error
TRANSFORM First(Eval1to4.answer) AS FirstOfanswer SELECT Eval1to4.evalOid, Membershiptypemap.mappedvalue as membership, First(Eval1to4.answer) AS [Total Of answer] FROM (Members RIGHT JOIN (Eval1to4 LEFT JOIN Orders ON Eval1to4.evalOid = Orders.oid)
ON Members.CID = Orders.cid) LEFT JOIN MembershipTypeMap ON (Members.MembershipStatus = MembershipTypeMap.membershipstatus) AND (Members.Membership = MembershipTypeMap.membershiptype) WHERE Orders.program = 20501225 AND Eval1to4.evalProgID=20501225 GROUP BY
Eval1to4.evalOid, Membershiptypemap.mappedvalue PIVOT Eval1to4.questionID
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near 'Eval1to4'.
please help

How can we help you reading the article ?!?
Please clarify what do need more help. Did you read the article Uri suggested ? 
This might help you in general:
>> 'First' is not SQL Server function. The FIRST() function returns the first value of the selected column. In SQL Server you use "top 1" with "order by" hint.
>> In each virtual table like "select from (<this is virtual table>)" you need to write a name. For example "select from (<this is virtual table>) as T"
>> After this, you should read the article and understand the pivot format in SQL Server.
Please read this article! Converting from MS Access [VBA] to SQL Server [T-SQL]
http://social.technet.microsoft.com/wiki/contents/articles/22731.convert-vba-code-to-transact-sql.aspx
I hope this is useful :-)
[Personal Site] [Blog] [Facebook]

Similar Messages

  • Any way of importing from Access to SQL Server?

    I have a huge store of information in Access. But now I'm required to use SQL Server.
    Is there any way of importing the information from Access to SQL Server by Java programming?
    Or is there a manual way of doing that?
    Thank you in advance.

    I need to use Java because this is for a client. I
    can't expect the client to follow those steps. As a
    result, I want to create something simple for the
    client to convert from Access to SQL Server.
    Any other way of doing that?
    That argument does not make sense.
    There is no way that a 'client' is going to be able to manage MS SQL Server without understanding how it works. MS SQL Server is a complex database and requires at least some dedicated support, even if it is only part time.
    For example consider the following:
    -MS Access does not have a log file. MS SQL Server does. How is the log file going to be sized?
    -If the log file fills up (like for a run away query) MS SQL Server comes to a screeching halt. How is that problem going to be fixed?
    Now maybe you are going to provide that support, which means you can run those scripts. Or the client is going to support it in which case they need to have someone who understands it - and they will need to know how to run those scripts (since it is rather basic knowledge.)

  • Configure Synchronization Connections An error has occurred while accessing the SQL Server database

    Hi,
    i am getting following error message
    Central Administration --> Synchronization Connections
    An error has occurred while accessing the SQL Server database or the SharePoint Server Search service.
    If this is the first time you have seen this message, try again later. If this problem persists, contact your administrator.
    Central Administration -->  Manage Profile Service: User Profile Service Application --> Manage User Properties
    Error
    An unexpected error has occurred.
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Correlation ID: 3bce5a11-f2dc-4788
    Please tell how to fix it.
    iffi

    Event ID 5555 -> i have change the Timer jobs recycling time AM to PM
    for  User profile page not display  number of count in the page first check services , connection , 
    IISRESET /NOFORCE   /  timer services restart 
    Deepesh Yevle MCTS

  • How can I develope a native mobile cross platform app that can access an SQL server.

    I would do it in html5 as a web app but I also need to access an SQL server and upload data(text) pictures from the camera and
    geolocation data etc.
    I've developed many web based applications, but this is this first attempt to integrate native device functions AND interact with an SQL database.
    So it would have to be able to use form data  then add a photo and geolocation and send everything to the database.
    A site with examples and/or tutorials would be nice.
    To make things worse, I'd also have to be able to work offline and re-sync when networks connections allow.
    If a native app would be too complex, then I was thinking I might be able to develope an app that gathers data then
    passes the info on to a browser to connect with the database.
    But as much as possible I don't want to have to swing back and forth between a browser and an app.
    Pete

    Here is a page a I bookmarked a while back to use jQUERY to access a php scripts sitting on a server that can then interact with the database in the usual way. This means that you will be able to use DW to create the usual HTML CSS and jQuery to make an interactive app.
    I havn't yet tried this but a quick look over the script looks good. Make sure you use php that sanitizes input.
    http://stackoverflow.com/questions/8246380/adding-a-database-to-jquery-mobile-site
    Let me know how you go.

  • Accessing MS Sql Server with Java classes - problem connecting to socket

    I found an example at this location which uses java classes to connected to MS Sql Server.
    http://search400.techtarget.com/tip/1,289483,sid3_gci1065992,00.html
    --bummer - it is a login location - so I will include the article
    Anyway, the example is using Websphere, but I am still on Jbuilder (will get wsad soon). So I planted the classes from the example in
    C:\Borland\JBuilder\jkd1.4\jre\lib\ext\...the classes
    Then I copied the code from the example to my jpx project and got an error that it could not connect to the socket. The only thing I changed in the code was the connection string:
    --original string from example:
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://1433", "");
    I was getting an error with the 2 argument version of DriverManager - and the second argument here was empty (properties argument). Here was my connection string:
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://Myserver:1433;User=sa;Password=");
    I am only using the 1 argument version of DriverManager. Note that the password=" is blank because my RnD workstation is standalone - no one accesses the sql server except me - so no password. I also left out the last semicolon I noticed. Any suggestions appreciated how I could fix this.
    Thanks
    source of article:
    http://search400.techtarget.com/tip/1,289483,sid3_gci1065992,00.html
    iSeries 400 Tips:
    TIPS & NEWSLETTERS TOPICS SUBMIT A TIP HALL OF FAME
    Search for: in All Tips All search400 Full TargetSearch with Google
    PROGRAMMER
    Sample code: Accessing MS SQL Server database from the iSeries
    Eitan Rosenberg
    09 Mar 2005
    Rating: --- (out of 5)
    Nowadays with the help of Java the iSeries can be integrated with other databases quite easy. This tip shows you how. The code included here uses the free Microsoft driver that can be downloaded from here. (SQL Server 2000 Driver for JDBC Service Pack 3)
    If your SQL server does not include the Northwind Sample Database you can find it here.
    http://www.microsoft.com/downloads/details.aspx?familyid=07287b11-0502-461a-b138-2aa54bfdc03a&displaylang=en
    The download contains the following files:
    msbase.jar
    mssqlserver.jar
    msutil.jar
    Those files needs to be copied to the iSeries directories (/home/r_eitan/ExternalJARs).
    Here's the directory structure (on the iSeries) for this sample:
    /home/r_eitan/ExternalJARs - Microsoft files (msbase.jar,mssqlserver.jar,msutil.jar)
    /home/r_eitan/JdbcTest02 - My code (Main.java,Main.class)
    The Java code
    import java.sql.*;
    import java.io.*;
    class Main {
    * Connect to Microsoft SQL server and download file northWind.products as tab
    * seperated file. (products.txt)
    public static void main(String args[]) {
    try {
    PrintStream outPut = new PrintStream(new BufferedOutputStream(new FileOutputStream("products.txt")));
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    //Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://1433", "");
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://Myserver:1433;User=sa;Password=");
    System.out.println("Connection Done");
    connection.setCatalog("northWind");
    String sqlCmdString = "select * from products";
    Statement statement = connection.createStatement();
    ResultSet resultSet = statement.executeQuery(sqlCmdString);
    ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
    int columnCount = resultSetMetaData.getColumnCount();
    // Iterate throught the rows in resultSet and
    // output the columns for each row.
    while (resultSet.next()) {
    for (int index = 1; index <=columnCount; ++index)
    String value;
    switch(resultSetMetaData.getColumnType(index))
    case 2 :
    case 3 :
    value = resultSet.getString(index);
    break;
    default :
    value = """ + resultSet.getString(index) + """;
    break;
    outPut.print(value + (index < columnCount ? "t" : ""));
    outPut.println();
    outPut.close();
    resultSet.close();
    connection.close();
    System.out.println("Done");
    catch (SQLException exception)
    exception.printStackTrace();
    catch (Exception exception)
    exception.printStackTrace();
    --------------------------------------------------------------------------------------------------

    My guess is that the server's host name isn't right. It necessarily (or even usually) the "windows name" of the computer. Try with the numeric IP address instead (type "ipconfig" to see it).
    First aid check list for "connection refused":
    - Check host name in connect string.
    - Check port number in connect string.
    - Try numeric IP address of server host in connect string, in case name server is hosed.
    - Are there any firewalls between client and server blocking the port.
    - Check that the db server is running.
    - Check that the db server is listening to the port. On the server, try: "telnet localhost the-port-number". Or "netstat -an", there should be a listening entry for the port.
    - Try "telnet serverhost the-port-number" from the client, to see if firewalls are blocking it.
    - If "telnet" fails: try it with the numeric ip address.
    - If "telnet" fails: does it fail immediately or after an obvious timeout? How long is the timeout?
    - Does the server respond to "ping serverhost" or "telnet serverhost" or "ssh serverhost"?

  • Is there any way of importing stuffs from Microsoft Access to SQL Server?

    I have quite a big store of information Microsoft Access DB, but now i am required to switch to SQL Server?
    Is there any way of importing to SQL Server, either by Java programming or manually?
    Thank you in advance.

    I like to give some tips on how to fulfil the requirement.. I haven't tried this. If you succeeded, it is well and good.
    1) Using Java:
    If you like to Java to import the data from MS Access to SQL Server, you have to write a JDBC Program in such a way that it has to retrieve the data from each MSAccess tables and store it in temperory java varaible.After writng into the temp. varaibles, the same thing will be written into SQL Server. The whole process is repeated for all the tables in MS Access.
    2) Manual Process:
    Try to get the data scripts from MS-Access for all the tables and Load the same into SQL Server
    I hope that Manual Process consumes less time compared in writing the codes for transformation..
    I hope that you got some idea on reading this. If you have any doubts, try to get back to me..

  • CONVERT function in SQL Server to oracle

    All,
    How to convert CONVERT function in SQL Server to oracle, below mentioned format is in SQL Server:
    variable1 = convert(numeric(20), SUBSTRING( parameter1,parameter2,parameter3)
    parameter1 datatype nvarchar2(100)
    parameter2 datatype bigint
    parameter3 datatype bigint
    I did bit R&D, but was not successful..but still getting on..
    If any help that would be great...
    Regards,
    ~ORA

    You cannot specify the precision/scale or length of input paramters to a stored procedure in Oracle, or at least the pl/sql engine does not respect the sizing. Assuming that you want to do something with variable1 in the procedure, and not just return it, the Oracle equivalent would be something along the lines of:
    SQL> CREATE FUNCTION f (p_param1 IN VARCHAR2,
      2                     p_param2 IN NUMBER,
      3                     p_param3 IN NUMBER) RETURN NUMBER IS
      4     l_var1 NUMBER(20) := SUBSTR(p_param1, p_param2, p_param3);
      5  BEGIN
      6     RETURN l_var1 * 10;
      7  END;
      8  /
    Function created.
    SQL> SELECT f('ABC10DEF', 4, 2) FROM dual;
    F('ABC10DEF',4,2)
                  100You may need to adjust the return type to match what you are actually returning.
    You can also use this iin a direct assignment in pl/sql without doig a select, something like:
    SQL> DECLARE
      2     l_num NUMBER(20);
      3  BEGIN
      4     l_num := f('ABC10DEF', 4, 2);
      5     DBMS_OUTPUT.Put_Line('The number is: '||l_num);
      6  END;
      7  /
    The number is: 100John

  • MS Access querying SQL Server: How to configure Network ACL?

    I need to set up a highly restrictive ACL for access to a particular SQL server in our network.  This ACL will reside on our core switch at the "front door" of our network and permit access to the SQL server only using the ports that
    are necessary.  The purpose is to A) Try to keep unauthorized users from gaining access to the host server and B) Should someone somehow gain unauthorized access to the host server. keep them from being able to "hop off" to other PC's on
    the network. 
    The server will be accessed by clients using MS Access to query the SQL database and bring back reports.  A few admins are actually able to make minor changes to the database such as updating a user list or location list. In other words, both
    read and write access is needed to the SQL database.
    I know that the default SQL server port is 1433, but according to a Microsoft Support article I read, "client ports are assigned a random value between 1024 and 5000".
    I was really hoping I could just put something like "permit PC1 access to SQL Server on Port 1433" in my ACL, but after reading the MS Support article it sounds like I've got to allow almost 4,000 ports through?
    Could someone help demystify this for me so I can build the right ACL?

    The tool to use is SQL Server Configuration Management.
    But what you can configure is which port SQL Server listens to. Which port the client listens to is not controllable as far as I know. But that can of course be many, since a client can have many connections to SQL Server. (And the range is not
    restricted to 1024-5000. I connected over TCP locally, and I see this with netstat -a
      TCP    127.0.0.1:6621         NATSUMORI:ms-sql-s     ESTABLISHED
    Then again, I don't see why you would have to open any ports for the clients at all. I have never heard of this being a problem.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Lync 2013 Enabling Cross-Database Access in SQL Server

    Hello,
    I want to know when Enabling Cross-Database Access in SQL Server will be enabled for Lync Server 2013.
    Will Lync Server enable it by default?
    Stmart

    DCOM Errors are awful.  Here's a few articles that I've read before that match your error. Some you've likely already seen...
    http://d1it.wordpress.com/2013/10/28/dcom-move-lync-user/
    http://blogs.technet.com/b/dodeitte/archive/2010/12/19/issue-when-moving-legacy-users-to-a-lync-server-2010-pool-using-hlb.aspx
    http://www.networksteve.com/windows/topic.php/Unable_to_Move_users_between_2_Lync_Pools/?TopicId=61736&Posts=2
    http://www.bibble-it.com/2011/03/22/unable-to-move-lync-user-dcom-error
    Using the -force command as Saleesh noted should work, but will kill your contacts.  If it's just a few users that are acting up, you can restore the contacts from backup for these users (export-csuserdata before you start).
    Is it all users, or just a handful?
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question please click "Mark As Answer".
    SWC Unified Communications

  • Query to find the user is having access to sql server DB

    Hi,
    Please help me in this.
    Query to find the whether the user is having access to sql server DB.
    Cheers,
    sajith

    TUBBY_ORCL?Select 1 from dual where 'ORACLE' = 'SQL SERVER';
    no rows selected
    Elapsed: 00:00:00.01

  • BOXI R2 deployment on Solaris, data access to SQL Server and DB2

    <p>Have you deployed BusinessObjects XI Release 2 on Solaris and are accessing Microsoft SQL server 2000/2005? How about DB2? We had planned on using JDBC for SQL Server, and StarSQL 5.x  for DB2. We are having trouble with configuration planning.</p><p>Anyone have experience with this?</p>

    <p>Have you deployed BusinessObjects XI Release 2 on Solaris and are accessing Microsoft SQL server 2000/2005? How about DB2? We had planned on using JDBC for SQL Server, and StarSQL 5.x  for DB2. We are having trouble with configuration planning.</p><p>Anyone have experience with this?</p>

  • RH server 8 - upscaling from Access to SQL Server 2008?

    Hi gang-
    We are currently running RoboHelp Server 8 on the default Access database and Tomcat. We would like to increase the number of help projects that are tracked by the RH Server, and have concerns that Access will handle the increased load, so we are considering upsizing to SQL Server 2008.
    Our IT people think this should be fairly straightforward, but want to know if Adobe provides any tool or has any recommendations when upsizing from Access to SQL Server.They are concerned about retaining things like primary and secondary keys, as well as any indexes that are currently in Access.
    If anyone has experience with such a migration, please share!
    Thanks,
    -=Ed.

    We are also currently on an Access DB and considering (have been for some time but that's a different story) upgrading to SQL Server. There is no migration tool from Access to SQL Server provided so you'd have to allow some additional effort if you want to retain the data. I am not an expert on DBs but I'm sure there are ways to migrate the data. I have found a few links when searching on Google. For example:
    http://support.microsoft.com/kb/237980
    Adobe does provide a cheat sheet at the link below which may be useful to you.
    http://blogs.adobe.com/techcomm/2009/05/advanced_database_setup_for_robohelp_server_8.html
      The RoboColum(n)
      @robocolumn
      Colum McAndrew

  • How to insert data from access to sql server ?

    How to insert data from access to sql server ?
    Please help me
    thanks

    phamtrungkien wrote:
    How to insert data from access to sql server by JAVA?The first four words of my last post:
    masijade wrote:
    JDBC with two connectionsGet a resultset from the jdbc-odbc bridge access connection, cycle through it and add batch insert commands to the jdbc connection to sql server. Give it a try and if the code has an error, then post your code ans ask a question.
    The real question, though, is why you think it absolutely necessary to use Java for this.

  • Upsizing from Access to SQL Server - eek!

    Ok - I've built quite a few dynamic sites using DW and
    Access, but the site
    i'm currently working on requires Microsoft SQL Server for
    the database.
    The site is almost complete and is written in Classic ASP.
    Can anyone point me in the right direction, tutorials, crash
    course, etc to
    get me up to spped with the task?
    Would my ASP code need changing at all?
    Thanks in advance
    Andy

    Hi Joe
    Thanks for the help -
    Andy
    "Joe Makowiec" <[email protected]> wrote in
    message
    news:[email protected]..
    > On 19 Feb 2007 in macromedia.dreamweaver.appdev, Andy
    wrote:
    >
    >> Ok - I've built quite a few dynamic sites using DW
    and Access, but
    >> the site i'm currently working on requires Microsoft
    SQL Server for
    >> the database. The site is almost complete and is
    written in Classic
    >> ASP.
    >>
    >> Can anyone point me in the right direction,
    tutorials, crash course,
    >> etc to get me up to spped with the task?
    >> Would my ASP code need changing at all?
    >
    > As Far As I Know - the only place you'll run into a
    problem is that there
    > are a few differences in SQL between Access and SQL
    Server. There are a
    > number of sites with information:
    >
    >
    http://www.google.com/search?q=differences+access+sql+server
    >
    > The first result (at aspfaq.com) looks good.
    >
    > But you shouldn't have any problem with the ASP code. I
    think you'll
    > like the change from Access to SQL Server.
    >
    > --
    > Joe Makowiec
    >
    http://makowiec.net/
    > Email:
    http://makowiec.net/email.php

  • Issue while accessing a SQL Server table over OTG

    Hi,
    I have been learning oracle for about 1.5 years and am just starting to learn some OTG pieces. I am wondering about an issue. The issue is:
    "We need help with an issue we are having while accessing a SQL Server table over OTG. We are getting the following error message in Oracle :
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Oracle][ODBC SQL Server Driver]Unicode conversion failed {HY000}
    The column it is failing on is "-----------" in the view --------------- in the SQL Server database pointed to by the Oracle DB Link ------------------- thats created in the Oracle instances ---- and -----.
    This was working before, but is now failing, we suspect its due to new multi-byte data being added to the base table in the above column."
    I took out the details and added ---- instead. I am wondering your guys thoughts on fixing this issue and helping me learn along the way. Thanks

    Hi Mike,
    Thanks for the response, here are the details:
    1. What is the character set of the Oracle RDBMS being used. What is returned by -
    select * from nls_database_parameters;
    NLS_CHARACTERSET
    AL32UTF8
    NLS_NCHAR_CHARACTERSET
    UTF8
    We get SQL_Latin1_General_CP1_C1_AS and 1252 as Collation Property and Code Page
    The datatype of the column in question in SQL Server is nvarchar(100).
    When I do a describe on the SQL Server view ( desc CK_DATA_FOR_OPL@------- ), I get the error below;
    ERROR: object CK_DATA_FOR_OPL does not exist
    Select * from CK_DATA_FOR_OPL@------ where rownum =1 does get me a row.
    create table tmp_tab as
    Select * from CK_DATA_FOR_OPL@----- where rownum =1;
    desc tmp_tab shows the datatype of the said column in the table created in Oracle as NVARCHAR2(150).
    Not sure why a column defined with size 100 in SQL Server should come across as 150 when seen over OTG. We see something similar in DB2 tables we access over OTG as well.
    Edited by: 993950 on Mar 15, 2013 8:49 AM

Maybe you are looking for

  • RV042 request timed out

    Hi all, I using the RV042 with the newest firmware version. Really no idea that i keep got "request timed out" when i try to ping the gateway. Who have the same issue with me? Before i think my RV042 is Out of order but still the same after i bought

  • Why register up-to-date has not been iwork

    <Personal Information Edited By Host>

  • Navigational attribute: "not assigned"

    Hi all, I have a strange situation where I have a characteristic (0NOTIFICATN) in a cube (0QM_C10), where the (navigational) attributes of 0NOTICATN show up as "# not assigned" when I try to report on them. I have checked under master data maintanenc

  • Tax jurisdiction from storage location address

    Hi all, During PO creation (ME21N), the tax jurisdiction (Invoice tab) defaults to the one set up in the plant address. Is there a way to have it default to the tax jurisdiction from the storage location address? Thanks.

  • Ipod is disabled connect to iTunes requires passcode which is not known

    Ipod is disabled, says connect to iTunes.  When connected to iTunes, iTunes requires passcode entered.  Stuck in loop