I have two tables I need to create in msSQL and I have the .sql files with the information in them, is it possible to insert them through enterprise manager?
Or another way? Or are they meant for mySQL?
We've got running an vb .net service which throws on-demand .DTSX. Now a new feature has been added: it must be able to launch dts 2000/7.0 too. No problem with that. It works fine using the same thread.
Issue comes when we were accostumed to cancel any DTSX execution for sake IDTSEvents interface and OnQueryCancel event. We want to the same but for the old ETL.
My wonder is how do the same but related with DTS???
I attached you this snippet of code which is responsible for launching a dts:
Have my first .NET app deployed to remote host and configured successfully, except for one thing: can't figure out how to export my SSE tables to the SQL server database on the remote server. I tried SQL Server Management Studio Express ... with that, I can access the remote database, but can't access the local database file I produced with VSWDE. What is the appropriate tool to use to export tables from a local SSE database file to a remote SQL Server 2005?
I am trying to get the SUM of the values from a subquery and I just can't wrap my head around the subquery thing! Can anyone please point out the error of my ways?
I have tried 2 slightly different ones:
Select project.[id] "ID", companyname.[name]"Company", project.projectname "ProjName", project.startdate "StartDate" ,SUM(BudgetTotal + AddTotal + StockTotal) "TotalBudget" (SELECT ISNULL(SUM(budget.budget),0) AS BudgetTotal FROM budget WHERE budget.projectID = project.[id]) (SELECT ISNULL(SUM(budget_additionals.budget),0) AS AddTotal FROM budget_additionals WHERE budget_additionals.projectID = project.[id]) (SELECT ISNULL(SUM(project_stock.saleprice),0) AS StockTotal FROM project_stock WHERE project_stock.projectID = project.[id])
From project, companyname
WHERE project.companyid = companyname.[id] AND (project.startdate >= '2006-11-01') AND (project.startdate <= '2007-10-31') AND project.jobtypeid = 1 ORDER BY "Company" This gives me an "Server: Msg 156, Level 15, State 1, Line 10 Incorrect syntax near the keyword 'From'" error...
The next one i tried looked like this: Select project.[id] "ID" ,companyname.[name]"Company" ,project.projectname "ProjName" ,project.startdate "StartDate" ,SUM((SELECT ISNULL(SUM(budget.budget),0)FROM budget WHERE budget.projectID = project.[id]) + (SELECT ISNULL(SUM(budget_additionals.budget),0)FROM budget_additionals WHERE budget_additionals.projectID = project.[id]) + (SELECT ISNULL(SUM(project_stock.saleprice),0)FROM project_stock WHERE project_stock.projectID = project.[id]) ) "Budget"
From project, companyname
WHERE project.companyid = companyname.[id] AND (project.startdate >= '2006-11-01') AND (project.startdate <= '2007-10-31') AND project.jobtypeid = 1 ORDER BY "Company" And I get "Cannot perform an aggregate function on an expression containing an aggregate or a subquery"
Hi there, it's me again. I am having trouble with a view again. I amtrying to do a calculation, but there are some checks that need to betaken into consideration. Maybe a view is not the right way to dealwith this. I don't know.This is the beginning of my query.SELECT coalesce(f.filenumber, i.filenumber) as filenumber,i.InvoiceNumber, i.InvoiceValue, il.lineid, MPF = .21 * (il.UnitCost *il.UnitQty + il.AddMMV - il.MinusMMV - il.MinusNDC + il.ErrorAmt)FROM tblFILE f inner join tblINVOICE i on (f.filenumber =i.filenumber) left outer join tblINVOICE_LINE il on (i.Invoiceid =il.invoiceid)This works just as it should. However, if the Sum of all MPFs perfile total less than 25.00 or more than 485.00 then each MPF has to berecalculated as:Percentage of TotalEnteredValue = (InvoiceValue / (il.UnitCost *il.UnitQty + il.AddMMV - il.MinusMMV - il.MinusNDC + il.ErrorAmt)Percentage of TotalEnteredValue * 25.00 = MPF orPercentage of TotalEnteredValue * 485.00 = MPFCan you do something like this in a View? Or do I need to dosomething like a trigger?I greatly appreciate all help. I am struggling to get a foothold onviews. I am getting there.
We are attempting to rollout a name and address system to 10,000 users who will use an application connected to an MSDE database.
We are using transactional replication to distribute data updates to them. Clients are connecting via the On-Idle feature of Synchronization Manager to grab transactions.
Server spec: Network card: 1GB Processors: 2* Xeon 3.2Ghz Server spec: DL380 2Gb memory Concurrent connections set to: 600 Disc: RAID 10 with 6400 controller
We are not using hyper-threading.
So far we have rolled the system out to 3500 subscribers, 500 per day.
Each day a subsciber will receive at least 400 transactions and 5000 commands.
Latency is 6 seconds, delivery rate 180 commands per second at less busy times. Latency is 14 seconds, delivery rate 127 commands a second at busy times.
I have seen it get as slow as 0.04 commands a seconds at busy times.
The server becomes incredibly slow when there are more than 50 concurrent connections.
We are seeing 100 CPU for most of the day as clients connect to the distributor at various times. Lunchtime is particularly busy when people go to lunch, leaving their machines idle. We see lots of "time-outs" and "unable to connect to distributor" messages on the replication monitor during peak times.
What can we do to improve the performance of the distribution server?
Are we being over-ambitious by selection SQL Replication for this scenario?
16 flat files all fixed width. Some over 350 columns.
Open flat file 1
extract id and go see if its in table 1, if true update table 1 with first 30 columns
otherwise insert into table 1 first 30 columns.
goto table 2, lookup id, insert/update next 30 columns...etc..etc..for 10 different tables
So I've got my flat file source, I do a derived column to convert the dates, i've got a lookup for table 1, then 2 ole db commands, 1 for update if lookup successful, 1 for insert if lookup fails.
How can I pass the id as a param into the update command so it updates where x = 'x'
also I need a pointer on doing the next lookup, eg table 2, would I do this as some sort of loop?.
If you can help great, but, please don't just reply with "I'd use this object"...then no explanation of how
Hopefully I am posting this question in the correct forum. I am still learning about SQL 2005. Here is my issue. I have an access db that I archive weekly into and SQL server table. I have used the dst wizard to create an import job and initally that worked fine. field I have as the primary key in the access db cannot be the primary key in the sql table since I archive weekly and that primary key field will be imported several time over. I overcame this initally by not having a primary key in the sql table. This table is strictly for reference. However, now I need to setup a unique field for each of the records in the sql table. What I have done so far is create a recordID field in the sql table that is an int and set as yes to Identify (auotnumber). That worked great and created unique id for all existing records. The problem now is on the import. When I try to import the access table i am getting an error because of the extra field in the sql table, and the error is saying cannot import null value into this field. So... my final question is how can I import the access table into the sql table with one extra field which is the autonumber unique field? Thanks a bunch for any asistance.
I have several pdf files that need to be imported into the database. Each pdf file is to link to several rows in a database. The files have different file names and keep coming every week. I need to import them into a table and link it with the data table. Need help on how to get the filename out of the pdf file and save it on the table with the image. I can use that filename as the foriegn key..Any help would be really great.. -Sri
I have a MS SQL table that I want to import into a test db in my SQL 2000. The table is filename.sql and has the script in it to set up the table, etc.
How do I import this table into the sql 2k db?
I tried the wizard and I cannot get a choice to locate the file. How does one go about importing a copy of a sql table? The help file wasn't much of a help, thanks for your input.
Hi, I want to import all data ie tables, stored procedure, view etc from one database to another database in SQL Server 2005. Example i have a database named Test which has 3 tables, few stored Procedure and many more things and i want to take all this data with data in the tables(all rows and columns) to a database named Huzefa in the same Server. Then is there any command for importing all data from from one table to another table....Please let me know...
Hi, Can anybody help me? I want to create a new table and i want to import the structure of another table to that new table but not the data.I want to do it by executing a single sql statement.Would it be possible? Thanks!! Joydeep
Hi All,I'm coming from using MySQL, and in their dialect you could pull data from one table to another using the following: INSERT INTO Table1 (fname, lname)VALUES( SELECT fname, lname FROM Table2 )Let's assume Table1 is a simple table with the fields ID (PK/Identity), fname, and lname. This query would grab all the first and last names out of Table2 (fname and lname fields) and insert them into Table1, generating the ID for each new row.How would I do this in T-SQL?
Hi, I’m trying to write a script on how to automate few tasks using the SQL Server Agent. Here is the step I need to do for the script, the step is similar importing a table:
1. Choose a Data Source - Import a table from a data source that is a text type, e.g. ImportTable_1.all from the location d:able
2. Select File Format - The File Format is a delimited, File Type is ANSI, the Row Delimiter is LF (Line Feed) and the Text Qualifier is Double Quote {“}
3. Specify Column Delimited – Comma
4. Choose a Destination - The Destination is Microsoft OLE DB Provider for SQL Server, using Window NT Authentication from the Database ‘ImportTBL’
5. Select Source Tables – The Destination Table name is SessTbl; in Transform, change the field name (e.g. TableID) and the data type (e.g. Int)
6. Save, Schedule and Replicate Package – Run immediately
7. Repeat step 1 – 6 again, but this time the table (e.g. ImportTable_2.all) must be appended to the first table. This is done on the daily basis.
I need advice on how to get data from xml file into the preexisting table. Right now I have a process that scrapes data from the website and generates xml file everyday. I need to get this data into sql table every night and I would like to make this automated process. What do I need to use in sql to accomplish this? It would be great if you can point me to a tutorial or give me few pointers.
I have done this successfully the last time but just couldn't get it to work this time round. Please help.
I was trying to import data from an Excel file into MS SQL table. NONE of the numeric or value fields (right justified) works because they shown <NULL> in MS SQL table after the import via DTS. Those string fields were able to import ok into the table. DTS didn't show any error message during the DTS run.
Using some VB sample code on the Internet I have the followingthat works well and exports a set of records to an XML file:Dim oCmd, sSQL, oDomSet oDom = CreateObject("Msxml2.DOMDocument.4.0")Set oCmd = CreateObject("ADODB.Command")oCmd.ActiveConnection = "Provider=SQLOLEDB;Data Source=(local);InitialCatalog=TestXML;UID=sa;Password=123456"sSQL = "<ROOTxmlns:sql=""urn:schemas-microsoft-com:xml-sql""><sql:query>" & "select *from tblTest for xml auto</sql:query></ROOT>"oCmd.CommandText = sSQLoCmd.Dialect = "{5D531CB2-E6Ed-11D2-B252-00C04F681B71}"oCmd.Properties("Output Stream") = oDomoCmd.Execute , , 1024oDom.Save "C: emp estdts.xml"This is my first day of using XML in SQL Server and I need help on howto imitate INSERT statements by basically importing data from an xml file.With some changes I managed to write VB code that seems to be readingthe XML file I exported earlier but I can't seem to know what to do to beable to take the data only of the XML and INSERT it into a table.The code I used is the one found in the SQL Online Help, search in INDEXfor "OPENXML" and then choose "USING OPENXML"If you have sample code or can point me to a link that has sample code toachieve what I want, I would appreciate your help.Thank you
I have an access database that i upsized a few weeks ago and i need to add another table form that database, however when i use the DTS import wizard to get the particular table i wish i get as far as picking the table but i cant preview or do the import, i get the following error message on it!
Error Source: Microsoft Jet Database, Error Description: record(s) cannot be read; No permission on the table 'InternetBilling', Context: error calling openrowset on the provider.
Ive working on a copy of the access database and given all user groups read persmission and im still getting this, how do i get around it?
I know that the DTS Wizard is supposed to be able to handle heterognous data imports but I can't get it to work with a free FoxPro table. I have to export to a text file and then import from the text file and spend an hour renaming columns and farting around with datatypes.
CAN I GET A FOXPRO TABLE INTO SQL SERVER DIRECTLY OR NOT? HOW DO I DO IT?
I don't fully understand some of the questions the DTS Wizard is asking. Can anybody give me a blow by blow account before I ring the Samaritans?
Thank you and Happy Christmas - it may be my last if I can't speed up these imports. Either I'll jump under a bus or my boss will make mince pies out of me.
I have Data split into 3 text files with 3 fields repeated in each to link then (key). I want to import this data into one table. I used DTS to create 3 tables with the data. Now i want to combine the 3 tables into only one (that i already created). How can i do this? Note: the field names in the source tables are different from the destination table.
I am in need of some help importing a .CSV file into a SQL Server 2005 Enterprise Edition. The problem is I already implemented Bulk Insert task in SSIS but it is not importing any data. My detailed layout is as follows : In SSIS package1 - In Control Flow Bulk Insert Task has been inserted Properties of Bulk Insert Task: Connection adtc009d.ganny Destination Table ganny.dbo.t4 Format Format Specify Row Delimiter {CR} Column Delimiter Comma{,} Source Connection File r.csv Options Options Check Constraints Maxerrors 20
This bulk insert task is connected to Data flow task, if we click edit to data flow task, data flow section will come, here Flat file source & OLE DB Destination is there. Flat file source is connected to OLE DB Destination.
Properties of Flat File Connection Manager Flat file connection Manager here by clicking new link flat file properties to this. Preview by clicking preview all data are visible Properties of OLE DB Destination editor Oledb connection manager adtc009d.ganny Data access mode: Table or View - fast load Name of Table or view dbo.t4
After designing all this then if I start debugging I could able to get records are imported to a table. Please suggest me where I am going wrong.
What I'd like to do for example, is exclude the first 5,000 rows, and import the rest.
Should I be using something other than DTSWizard, and it there something that can be added to the statement above telling it to start at a specified row?
This is probably fairly simple, but I'm new at this and I'd sure appreciate the help.
Hi,I have to find a way to do the following : a company provides for my company a web page displaying data separated with ;I need to automatically update a table in SQLServer with this data, ie delete the old data, read the web page containing new data as text, and insert these data into the table.I would actually prefer not to trigger this import process "by hand" ; if there's a solution to schedule it ...Thanks for your helpJohann
I hope this is the right forum for my question. I'm developing a website for a Prepaid Calling Cards distributor. Each of the cards they sale have a list of the countries the card is good for. I need to import this data into my countries_rates table. The file they are giving me is an excel file that contain 3 colums (fields) 1- Country-Name 2- Rate 3- Card_$_Price these files contain aproximaly 400 rows so it will be a hasle to have to insert it manually every week. In my web application I need to create a form where the user will select the card from a dropdownlist and then find the excel file to be imported for that card. I would like to know how do I do that with Visual Studio 2005, SLQ 2005 and C# please direct me to some links where I can learn how to do this or please send me some code snips I can see how is done. Tia Charles
Whenever I import (or even append from another table) data to a table that has an Identity column, I get an error: Cannot insert NULL values in Identity column.
Isn't the Idenity column supposed to incement automatically without me having to provide a value? Using INSERT provides an Identity value automatically, using import however doesn't.
How can I overcome this problem? (I now delete and recreate the Identity column - really BAD practice!) Thank you.
I am writing program in VC++ through SQl-DMO calls.My problem is when i when i tranfer(import) a text file(comma seperated) into SQl server through a SQl-DMO method called ImportData which is a method of Bulk copy object.Its is not able to convert the data field in the text file to corresponding value datetime in SQl server whereas other data types are working perfectly.
This is the record i need to convert:
90,MichaelB,Wintriss,Inspection,Paper,11,Job101,1, {ts '2000-12-10 15:54:56.000'},D:public233 and 247233.mcs,
and this is the date field {ts '2000-12-10 15:54:56.000'}
Whereas if i export a table in SQl server in Binary mode and then import the file back it works but when do it as text it gives the above error
Pls help me in this i would be very thankful to you.