I hope that some one can find the time to advise an uninitiate. I have built a fairly complex data base system using Access 97 that handles many of my company's day to day operations. I does most of what I want although lately I have found that it has become pretty slow. This could be due to the fact that this is really my first big project and perhaps I could be a bit sleeker with my coding. It could also be due to weaknesses in my network. Finally it could be due to weaknesses in Access. I was wondering if there was any one who might be able to shed a little light on what steps I would take that would be the most likely to speed things up. I realize this is a pretty general question but I would be eager to provide more detials. Any guidance in this matter would be apreciated since I have a bit of money and am planning a LAN upgrade anyway. Perhaps I should save a bit of money on the LAN and put it into a copy of SQL Server? Thanks Chris
I am currently converting over an Access database into SQL. I want to leave the existing Forms and Reports in Access. I have converted the tables but the problem I am having is with the Queries which have some sort of reference to a Form so I am after any tips on how to do this.
Hello, I'm trying to convert a Access DB to a SQL 7 DB, problem is that there are a LOT of of make table queries, and some of these tables use the aggregate function First() when doing the GROUP BY, I know SQL7 doesn't support first, but is there another way to "fake" this FIRST? (I would prefer not to use Min or MAX) Thank
I've been developing an application that will function as an online organization-specific contacts directory for my employer. The interface is coded with ASP and the data is stored using an MS SQL Server 2000 database.
I've completed the coding for the front side of the application and the design and testing of the database itself, so I'm now at the important state of migrating existing data into the new database.
My problem is this:
For the large part, our organization stores its contact data in MS Outlook 2002. This is easily exported to an Access 2002 database, which I have already done for a number of our employees.
I need a way to take the data found in each of these Access databases and insert it into my new MS SQL 2K database. I am aware that an upsizing wizard exists, but the only version I can find is for Access 97 to SQL Server 7 conversions. Beyond that, I don't want to create a whole new database: I simply want to migrate the data I need from the Access files into the schema developed around the new application.
To start off, can I just say that I know very little about SQL databases but I have a MS access database which we are outgrowing and I think we will need to make some changes. I was wondering if some one could offer some advice. There are many programs available for upsizing to SQL but I presume these are for the back end only, is this correct? Is upsizing a bad idea or a very difficult one?
I was also wondering about keeping my Access front end and connecting it to a SQL back end, is this a good idea?
Hi there, apologies if i have entered this into the wrong forum.
I am currently building an application using microsoft access and coding in VBA (what i can!)
When i have got it working as i like after user testing i would like to create an MDE file to distribute to users and i would like to convert the access database held on a file server to a SQL server but have no experience of doing this.
In what order would i do this and would i suffer a loss of functionality in changing from access to SQL i.e. would some of the VBA code not work in SQL?
Hi there,I have written an application which uses MS Access for it's database engine.Due to the large size which the database has become I have decided that itwould be sensible to use SQL Server with the application instead.I am an extreme SQL Server newbie so I am not really sure what I'm doingyet! I have successfully downloaded and installed the MS SQLDE 2000 andservice pack 3.What do I need to do next? Ideally I would like to convert the existingAccess database to MS SQL Server format. Also I would like to know if it ispossible to create an SQL Server database from scratch using a guienvironment similar to Access and if so which software (preferably free) doI need to achieve this?Many thanks,Clive.
I'm in the process of converting over an Access database - The existing Forms, Reports, etc are staying within the Access front-end and the Tables are now linked to the SQL database. The only problem is, most of the Tables contain Autonumber fields, so although they converted over to Identity fields, existing records work fine. When I try to add a new record, it doesn't automatically enter the next available Autonumber/Identity until I select a record which already exists to force it to update itself. When I add a new record using the original Access database, as soon as you start entering information into the new record, the next available Autonumber automatically appears. Any suggestions on forcing it to automatically appear using the SQL database and an Access form????
Is it possible to convert an access 2003 database to SQL without data lost (and more generaly, without lost of information about the database) and then, connect the customer Microsoft ACCESS program to the new SQL database without change in ACCESS program ? Thanks a lot for your answer. P.S.: if there is changes to make, what kind of change for example.
I have imported some tables from msaccess but as the datetime field from access is different from SQL Server I had to change all columns type from datetime to varchar...
Now in SQL Server i'm trying to convert this data into datetime, and I'm using cast(field as datetime) and sql give me this message..."The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."
how can I select these rows that are giving me errors ??? OR is there a way to convert this data ??
I don't know if in this data it will give the error... but as the table is too big...I can't post everything here...
------------------------------- EDIT
I got the problem...
I have data like 4/11/2006 9:23:19 AM and others like 11/21/2005 6:02:13 PM
So the first one 4/11/2006 9:23:19 AM it converts without problem, but wrongly...cause the month is "4" and not "11" the other one 11/21/2005 6:02:13 PM it tries to convert the month as 21 and not as 11....
I'm trying to pass a character (D) to an integer data type!i'm getting this error:Conversion failed when converting the varchar value '17D' to data type int.
I have an application that uses Acces as a backend and VBA as front end. Application is secured and is supplied on a CD with setup.exe.
Can I use VB 2005 and MS SQL to achieve the same?
Would I be able to package my application with all the neccessery files (assuming that client does not have any e.g. SQL server) so that multiple front ends can access data from common source?
Would I be able to secure such an application using only VS 2005?
What would I need to quickly learn how to achieve the above ( any books you can suggest maybe)?
Currently, we are facing a serious problem of conversion from Sql Query to Semantic Query and we are looking for any API or Component that handles this conversion process.
Requirement Details:
I'd like to tell the story happened which lead us to this requirement. We want to convert Shazam Reports (SRW) to Reporting Services (RDL) reports that support Report Builder (semantic queries). So, we planned to convert the SRW query structure into a SQL query structure and later to Semantic Query, which is recognized by the Report Builder.
In that process, we've successfully developed a parser component that parses the SRW's query structure into standard Sql query structure but now we struggling, as we don't know how to convert an sql query into semantic query.
We are running out of time and any information towards the solution is a great help to us.
I am converting an Access 2003 database into SQL 2005 Express for purposes of evaluating the SQL server environment as a future home for my data. One of the motivating factors in the conversion is the integration of LINQ with VB 2008.
Assuming that there was no conversion tool to migrate Access forms for use with SQL and VB 2008, I converted the Access data table and used the VB 2008 form designer to databind textbox controls to fields in the converted SQL database. Here are some basic questions:
The conversion from Access to SQL apparently did not include the default numeric formatting (currency, percentage, etc.) which was part of the Access data table. Is there a place in the SQL server environment to supply a default data format so that forms and reports referencing the field do not need to be manually formatted for each reference?
After converting the data table and spending 2 hours designing the dataform for the 80+ fields, I inadvertantly changed the table structure and found that the dataform was not happy (oops). I corrected the databindings manually for the few errant field references, but wonder if there is some wizard to do this automatically?
Is there a way to print out the dataform itself? I used the following code snippet in my Access form code-behind and I wonder if there is an equivalent VB 2008 function:
Finally, Access can instantly change from dataform to datasheet presentation screens. Can this be done in VB 2008 with two views simultaneously presenting the same SQL data?
Please excuse my naivete, but in contrast to Access 2003 where program functionality is encapsulated into readily apparent controls, menus, and dialogs, the SQL server environment seems foreign, spartan, and all the words are different. Thanks, -BGood
Will it be possible to convert a varchar data type column (having values that are numbers or null only) to a numeric data type column having the number values and the null values not being replaced by 0.
Col A Col A (varchar) (int or numeric) 123 123 124 124 NULL 0 <expected blank> 125 125
I tried using CAST(Col A as int) and it converts the NULL to 0. Will CAST(ISNULL(ColA,'') as int) work? The reason for this requirement is the value 0 will give different meaning to the data. Any insights will be appreciated.
using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Data.OleDb; using System.Collections;
namespace TimeTracking.DB { public class sql { OleDbConnection conn;
// //the constructor for this class, set the connectionstring // public sql() { DBConnectionstring ConnectToDB = new DBConnectionstring(); conn = ConnectToDB.MyConnection(); }
// // // public void UpdateEntry(int ID, string Week, string Year, string Date, string Project, string Action, string Time, string Comment) { int m_ID = ID; int m_Week = (Convert.ToInt32(Week)); int m_Year = (Convert.ToInt32(Year)); string m_Date = Date; string m_Project = Project; int m_ProjectID = new int(); string m_Action = Action; int m_ActionID = new int(); Single m_Time = (Convert.ToSingle(Time)); string m_Comment = Comment;
// //get the project ID from the database and store it in m_ProjectID // OleDbCommand SelectProjectID = new OleDbCommand("SELECT tblProject.ProjectID FROM tblProject" + " WHERE (((tblProject.Project) LIKE @Project))", conn);
// //get the action ID from the database and store it in m_ActionID // OleDbCommand SelectActionID = new OleDbCommand("SELECT tblAction.ActionID FROM tblAction" + " WHERE (((tblAction.Action) LIKE @Action))", conn);
finally { //close the connection if (conn != null) { conn.Close(); } } } } }
Code Snippet
The update statement is not working in my application, no error in C# and no error in ms-access. When I paste the update query into the ms-access query tool and replace the parameter values (@....) with real values, is will update the record.
Hi, I've created a SQL union query that grabs the top three values of a test and puts the results together on one line item by a recordnumber. The only problem is, one value is generating the error: " Syntax error converting the varchar value '=' to a column of data type int." This field is an operator field, so it will only display operator values ( <, >, = ). Everything seems to work BUT the union join on that column, which is a varchar data type. I need this union to work, and Im frustrated that I can't seem to figure out why I can't get the logic to work. Can someone take a look at this and help me with it? The union query looks like this:
exec('select RecordNumber,Sum(rank1) as HbA1CRank1,max(Operator1) as HbA1COperator1,sum(contentValue1) as HbA1CContentvalue1,max(dos1) as HbA1CDOS1,Sum(rank2) as HbA1CRank2,max(Operator2) as HbA1COperator2,sum(contentValue2) as HbA1CContentvalue2,max(dos2) as HbA1CDOS2,Sum(rank3) as HbA1CRank3,max(Operator3) as HbA1COperator3,sum(contentValue3) as HbA1CContentvalue3,max(dos3) as HbA1CDOS3 from (SELECT DISTINCT TOP 100 PERCENT recordnumber, Rank AS rank1, cast(Operator as varchar) as Operator1, contentValue AS contentvalue1, DOS AS DOS1, 0 AS rank2, 0 as Operator2, 0 AS contentvalue2, 0 AS DOS2, 0 AS rank3, 0 as Operator3, 0 AS contentvalue3, 0 AS DOS3FROM (SELECT (SELECT COUNT(*) FROM tblDiabetic_HgbA1C_Total vw1 WHERE vw1.rECORDnUMBER = vw2.rECORDnUMBER AND vw1.ItemCode = vw2.ItemCode AND vw1.Operator = vw2.Operator AND vw1.DOS > vw2.DOS) AS Rank, * FROM tblDiabetic_HgbA1C_Total vw2) vw3WHERE (Rank = 0)ORDER BY RecordNumber UNION SELECT DISTINCT TOP 100 PERCENT recordnumber, 0 AS rank1, 0 as Operator1, 0 AS contentvalue1, 0 AS DOS1, Rank AS rank2, cast(Operator as varchar) as Operator2, contentValue AS contentvalue2, DOS AS DOS2, 0 AS rank3, 0 as operator3, 0 AS contentvalue3, 0 AS DOS3FROM (SELECT (SELECT COUNT(*) FROM tblDiabetic_HgbA1C_Total vw1 WHERE vw1.rECORDnUMBER = vw2.rECORDnUMBER AND vw1.ItemCode = vw2.ItemCode AND vw1.Operator = vw2.Operator AND vw1.DOS > vw2.DOS) AS Rank, * FROM tblDiabetic_HgbA1C_Total vw2) vw3WHERE (Rank = 1)ORDER BY RecordNumber UNION SELECT DISTINCT TOP 100 PERCENT recordnumber, 0 AS rank1, 0 as Operator1, 0 AS contentvalue1, 0 AS DOS1, 0 AS rank2, 0 as operator2, 0 AS contentvalue2, 0 AS DOS2, rank AS rank3, cast(Operator as varchar) as operator3, contentvalue AS contentvalue3, DOS AS DOS3FROM (SELECT (SELECT COUNT(*) FROM tblDiabetic_HgbA1C_Total vw1 WHERE vw1.rECORDnUMBER = vw2.rECORDnUMBER AND vw1.ItemCode = vw2.ItemCode AND vw1.Operator = vw2.Operator AND vw1.DOS > vw2.DOS) AS Rank, * FROM tblDiabetic_HgbA1C_Total vw2) vw3WHERE (Rank = 2)ORDER BY RecordNumber )tblHgA1C group by RecordNumber ')GO Can anyone help? It looks right to me, I just can't figure out why the error keeps coming up = Thank you!
[dbo_commissions.MortgageCommissionReceived]+[dbo_commissions.LifeCommissionReceived]+[dbo_commissions.BandCCommissionReceived]+[dbo_commissions.OtherBusinessCommissionReceived] AS Expr2
, IIf([Expr1]<1000,[Expr1]*0.3,IIf([Expr1]<2000,[Expr1]*0.4,[Expr1]*0.5)) AS Expr3 , IIf([Expr2]<1000,[Expr2]*0.3,IIf([Expr2]<2000,[Expr1]*0.4,[Expr2]*0.5)) AS Expr4
FROM (((((dbo_Personal INNER JOIN dbo_Lead ON dbo_Personal.ID = dbo_Lead.ID) LEFT JOIN dbo_Mortgage ON dbo_Personal.ID = dbo_Mortgage.ID) LEFT JOIN dbo_OtherBusiness ON dbo_Personal.ID = dbo_OtherBusiness.ID) LEFT JOIN dbo_BuildingsAndContents ON dbo_Personal.ID = dbo_BuildingsAndContents.ID) LEFT JOIN dbo_Commissions ON dbo_Personal.ID = dbo_Commissions.ID) LEFT JOIN dbo_Life ON dbo_Personal.ID = dbo_Life.ID WHERE (((dbo_Lead.SourceOfLead) Like "Solutions*"));
I am trying to construct a query in Query Analyzer (with SQL Server 2000), but am getting an error regarding "implicit conversion."
Here is the query:
SELECT dbo.AUCTION.EbayNum, dbo.AUCTION.EndDate, DATENAME([month], dbo.AUCTION.EndDate) + ' ' + DATENAME([year], dbo.AUCTION.EndDate) AS [PmtMonth], dbo.LOT.Description, dbo.AUCTION.WinBid, PaidStat = CASE dbo.AUCTION.PaidStatus WHEN 0 THEN '' ELSE 'PAID' END, PaidAmt = CASE dbo.AUCTION.PaidStatus WHEN 0 THEN '' ELSE dbo.AUCTION.WinBid END FROM dbo.AUCTION INNER JOIN dbo.LOT ON dbo.AUCTION.LotNum = dbo.LOT.LotNum WHERE (LEN(dbo.AUCTION.Winner) > 0)
The error occurs in the PaidAmt CASE statment: "Implicit conversion from data type varchar to money is not allowed. Use the CONVERT function to run this query."
Why is there an implicit conversion going on? And how can I fix it? :mad:
Hi Friends, Need ur help desperately. I am stuck with one of the queries which i had written in Oracle and need the same in SQL Server.Please have a look at the following query :
select * from r_tin_1099_info where instr(translate( nm_ctrl_cd , '~!@#$%^&*()_+}{":?><`-=]['''';/., ', '*******************************' ),'*') > 0;
Basically my purpose is to replace the values in column NM_CTRL_CD having wild card characters with '*' and then select this rows to display.
However i am not able to run the same query in SQL Server since TRANSLATE is not a built in func. I have tried a lot to replace it but could only one func : REPLACE . But the same will not replace any one of the above wild characters but will replace the entire pattern.Please note that it should be able replace even if one of the wild card characters are present in the string and not necessarily the entire pattern shown above.
please reply ASAP since i am working and need this query to fix a defect.
Trying to run a query to get total number of direct mail campaigns by company. Would like the totals to be (1) total number of direct mail campaigns (there are 2 types) (2) total number of direct mail campaigns type direct mail (3) total number of direct mail campaigns type publication
Below is the query I put together with INNER JOIN:
SELECT Agency.PrimaryAgencyName, COUNT(Distinct Campaigns.DirectMailID) AS TotalCampaigns, COUNT(Distinct DirectMail.Type) AS TotalDirectMail
FROM Agency INNER JOIN (Clients INNER JOIN (Campaigns INNER JOIN DirectMail ON DirectMail.DirectMailID = Campaigns.DirectMailID) ON Clients.ClientID = Campaigns.CampaignID) ON Agency.AgencyID = Clients.AgencyID
GROUP BY Agency.PrimaryAgencyName, DirectMail.Month, DirectMail.Type ORDER BY Agency.PrimaryAgencyName
When I run the query, I recent the below error:
Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the nvarchar value '1683 1-15017' to data type int.
The value mentioned in the above error message is the ClientID.
Below are the tables for reference (bold for entity name and underline for PK) and datatypes
I'm converting an ASP system from using msaccess to SQL Server as the db engine, and I'm stumped on the following query
update timecard set TcdDate = #3/18/05#
TcdDate is defined as a date/time type
It will not run with the date bracketed by # signs, and when I take them out, 1/1/1900 is stored in the dbs. Is there a different symbol to bracket the date with or should I be using a function to convert the date?
Hi, I need help. Understatement of the year right now, too = So... I've created a stored procedure that partially pulls a SQL union query to give me a complete one-line result set of a bunch of data... four separate selects comprise the query. The tables are structured identically to each other, but the values being pulled are specific and distinct. All of the non-date values stored are varchar values in the tables, and yet when I execute the SQL union query, I get the error message: Syntax error converting the varchar value to a column of data type int. I know SQL does implicit conversions, however Im not sure why it's trying to do that with this query, I suppose. it should have been straightforward. Any suggestions? Here is the query logic to look at, in case I'm missing the obvious
exec(' SELECT ACCOUNT, LNAME, FNAME, SEX, DOB, cast(MA_ContentValue as decimal) as MA_ContentValue, cast(MA_DOS as smalldatetime) as MA_DOS,cast(LDL_ContentValue as decimal) as LDL_ContentValue, cast(LDL_DOS as smalldatetime) as LDL_DOS, cast(HgbA1C_ContentValue as decimal)as HgbA1C_ContentValue, HgbA1C_DOS, cast(Creatinine_ContentValue as decimal) as Creatinine_ContentValue, Creatinine_DOS FROM ( SELECT Account, Lname, FName, Sex, DOB,MA_ContentValue, MA_DOS, 0 as LDL_ContentValue, 0 as LDL_DOS, 0 as HgbA1C_ContentValue, 0 as HgbA1C_DOS, 0 as Creatinine_ContentValue, 0 as Creatinine_DOS FROM dbo.vwDiabetic_MicroalbuminTop3 UNION SELECT Account, Lname, FName, Sex, DOB, 0 as MA_ContentValue, 0 as MA_DOS, LDL_ContentValue, LDL_DOS, 0 as HgbA1C_ContentValue, 0 as HgbA1C_DOS, 0 as Creatinine_ContentValue, 0 as Creatinine_DOS FROM dbo.vwDiabetic_LDLTop3 UNION SELECT Account, Lname, FName, Sex, DOB, 0 as MA_ContentValue, 0 as MA_DOS, 0 as LDL_ContentValue, 0 as LDL_DOS, HgbA1C_ContentValue, HgbA1C_DOS, 0 as Creatinine_ContentValue, 0 as Creatinine_DOS FROM dbo.vwDiabetic_HgbA1CTop3 UNION SELECT Account, Lname, FName, Sex, DOB, 0 as MA_ContentValue, 0 as MA_DOS, 0 as LDL_ContentValue, 0 as LDL_DOS, 0 as HgbA1C_ContentValue, 0 as HgbA1C_DOS, Creatinine_ContentValue, Creatinine_DOS FROM dbo.vwDiabetic_CreatinineTop3) tbl1
') Anything else that I can provide for someone to help me? I appreciate any/all feedback!
Hey im trying to store a category name and the date into a database. For some reason i keep getting this error Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query. This error is the error im getting back from the database. the datetime field in the database is a datatype (DateTime) so what exactly is going on ?protected void InsertNewCat_Click(object sender, EventArgs e) { string insertSql = "INSERT into Category (CategoryName,Date) VALUES (@Category, @Date)"; string conString = WebConfigurationManager.ConnectionStrings["ProCo"].ConnectionString; SqlConnection con = new SqlConnection(conString); SqlCommand cmd = new SqlCommand(insertSql, con); cmd.Parameters.AddWithValue("@Category", NewCat.Text); cmd.Parameters.AddWithValue("@Date",DateTime.Now);
Hello Guys,Have been getting this error( Implicit conversion from data type ntext to varchar is not allowed. Use the CONVERT function to run this query. ) when running on the live environment but it was fine when run locally. If anyone has similar problem please let me know the fix you have done. Thank you.