Hi There, I'm new to the .Net environment, and I am currently trying to convert an xml document and its appropriate schema, to a dataset then with this Dataset I would like to load it into the database. This XML file is generated from the Access 2000 format. Then sent over the internet where it is received by an HttpFileCollection object, then the schema and xml file are loaded into a dataset. I have created a new SQL database in which I imported the table required from Access, so in theory the table that the xml is generated from should be the same as the table that the xml is destined for. I am getting the data loaded into the dataset however, when I try to execute the data adapter update command
oda.Update(myDS, "MSGLOBAL") it is throwing an Exception, in this exception the message is telling me that there is a problem near the key word 'on'. Now I have added a watch window to monitor the sql statements, now the oda has an insert statement generated from a query builder, however this same query builder will not create either an update or delete command. I hope this is a good enough explanation to get a few answers, or a possible example, it seems to be a topic that is quite difficult to research. Thank you, and if you require more info please indicate this. Damon Http://www.ezywiz.biz
I have been trying to convert an existing table that used adjacency list model (parentid,childid) to a table that use hierarchy Id type. So early on, I notice my original data does contains multiple roots. So I took a step to create dummy nodes to ensure all nodes fall into a single root structure. Another important fact is that each child node can have multiple parents.
My original source table contains 22461 records, when running the query below step 2 produces explosive number of records around 175,000+ records. I spent hours study the result and couldn't understand what actually causing this, I ran it against small set of test data I didn't seem the issue caused by child with multiple parents.
select * from SourceTable -- produces 22461 records
--step 1: first, get row number of child records in each parent
SELECT ChildID,ParentID, ROW_NUMBER() OVER (PARTITION BY PARENTID ORDER BY PARENTID) as Num INTO #RelationshipTmp FROM SourceTable;
My client will be receiving a .dbf file which needs to be uploadedinto a sql server database table (as an append) every week. They areNOT computer savvy and I would like to automate this process ratherthan go into enterprise manager and run data transformation.Is there any way to write a batch file or a set of command lines whichwill do this?Thanks.Monica
Hello Everyone, I have a dataset that I created from an external database using an ODBC connection. I would like to take that dataset and create a new table in an SQL 2005 database. Can anyone point me in the right direction. The problem that I am having right now is getting the object types etc.
I am using DTS to import text to a table. This mostly works except for the 'DateTime' datatype where I always run into either 'Arithmetic overflow' or 'Unable to convert varchar to DateTime format.' I can convert same data without incident in Access.
I have this situation here: I have a table structure something like : id name keywords
100 60 tabs Action Labs
100 60 tabs Actionlabs
100 60 tabs Actions Labs
100 60 tabs Super Glucosamine
100 60 tabs Super Glucosamine And Chondroitin
100 60 tabs Super Glucosamine Plus Chondroitin
100 60 tabs Super Glucosamine Plus Chondroitin Sulfate
101 60 caps Action Labs
101 60 caps Actionlabs
101 60 caps Actions Labs
101 60 caps Super Glucosamine
101 60 caps Super Glucosamine And Chondroitin
101 60 caps Super Glucosamine Plus Chondroitin
101 60 caps Super Glucosamine Plus Chondroitin Sulfate
How can I bring all the values under 'keywords' as comma seperated under one column identified by their ids? eg: id name keywords 100 60 tabs Action Labs,Actionlabs,Actions Labs,Super Glucosamine,Super Glucosamine And Chondroitin etc.
How to convert a SQL table into Text file? I have a table and I want to extract the values with the field names above to a text file. The query should also allow me to define the starting position of the fields in the text file.
I have a datetime field in my table. I call that field with a different software & it comes out in an unexpected format.
My db table stores it in unix format: 2013-08-12 09:29:00.000
But the software pulls it as: 8/12/2013 9:29:00 AM
I know it's possible, but I don't know how. How do I explicitly call it (in SQL) as a unix timestamp. Or how do I convert to a unix timestamp from the available data above?
I have a very large database running in a production environment. The backup files are getting to be very difficult to manage. They are at 70gb as of now and growing at a rate of 10gb per month. This is due to document images being stored in the database in one table. I have read a little about a new feature in SQL Server 2012 called Filetable. Can we migrate to SQL Server 2012 and convert to the filetable structure, will this decrease the size of the backups? Would backup of the document images be taken care of by our nightly file system backups now?
I have a stored procedure in which we are deriving some flags. So, we used series of CASE statements.
For examples
CASE WHEN LEFT(CommissionerCode, 3) IN ('ABC','DEF',...) THEN 1 WHEN PracticeCode IN (.......) THEN 1 WHEN (CommissionerCode IN (.....) OR PracticeCode NOT IN (.....) OR .....) THEN 1 ELSE 0 END
I need to put these conditions in config table and generate dynamic sql. What is the best way to do this? especially, 3rd condition with OR logic with multiple columns involved.
I have a stored procedure in which we are deriving some flags. So, we used series of CASE statements.
For examples
CASE WHEN LEFT(CommissionerCode, 3) IN ('ABC','DEF',...) THEN 1 WHEN PracticeCode IN (.......) THEN 1 WHEN (CommissionerCode IN (.....) OR PracticeCode NOT IN (.....) OR .....) THEN 1 ELSE 0 END
I need to put these conditions in config table and generate dynamic sql.
What is the best way to do this? especially, 3rd condition with OR logic with multiple columns involved.
Hi folks,I was working on MS sql server 2005 evalution where i have built a number of databases. However, i came to discove that the evalution version has expried before i finished my work. Now i have disinstalled the sql server 2005 and installed the Sql express edition.My concern here is how can i keep my databases so they can work with sql express edition?Thank you very much in advance.
Hi, I am developing a project that using the one of the starter kits which use the MS SQL EXPRESS database.The project is almost ready to be launch. few questions:
I am looking for a good host with good support reasonable paid. What is my options if I would like to convert from the current database, to other databases like MySql, MS SQL Server or any? which tools can help with this convertions? thats all, thanks.
So where I work is thinking about one day moving to SQL server. Right now they have indexed files that aren't normalized with repeating fields in them and lots of repeat data and blank space (so a customer number in one file may be stored literally in 10 other files that are easily realted). In the intrest of saving time and money I think that they will not normalize, index, or anything to any of these files. From what I hear it will be a straight field by field creation for the most part and preserving the primary keys.
My question: I keep thinking this is going to be massive hit on performance and maintaince. How much would converting in such a manner hurt the performance of their database and how much could it potentially add to maintaince?
So where I work is thinking about one day moving to SQL server. Right now they have indexed files that aren't normalized with repeating fields in them and lots of repeat data and blank space (so a customer number in one file may be stored literally in 10 other files that are easily realted). In the intrest of saving time and money I think that they will not normalize, index, or anything to any of these files. From what I hear it will be a straight field by field creation for the most part and preserving the primary keys.
My question: I keep thinking this is going to be massive hit on performance and maintaince. How much would converting in such a manner hurt the performance of their database and how much could it potentially add to maintaince?
I'm new to SQL server. I've been working with oracle and now need to convert this sentence to SQL Server but I get this error:
Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'A'. Server: Msg 156, Level 15, State 1, Line 6 Incorrect syntax near the keyword 'where'.m_proceso;
My sentence is: /***************** update data_grup A set new_grup_code =( select cod_grup_2 from data_grup_new B where A.cod_grup = B.cod_grup ) where zone = '001' ; /***************** Can anyone help me to convert this to SQL server, I don't know why I get this error. Thanks.
Columns from database have values like 1,5 etc and I'm getting the error: Syntax error converting the nvarchar value '1,5' to a column of data type int. when trying to convert from nvarchar to int: SELECT CONVERT(int, MyNVarChar_column) FROM MyTable What I'm doing wrong? Thanks a lot
I have the following sql script I wrote using Explicit Option to convert data from SQL Server tables into a single XML file. I am aware of the tedious nature of the select statements, but this seems to the only option I have to depict parent-child nature of the data in XML format and also to schedule it as a job to run via SQL Server Agent.
My problem is that as I run this using the following command, I get "There is insufficient system memory to run this query" error. I am using the following commnd: exec master..xp_cmdshell 'bcp "EXEC swr_cv2..sproc_BuildXMLTree" queryout "C: est.xml" -U -P -c -r -t'
Is there any way I can tune my query to fix that error?
Public Class DB Dim myDB As New OdbcConnection Dim myCMD As New OdbcCommand Public Sub New() Dim db_server = AppSettings("db_server") Dim db = AppSettings("db") Dim db_user = AppSettings("db_user") Dim db_pwd = AppSettings("db_pwd") Dim DBConnection As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _ "SERVER=" & db_server & ";" & _ "DATABASE=" & db & ";" & _ "UID=" & db_user & ";" & _ "PASSWORD=" & db_pwd & ";" & _ "OPTION=3;" myDB.ConnectionString = DBConnection myCMD.Connection = myDB End Sub
Public Function q(ByVal mySTR As String) As OdbcDataReader myCMD.CommandText = mySTR Try myDB.Open() q = myCMD.ExecuteReader(Data.CommandBehavior.CloseConn ection) Catch ex As Exception Err(ex.ToString) End Try
End Function
Public Sub c(ByVal mySTR As String) Try myCMD.Connection.Open() myCMD.CommandText = mySTR myCMD.ExecuteNonQuery() myCMD.Connection.Close() Catch ex As Exception Err(ex.ToString) End Try
End Sub
Private Sub Err(ByVal strError As String) Current.Response.Write("<h1>An error has occurred.</h1><br>" & vbCrLf) Current.Response.Write("Please report to us the error message<br>" & vbCrLf) Current.Response.Write(strError) Current.Response.Flush() Current.Response.End() End Sub End Class
Hope this makes sense. I am trying to convert an Access based blog app to SQL Server but I'm having some trouble with some SQL.
The sql is as follows: SELECT *, (SELECT COUNT(*) FROM tblComment WHERE tblComment.blogID = tblBlog.BlogID AND tblComment.commentInclude <> 0) AS TOTAL_LINKS FROM joinBlog WHERE BlogIncluded <> 0 ORDER BY BlogID DESC
The access version returns blog entries & the number of comments posted to each entry.
joinBlog is an Access query: SELECT tblBlog.BlogID, tblBlog.CatID AS tblBlog_CatID, tblBlog.BlogHeadline, tblBlog.BlogHTML, tblBlog.BlogDate, tblBlog.BlogIncluded, tblCategory.catID AS tblCategory_catID, tblCategory.catName FROM tblCategory RIGHT JOIN tblBlog ON tblCategory.catID = tblBlog.CatID;
I assume I need to make a view out of the Access query, I have done this & that appears to work.
The problem I have is when I try the 1st sql that is in my page with sql server I get the following error: The column prefix 'tblBlog' does not match with a table name or alias name used in the query.
I can make the following change which returns data but does not attach the blog comment counts to the proper blog entry, instead it returns the total comments in the query: SELECT *, (SELECT COUNT(*) FROM tblComment,tblBlog WHERE tblComment.blogID = tblBlog.BlogID AND tblComment.commentInclude <> 0) AS TOTAL_LINKS FROM joinBlog WHERE BlogIncluded <> 0 ORDER BY BlogID DESC
Can anyone tell me how to convert this for SQL Server? This is my 1st access to sql server attempt. Thanks.
I'd like to convert my Access database table to MS SQL Server 2005 Express. I have a text field and a memo field. What are the corresponding datafield types for SQL Server?
I am trying to convert the following working SQL Server query to query a DB2 database. I am getting the following error: An ON clause associated with a JOIN operator or in a MERGE statement is not valid. SQLSTATE=42972. Can anyone help me convert it? Thanks for your help!
I need to take a temporary table that has various times stored in a text field (4:30 pm, 11:00 am, 5:30 pm, etc.), convert it to miltary time then cast it as an integer with an update statement kind of like:
Update myTable set MovieTime = REPLACE(CONVERT(CHAR(5),GETDATE(),108), ':', '')
how this can be done while my temp table is in session?
Hi.. I want to convert .dbf files to sql server 2000 tables.. without using any tools. I need to create a different structure for sql server tables other than contains in the .dbf files. May be the dbf files contain only 3 columns. but i need 5 columns and some calculations to determine the values of some fields to insert into sql server table... i need to code this using c# in asp.net.. can u help me? thanks in advance.. Fraijo
I need to switch from MS Access to SQL Server for my database. To set up a development environment I downloaded the free Microsoft SQL Server Express (February CTP version). I installed the required .NET Framework v2, and then SQLExpress. The install was done using all the defaults, and was done successfully. I also downloaded and installed the SQL Express Manager Tool.
The SQL Server was installed on the same machine as my VS.NET development environment. The SQL Server process is now running, and I can connect to the server using the SQL Express Manager Tool. This allows me to view and query the sample databases, but not much else.
To convert my Access .MDB database to SQL Server, I am trying to use the MS Access Upsizing Wizard. The version of Access I am using is Access 2002 on a Windows XP-Professional system. The problem is that Access cannot get a connection to the SQL Server. I tried using the default server name "(local)" and "Use Trusted Connection", but I receive the following error:
Connection failed: SQLState: '01000' SQL Server Error: 2 [Microsoft][ODBC SQL Server Driver[]Shared Memory]ConnectionOpen (Connect()). Connection failed: SQLState: '08001' SQL Server Error: 17 [Microsoft][ODBC SQL Server Driver[]Shared Memory]SQL Server does not exist or access denied.
Curiously, I get this exact same error message even if the SQL service is stopped. So I'm pretty sure the problem is that it is not finding the SQL server, and not a security issue.
In order to connect to the SQL server using the SQL Server Manager Tool, you have to provide the actual instance name for the server "COMPNAMESQLExpress". So I tried using this server name in the Access Upsizing Wizard, but this returns the same error message as above except the first SQL Server Error is 53. I also tried using a Login ID and password (using the Windows administrator ID and password, and also the "sa" ID and password) to no avail.
I am at wits end, and can't figure out why Access can't find the SQL Server. Any ideas would be appreciated.
OK, I have some SQL Server 2000 databases that I want to convert to 2005. My question: how do I do that? I tried importing the data, but it only picked up 3 tables out of 7 user tables in one of my SS2K databases. Plus, it did not pick up any stored procedures or any other kind of objects. So I tried restoring from a backup, but predictably it could not do that because the original backup was on a different server. I also tried the upgrade advisor utility that comes with SS2K5, but it could not seem to connect to my SS2K server -- it said it could not find any SQL Server objects on the server, even though I am connected using Enterprise Manager and have been using this server for a long time. Is it looking for 2005 databases? That wouldn't make a lot of sense. Anyway, I am stumped... can anyone provide help on this? Thanks!
I'm trying to convert a 6.5 compatible db from SQL Server 2000 to SQL Server 2005. The issue I'm encountering is that:
1. I cannot simply convert the 6.5 compatible db to SQL Server 2005. I tried restoring from a backup - no success. 2. I tried creating the structure in SQL Server 2005 and then importing the data from SQL Server 2000. Problem is - after importing the data, I then tried creating the primary key and indexes - get a time-out error (which I never got with SQL Server 2000.) I also tried creating the primary key and indexes in SQL Server 2005 FIRST before importing - got errors when trying to import and import failed.
I know this sounds like a data problem but I have no problems working with this 3 gig database in SQL Server 2000.
Can anyone please help? This is a pretty serious problem I need to overcome with the SQL Server 2005 conversion.