I Am Trying To Move From Access Db To Sql.s
Jun 30, 2007
hello
i am trying to move from Access db to Sql.s
could you please what is rwong in the sql.s syntax:
------Access SP:----------
PARAMETERS [@Date_M_Y] DateTime, [@BIZID] Long;
SELECT SUM(MINUTE(Time_)) AS MM, SUM(HOUR(Time_)) AS HH, COUNT(Date_) AS SHIFTS, SUM(Money_Sum) AS MONEY_TOTAL, AVG(Money_Sum) AS AVG_MONEY_PER_SHIFT
FROM TblTimeSum
WHERE MONTH(Date_)=MONTH([@Date_M_Y]) And YEAR(Date_)=YEAR([@Date_M_Y]) And BIZID=[@BIZID];
----- SQL.S----
CREATE PROCEDURE SP_SUM
@Date_M_Y smalldatetime,
@BIZID int
AS
BEGIN
SELECT SUM(MINUTE(Time_)) AS MM, SUM(HOUR(Time_)) AS HH, COUNT(Date_) AS SHIFTS, SUM(Money_Sum) AS MONEY_TOTAL, AVG(Money_Sum) AS AVG_MONEY_PER_SHIFT
FROM TblTimeSum
WHERE MONTH(Date_)=MONTH([@Date_M_Y]) And YEAR(Date_)=YEAR([@Date_M_Y]) And BIZID=[@BIZID]
END
GO
thanks
View 5 Replies
ADVERTISEMENT
Jan 12, 2004
Hi,
My client has a rather large database with some very large reports. Some of the reports have around 20 sub-reports a piece. We have decided to move the client's application to a .NET web application and would migrate them to SQL Server 2000.
The only problem is now, designing the reports. I have tried doing what Microsoft says (converting to stored procedures and views) but I keep getting syntax errors on the SQL side of things when I cut and paste.
For example, the following code is taken from Access :
SELECT tblProjects.fldCountry, tblProjects.fldDescription, tblOrganizations.fldAcronym, tblProjects.fldProjID, Max(tblProjYears.fldStartDate) AS MaxOffldStartDate, Max(tblProjYears.fldEndDate) AS MaxOffldEndDate, qryProjLocsWithFEData.fldProjPeriodID
FROM (tblProjects INNER JOIN tblOrganizations ON tblProjects.fldOrgID = tblOrganizations.fldOrgID) INNER JOIN (tblProjYears INNER JOIN qryProjLocsWithFEData ON tblProjYears.fldProjPeriodID = qryProjLocsWithFEData.fldProjPeriodID) ON tblProjects.fldProjID = tblProjYears.fldProjID
GROUP BY tblProjects.fldCountry, tblProjects.fldDescription, tblOrganizations.fldAcronym, tblProjects.fldProjID, qryProjLocsWithFEData.fldProjPeriodID
ORDER BY tblProjects.fldCountry, tblOrganizations.fldAcronym, tblProjects.fldProjID;
But when I try that in SQL Query Analyzer i get the error : The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
I'm pretty sure it's on the tblProjects.fldDescription Group By, but if I leave it out, it still throws an error. Anybody have any ideas?
Thanks
View 5 Replies
View Related
Apr 7, 2004
I'm attempting to move data from an Oracle table to an Access table using an Oracle stored procedure in DTS. The problem is that you can't pass parameters to an Oracle stored proc when its called in a data pump task. Is there a way to pass global variables into an Oracle stored procedure which retrieves data and moves it to an Access database? Maybe in an Active X task? We are required to use an Oracle stored procedure by our DBA's or else I'd just pass the variables into a SQL string and use it in the data pump task.
View 1 Replies
View Related
Jan 22, 2008
Hi All,
I hope I am at the right place to post this question:
How can I move the tables with its data from Access to SQL Server 7.0 using SQL queries. Later I might put everything in the store procedure and have a third party running the store-procedure to do it by itself.
Please advice what should I do first? Do I create new tables in the s SQL Server 7 or can I move the data and create the tables at the same time?..Thank you.
View 1 Replies
View Related
Mar 23, 2006
Hi
I am tearing my hair out. I have tried upgrading form access to sql express. I have built the database and written all of my stored procedures. I think I am having problems with connecting to the server. I am storing my connection in the web.config. I am trying to open the datbase and add populate a reader, but i keep getting the error:
Exception Details:
System.Data.OleDb.OleDbException: No error message available, result code: DB_E_ERRORSOCCURRED(0x80040E21).
Any help would be much appreciated. Code below:
<connectionStrings>
<add name="SQLProducts" connectionString="Provider=SQLOLEDB.1;Server=(local)SQLExpress;Database=laptopsqlexpress.ALLBUTYOUDB;Integrated Security=yes;"/>
</connectionStrings>
Function GetCategoryProductNav(ByVal strCategoryID As String) As OleDbDataReader
Dim objReader As OleDbDataReader
Dim objCmd As New OleDbCommand("spGetCatProductNav", objConn)
objCmd.CommandType = CommandType.StoredProcedure
Dim objParam As OleDbParameter
objParam = New OleDbParameter("@CategoryID", OleDbType.Integer)
objParam.Value = strCategoryID
objCmd.Parameters.Add(objParam)
Try
objConn.Open()
objReader = objCmd.ExecuteReader
Catch ex As Exception
Throw ex
End Try
Return objReader
End Function
View 1 Replies
View Related
Dec 14, 2007
hi all,
is there any query to move certain data from a sql data to access table through query. i am having a requirement where i have to fetch the records from a sql table that falls within a specified range to a ms access table. is this possible through a query.
thanks
View 5 Replies
View Related
Jan 29, 2001
How do you move a database from lets say E drive to G drive on the same server? Any ideas.
Regards,
View 1 Replies
View Related
Jun 23, 2008
I would like to know what is the best way to move all the data from a DB to a new database. Some of the tables has different names, and attributes, so is there a way to create a script or something that will do that.
Both databases are in the same server.
View 4 Replies
View Related
Jul 18, 2006
I’m working with an msde database on my local machine, but need to take that database and move it to my remote host. This is problematic because I can not just do a back up and restore.
I was wondering if there were any asp.net applications that would generate lots of sql statements to reproduce the database on my remote host.
I had built a program to back up all the tables in that way, but, forgot that the membership stuff uses stored procedures, and I don't not know how to modify my program in order to back those up too.
Any help will be much appreciated, thank you very much for reading my post
View 7 Replies
View Related
Oct 29, 2005
Hello,
What is the easiest way to move a database from one server to another with the all table structures, view and stored procedures?
Thanks,
View 3 Replies
View Related
Apr 23, 2001
Can someone tell me how to move the log file for a database from one drive
to anoyher. I want to keep the data on one drive and the logs on another
so I need to move the log files to another drive.
Thanx, Kelly
View 1 Replies
View Related
Jun 13, 2001
Without restoring the database, has anyone written a slick little piece of code that moves a file existing on on filegroup to another newly created filegroup without doing it from a restore.
The purpose of doing this is to get rid of one data file and placing the data into the data file we are retaining. We have some more physical file space and are moving data into one data file and one transaction log file.
We have already ran the DBCC SHRINKFILE with EMPTYFILE to move the data,
We have already ran the ALTER DATABASE statement but here, because the filegroup is identified as PRIMARY in the sysfilegroup table, we can not REMOVE the data file because of indexes relating to the PRIMARY filegroup.
So if I could ALTER DATABASE and create a bogus filegroup and move the data file which I want to get rid of into the bogus filegroup, I could ALTER DATABASE with REMOVE filegroup and solve the situation.
Does anyone know of an easier way to do it other than BACKUP database and RESTORE database.....please help!!!
Thanks,
Daimon
View 1 Replies
View Related
Aug 30, 2001
Using sp_detach and sp_attach we can move different databases to different locations.
how do we do the same for system databases such as master,model,msdb and tempdb.
As off i know we got to be in master database to runthis command, if not this how do we go about this.
Thanks,
sheena
View 6 Replies
View Related
Oct 30, 2001
We will move t-log from one disk to another one. I tried Alter Database and found it did not work for log.
Can somebody give me a method about moving log from different disks?
Thanks.
Jean
View 2 Replies
View Related
Nov 2, 2001
I read the one of the replies to a question.
"Subject:
From:
Date: SQL 7 Restore (reply)
Manish (manish45@yahoo.com)
11/1/01 9:03:43 AM
If you want to move all the databases to new server. Stop the SQL server service on existing server. Copy mdf and ldf files of all databases to same location iin new server. Also take the backup of master and msdb database from existing server. Then restore master and msdb on new server.
"
My question is how to move my database to a DIFFEREN LOCATION on a different server. My two servers are different file layout (not my choice though.)
Thanks a lot in advance.
Wuchun
P.S. Should I use the DTS at all to perform this task?
View 1 Replies
View Related
Jul 21, 2000
Hi:
I need your suggestion or experience about how to move a database from SQL 6.5 to SQL 7.0. The server where SQL 6.5 resides locates in different network than SQL 7.0. DTS does not work for the database move because of two server can not talk directly.
We need to do this task very soon in production environment. I tried to backup database to a disk (backup device in SQL 6.5) but I failed to restore it in SQL 7.0 because the backup file was not detected by restore utility in SQL 7.0.
Please tell me what I should do. Besides BCP, are there any other methods to move the database from SQL 6.5 to SQL 7.0 in diffferent networks.
Thank you very much.
Joan
View 2 Replies
View Related
Dec 26, 2000
Does anyone know how to move the transaction log(s) of a LIVE database to a new location. I must move the log of a database to a new mirrored drive without any disruption to users. I cannot take the database offline or use the sp_detach_db stored procedure. Your inputs are much appreciated!
View 1 Replies
View Related
Aug 15, 2000
How do I move all the databases to a new drive in the same machine?What effects/problems will be?
Thanks!
View 7 Replies
View Related
Jan 19, 2001
Hi
I am new to sql server 7 and dont know how to 1.make a copy of a database
and 2 to move a database i know there are sys stored procedures but the syntax looks crptic and i dont know where to type them in if any one could give me any really clear examples of how to do both of the above i would be really grateful, thanks!
View 3 Replies
View Related
Apr 20, 1999
What's the easiest way to move a 7.0 log file to a new physical location?
View 2 Replies
View Related
Dec 23, 2003
Hi there,
Does anyone know how to move tempdb (mdf and ldf files) to another physical disk of already instaled SQL Server 2000? (The idea is to move the tempdb to another dedicated disk in order to improve the performance.)
Regards,
Azv
View 1 Replies
View Related
Jun 14, 2006
Next month client is moving servers to new location. The servers will get new ip and subnet Our user db's which are on a SAN will be moving to new SAN. My plan is the following, please correct any mistakes.
1. Do full backups of everything
2. Detach user db's
3. Copy these files to usb box (100 gig worth)
4. After server is in new world bring it up
5. Copy db files from usb
6. Attach db files
View 6 Replies
View Related
Feb 26, 1999
We have to recut two NT Servers that have SQL 6.5 on them. After recutting them and installing SQL 6.5 I will recreate my devices and then my Databases. If I use the sql dumps to restore the data bases
should I import my logins through the SQL Security manager first and then restore the dumps. If someone has done this or has a better approach it would be great help.
View 1 Replies
View Related
Jun 21, 2001
Need to know proper procedure for moving our NT/SQL 6.5 server to new IP subnet. Re-IP'd the server, moved and fired it up SQL Server gets:
DBLibrary - Server is unavailable or does not exist...general network error.
What needs to be done at the SQL level to complete the move?
Thanks.....
View 3 Replies
View Related
Jun 24, 2004
i've got to move 37 SQL Server databases over to new server. My manager tells me that i have to conduct some "check totals" to make sure that the databases contained exactly the same data from what it was when it got moved.
Is there some stored_procedure to do this ? to make sure that all the stored procedures, views, tables got move across ?
View 2 Replies
View Related
Aug 27, 2004
Hi gang,
Just trying to get some information on what is required to migrate from Access 2000 to SQL Server?? Is it pretty difficult to do? Are there any changes to the data or structure that is needed? Is SQL Server more secure? What about MSDE instead of SQL?? I'm just needing some tips and info on what to expect and all as I think we are going there kinda soon. I can do many things in Access but not sure how to go about them in SQL Server? Can you also do reports from there as well?
Inquiring mind wants to know
have a nice one,
Bud
View 3 Replies
View Related
Sep 27, 2004
Thanks in advance!
I have several jobs (most scripted in activeX) that I need to move to a different server. Is there an easy way to "copy and paste" them from one server to the other? (SQL7 to SQL2k)
View 8 Replies
View Related
Feb 6, 2004
SQL Nubie need to accomplish two things. 1. backup an SQL2000 db on old hardware. 2. Use backup to build same SQL2000 db onto new hardware, which will replace old hardware as main system. Running Win2000 server standard edition on old server and Win2003 server standard edition on new server. Old server does not have a tape backup, but it has a cd burner and access to a Novell corparate network -without any established Windows domains. Asking for much, hope someone can help. Some source material would go along way. Thanks
View 1 Replies
View Related
Nov 10, 2005
Hi,
I'm new to SQL Server. How do I port the modifications of my table structures, store procedures, functions on the staging server to the procduction server without affect the data?
Can I make this modification to production database while user are still accessing the database or I have to bring down the database to make these changes?
Thanks in advance,
View 1 Replies
View Related
Jun 7, 2007
Hi,
I'm a C# developer, not a DBA, but fairly familiar with sql server 2000 and learning 2005. I have a need to update a table on one sql server from another remote sql 2005 server. Both will be SQL 2005, but will not be on the same network, so there will be firewall issues to contend with. Security is not a huge concern as the data is public info and not personal secure information or anything like that. What I'll have is a table of data in one sql database. I will have a copy of that data on another sql server that is used at an ISP and drives a web site. I need the table at the ISP sql server to get updated from the SQL server that is onsite in our office on our private network. I would like to not have to get network admins to open sql server ports if possible, so I guess I'm wondering if there is an easy way with SQL 2005 to update data from one sql server to another in the environment that I have described that maybe could expose the data over a common port (ie port 80). I don't want to have to use integrated security as I'm not sure this would work between remote databases in this scenario. I don't know if the web service end point support in sql 2005 would allow this. The examples I have seen online show a sql endpoint created and then accessed from a .NET application. I can do that if I have to, but I would rather do all of this inside the database in some fashion. I am open to any idea that would work and if I need to, I can ditch the idea of using something over port 80 and can get the necessary ports open between the sql servers. This is a pretty simple scenario that we have with one table of data needing to be updated weekly on a web based sql server from a remote sql server.
Any ideas on how you would approach this would be greatly appreciated. Security for the data I'm accessing is not a huge concern as the data is public domain as I've said, but I need to make sure the rest of the server and database on both ends are secured.
Thanks for any help!
View 6 Replies
View Related
Sep 14, 2007
Is there a way to move database from developement to production servers along with the logins and their associated roles as well as passwords. I did backup and restore and used sp_change_users_login to fix the logins
I mean is there a way to copy logins and roles Thanks
View 3 Replies
View Related
Sep 17, 2007
I have a db that I created on my local machine and need to move it to our server. The problem is that I created it with sql server 2005 express and our server is a sql server 2000 so restore and attach don't work. I don't have management studio (just express) so I don't know what I need to do to move it. Any help is appreciated.
Thanks
View 3 Replies
View Related
Feb 25, 2008
I am having problem moving packages/solutions for one folder to other.
Is there any specific way that we have to do this.
I copyed a solution and pasteditin a shared folder and when i open it iam geting connection errors and package correpted errors.
i amy sound funny but pls can any of you tell me the procedure.
thanks
View 2 Replies
View Related