Hi I'm new to SQL server.
What I'm trying to do is to automate the import of data from an Excel spreadsheet to a table within SQL Server.
The index of the table has a seed set to increment by 1 and I assume that this is the same as the Autonum datatype in Access.
When I import data I miss out this field as it is autogenerated, but the DTS package fails as it is trying to put a NULL in to this field.
Where am I going wrong....is there something that I should change on the DTS import?
- INSERT INTO TABLE2 (COL1, COL2, COL3) SELECT COL1, COL4, COL7 FROM TABLE1 - what i want is i INSERT INTO TABLE2 (COL1, COL2, COL3) SELECT COL4, COL7 FROM TABLE1 Username (add one more value exp: Username)
If TABLE2 has a data in resource 01-05 that isn't in resource01-05 of TABLE1 then I want to added it to the next free slot where ref is the unique key.
l've some excel files controlled by Vendor which changing frequently. The only thing does not change is the header name of each column.
So my question is, is there any way to create a new table based on the excel file selected including the column name in SSIS? So that l can use the data reader as source to select those columns l am interested on and start the integration.
In Sql 6.5 there was an option to Transfer the db. I used this quite often to make a duplicate test db of my production db. Under 7.0 I haven't found it so easy to do this. DTS wizard hasn't worked well for me. I can get it to transfer tables but not all of the objects. Any ideas? Thanks.
We have a SQL 6.5 database that was expanded larger than was really necessary. I have created a smaller size database and am wondering what the easiest way would be transfer ALL of the data and objects from the existing database into the new one. Is SQL transfer manager reliable? Are there any better ways?
i have a couple of tables interlinked, and in one table it has a column named contact with such info in as S Smith, John Burn. and i need to split this up, so it can go into a number of other columns in another table, such as initials, name surname.
the best ive come up with so far is, isnt very good.
Hi! I am trying to import a file from excel into Enterprise Manager. I have found the wizard that does this, but I can't seem to find the table I want to import the file into. What am I doing wrong? Thanks for any help you can give.
Hi! I am importing data from an Excel file into SQL. I am getting the following error message: Error during Transformation 'DirectCopyXform' from Row number 32. Errors encountered so far in this task: 1 Destination does not allow NULL on column pair 1(source column 'F1'(DBTYPE_R8), destination column 'agentno' (DBTYPE_14))
I have an excel sheet that contain colummns as in a table in a sql database i want to transfer this data from the sheet to the table frombusiness logic code layer not from the enterprise manager by wizardwhat can i do?? ...please urgent
I have a table on one server that I would like to copy over to another server. I have done the full backup and restore, however that seems to overwrite the formatting on all of my existing tables. As there are some differences in the tables between servers, I would prefer to not have to do the full restore. I have been able to use the SQL export utility to copy a table from one database to another on the same server, but I was wondering how that can be done between different servers with different Windows logins.
I am looking at a way to transfer data from a SQL server into an AS/400. If possible can the data be continously transferred to the AS/400 or are there time constraints that will limit it to say once every two hours.
This question may be a bit naive but I have some data that I would like to transfer from a SQL 7 database to a DB2 database on Linux. Does anyone know how I would go about doing this. I have in the past transferred data from SQL 7 to Oracle and SYBASE using DTS without any difficultly. I cannot remember exactly but presume they were on NT.
(I don't know if this is the correct place for this topic, if not, then please move it)
I have to make a historisation script, and I need to transfer data from a database on one server to a database on another server.
I.e. from table T1 in database D1 on server S1 to table T2 in database D2 on server S2
I saw there is something like sp_addlinkedserver, but to be honest, I don't get the syntax correct.
Both servers are SQL2005 servers (but I will have to go from SQL2000 to SQL2005 in the future) and the migration script will be runnning at the source database.
Can you guys help me out on the syntax, or else provide other suggestions on doing this kind of transfer?
I need to append data from a database on one server to a table in a databaseon a different server. Both servers are running SQL 7. How can that be done?Thanks.
I am attempting to transfer a table from an AS400 to SQL Server 2005 through SSIS. I am using the IBM DB2 UDB ISeries IBMDASQL OLEDB Provider as the source connector. I have tried to set up the source connector using the Table or View option but it says that No Tables Could Be Loaded. I can specify an SQL command and it shows the columns and appears to set up correctly except for showing a warning indicating that it cannot retrieve the column code page information from the OLEDB provider. When I run the job, it fails with the following error:
I have to pick up a row from Customers and transfer it to CustomerMaster and CustomerDetails. CustomerId of CustomerMaster will be the CustomerId of CustomerDetails while transfer.
I want to transfer ACCESS DataBase(ABC.mdb) to SQL Table Using c#.(SSIS Programming) i need to use this query on access database
which will when run create 4 fileds ABC.mdb Sorce_Db_Id_Col
Attribute_Type
Attribute_Value
Query_Flag
And sorce database Indentity_col Att_typ Att_value Att_catg
I m very new in this stuff. so please please any one have any sample code for this then send me ! please i realy need it My email id is ripal.parikh@softwaresolutionsindia.com Thanks lot!!!!
I ask for your help for problem of SQL Server 7 DTS . I got 6 text data files extracted from a SQL server database Sale1 in Company A. I also got a script produced from Sale1 and run it in my company to build a SQL server database A_Sale which structure is the same as Sale1. Then, I transferred these files into my database A_Sale. I have successfully transferred three files (vlet, vlrl, and vlcv), without any trouble. But I met trouble for transferring other three files (vlcl, vlco, and vlpo). For example, the error messages are as: "Error during Transformation 'DirectCopyXform' for Row number1. …Conversion invalid for datatype on column pair 12 (source column 'Col012'(DBTYPE_STR), destination column 'cl_dob' (DBTYPE_14))." "Error during Transformation 'DirectCopyXform' for Row number 10825. …Conversion invalid for datatype on column pair 17 (source column 'Col017'(DBTYPE_STR), destination column 'c0_stchdt" (DBTYPE_14))." - I don't understand why the datatype is not matched? The datatype is 'int' in both source column and destination column and the data for the source column is like 2533222. And, why the error caused for Row 1 for file vlcl and for Row 10825 for file vlco? How to correct the error? Other errors I met like: "Error at Source for Row number 24391. …Column Delimiter not found." - I don't know how to avoid the error at source? My partner in companyA also cannot control to avoid the error, since the file extracted by SQL server. "Error at Destination for Row number 531377. …Could not allocate space for object '(SYSTEM table id:-269896619)' in database 'TEMPDB' because the 'DEFAULT' filegroup is full." - Why the error caused for row 531377 and how to correct it?
Hi all, I am working at insurance company that using AS400 as it main server. All transaction data is already kept for about 10 years (or even more..). This data is growing larger from time to time, and after several upgrades (that cost a lot!), my supervisor has an idea to partly move the data from AS400 to SQL Server. (since the cost for upgrading sql server is cheaper than AS400).
So.. let say, we only want to kept data in AS400 from 4 years before until now (2004 – 2007), and the rest of data is kept in SQL Server.
So first, all transaction data from 1997 – 2003 is transferred to SQL and deleted in AS400. If user queried data and didn’t found the data in AS400, it will search the SQL, if data is found in SQL, then data is transferred back to AS400 and deleted in SQL.
I’m using SQL Server 2000 DTS (use HiT OLEDB) to transfer the data from AS400 to SQL and vice versa.
I wanna ask if anyone has done this before? What’s the difficulties by using this approach? (btw, I will implement the DTS using user control in vb.net)
Or anyone has a better solution to overcome this problem?
I am transferring DB2 data to SQL server 2005 in ssis. the connection i I am using is the IBM OLEDB driver for DB2 which uses the ODBC connection on the machine. The issue is that while transferring data i get errors reg unicode vs non unicode data. the db2 data is showing unicode data, but when i see the datatype in the db2 database it is a varchar. so when i transfer the data to a varchar in sql server 2005, it errors out....meesageis unicode vs non unicode data. Why is the data from db2 coming across as unicode string. Also the transfer works fine in SQL server 2000, why is is not working in sql server 2005. Please help !!!!
I am currently woking on transfering the table contents in sql server in an csv file i have created a stored procedure which would do same but the prob i am facing is the data in the table is not clean it contains tab,newline etc so i had to clean the data i had applied the folowing procedure
set @columns='' --'@columns+''replace(replace(replace(''+column_name +'',Char(10),''''''''),Char(13),''''''''),Char(19) ,'''''''')''' --print @sql select @columns=@columns+'replace(replace(replace('+colum n_name+',Char(10),''''),Char(13),''''),Char(19),'' '') as '+column_name+ ', ' from
[code]...
the table_name contains around 300 columns with the column_name of min 20 characters .When i run the above query i get only few columns instead of all the columns so i tried to find the length which gives me the result as 4000.I had declared @columns as Varchar(8000) i dont know why this issue is coming up?? is there any other way i can clean the data an the transfer it into the file
I'm having some trouble with import data from an excel document to a table. The scenario is as follows: The excel document has two columns A and B. Col A has to be copied into the table (table has 3 columns Col 1 - Primay key with autoincrement feature, Col 2 - is Col A from the Excel document, Col 3 - irrelevant)
Depending on Col B from excel doc the corresponding Col A data should be copied to the table. I tired using a DTS pacakage to do this but it complains becuase Col 1 (table) gets a valus of NULL for every value in Col A. I mapped only Col A to Col 2 in the Transformaton tab.
I am trying to import data from a table with huge volume (more than 70000 records) to a Excel file. THe problem, because of the limitation on the number of rows (which is somewhere around 65000), I am unable to do a full import..Can you suggest a method thru which additional rows (i.e. rows beyond the limit on excel) can be ported to the next sheet in the same workbook? thanks in advance
How can I move data from an external source to SQL-server 6.5.
If you for example has an oracle database on a UNIX or VMS-system and want to move table data from a table in the oracle database to the SQL-server database.
There must be plenty of tools to do that via ODBC.
I have read only permission in the source (OLTP) database. The source database is running in SQL Server 2000 and the size is more than 200 GB. I need to pull data from source and load target which is running in SQL server 2005.
Following are the objectives I want to achieve.
Data should be loaded on incremental basis.
Whatever changes take place (Update/Delete) in source, that should be replicated to already uploaded data.
Here I want to mention that, the source database does not have any identification key or timestamp column like Updated_Date by which I can filter the data which are recently inserted or updated into the source and upload the same. The source does not maintain any history data also. So I do not have any track of deleted record also.
I don€™t have any scope to change the schema in the source. In this scenario can anybody suggest me the best approach to achieve the above mentioned objectives?
Can I retrieve only the recent updated or inserted date form transaction log back up. Can log shipping solve the give the solution?
One more question. Say I have a table and I am exporting/importing all the data from/to my target table using SSIS or DTS. In this scenario does using query or using directly the table affects the performance?
hi , Can any body help me export data from sql database to excel? I am using datagrid method but it is not transferring complete table's data at a time through LAN .i.e. it works on local host ,but not working if I accessing this project from other computer.
public class gridviewexport { public gridviewexport() { // // TODO: Add constructor logic here // }
using (StringWriter sw = new StringWriter()) { using (HtmlTextWriter htw = new HtmlTextWriter(sw)) { // Create a table to contain the grid Table table = new Table();
// include the gridline settings table.GridLines = gv.GridLines;
// add the header row to the table if (gv.HeaderRow != null) { gridviewexport.PrepareControlForExport(gv.HeaderRow); table.Rows.Add(gv.HeaderRow); }
// add each of the data rows to the table foreach (GridViewRow row in gv.Rows) { gridviewexport.PrepareControlForExport(row); table.Rows.Add(row); }
// add the footer row to the table if (gv.FooterRow != null) { gridviewexport.PrepareControlForExport(gv.FooterRow); table.Rows.Add(gv.FooterRow); }
// render the table into the htmlwriter table.RenderControl(htw);
// render the htmlwriter into the response HttpContext.Current.Response.Write(sw.ToString()); HttpContext.Current.Response.End();
} } }
/// <summary> /// Replace any of the contained controls with literals /// </summary> /// <param name="control"></param> private static void PrepareControlForExport(Control control) { for (int i = 0; i < control.Controls.Count; i++) { Control current = control.Controls[i]; if (current is LinkButton) { control.Controls.Remove(current); control.Controls.AddAt(i, new LiteralControl((current as LinkButton).Text)); } else if (current is ImageButton) { control.Controls.Remove(current); control.Controls.AddAt(i, new LiteralControl((current as ImageButton).AlternateText)); } else if (current is HyperLink) { control.Controls.Remove(current); control.Controls.AddAt(i, new LiteralControl((current as HyperLink).Text)); } else if (current is DropDownList) { control.Controls.Remove(current); control.Controls.AddAt(i, new LiteralControl((current as DropDownList).SelectedItem.Text)); } else if (current is CheckBox) { control.Controls.Remove(current); control.Controls.AddAt(i, new LiteralControl((current as CheckBox).Checked ? "True" : "False")); }
if (current.HasControls()) { gridviewexport.PrepareControlForExport(current); } } }
I am very new to the entire world SQL Server databases. I am starting from scratch.
Currently I have a little Website I am doing for myself that is .asp based and will allow users to query some sports boxscores. I hope to create a user interface that will allow folks to seperate team results based on certain criteria...
It is just a hobby of mine that I have been doing for year with excel and now hope to let others like me do it aswell.
here is what I got.
MSSQL 2005 Server with a database. Iam using SQL 2005 Server Express Studio. Therefore, do not have access to SSIS or DTS or anything like that.
However, I want to import several hundred records into a db I created (hosted by Crystal tech). Since, I don't have access to the Server root directory, I can't use the BULK INSERT statement.
I am looking for a method to query an excel file (or .csv something..) that is stored on my local drive and upload it to the Server db tables.
I would like to do this either through SQL with a query. Or I would to add this VB code to the current VB that I use in my Excel file.
Hi! I have to develop an application for transfering data from an excel file into a sql table.The excel file is uploaded to a server.The database(and the table) is on another server.At first,I used openrowset for transferring data to the table.My sql command looked like this(in my asp page):
SQLstr = "SELECT * INTO dbo.shopping_TSR FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database="+Server.MapPath("upload/tmb2.xls")+";hdr=yes', 'SELECT * FROM [Sheet1$]')"
I kept getting this error: [Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'IDBInitialize::Initialize returned 0x80004005: The provider did not give any information about the error.]
After reading a few articles,I think the cause of my error is that the excel file is uploaded into the folder where the asp script is located.I have 2 servers : one running the asp scripts and one containing the database. Is my error generated by the fact that the excel file is on a different server than the sql server?How could I make this work?