I have a CSV File, I am importing this into SQL Server using SSIS package through Flat File source Task.
Few Points about data & its handling
1) inside the Procedure they are dropping the index, then populating the table, then again creating the same index.
2) Data is huge in figure (say, in millions)
My doubt:
which is the best way to import the data
1) Just inserting the data without dropping the Index
2) Drop index, populate table, re-create index (the way they do right now)
I've created a table which will hold staffing data (name, grade, etc.) and any shifts that are going to be entered. I've got some test data in the table.
I've attached a spreadsheet with the test data from the table and the required layout on the second tab.
I've created a view which displays the data as I want it and I need to attach this to an MS Access front-end for the users to input/edit the data in the table with the use of a Access form.
The view I've created looks like this:-
CREATE view [dbo].[vw_Forecast_Staffing] with schemabinding as select s.Ward ,s.StaffBand ,s.StaffName ,d1.Date1
[Code] ....
It displays all the staff members and any shifts they've been given for a 7-day period with day 1 begin supplied by the user.
The user will also supply the ward they are interested in viewing.
When I attached the view to Access it becomes read-only as it doesn't have any indexes on it.
I can't create a clustered index on the view as there are derived tables.
Is it a best practice to disable "Allow files on this drive to have contents indexed" on NTFS drives used by SQL for its data, log, tempdb, etc?
In what I've read it seems to be a best practice for Filestream objects and Flash storage drives. We don't currently use Filestream objects or have Flash drives.
Are there any benefits or drawbacks to disabling this feature on an NTFS drive connected to SAN LUNs under mount points?
I want to know is a flat file faster than a RDBMS for indexing for example a search engine indexing would a flat file be better in terms of performance, scalability etc than a RDBMS?
I have two tables which are related. The first table(A) has a sequentially assigned unique key (primary) that has a cluster index built on it. This table has roughly 1,000,000 rows of data and grows daily.
The second table(B) has a sequentially assigned unique key (primary). There is a column in table(B) which contains table(A)'s unique key. For each row in the table(A) there are roughly 30 rows in table(B).
Should I build a clustered index on the table(B) column which contains the key to table(A) or a non-clustered index?
The other day we tried online re-indexing feature of SQL 2005 and it€™s performing faster than offline re-indexing. Could you please validate if it€™s supposed to do be this way? I always thought offline should be faster than online.
My records like below..I created a clustered index of DATE field .This is the only one index available in the table. The table contains nearly 5,00,000 records.Now after indexing the DB size increased from 14 GB to 26GB.
Recoverymodel OF DB is SIMPLE
Shall I shrink DB for reucing the size?Will it effect indexing????
DATEÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ID 2015-03-01 00:07:10.000Â Â Â Â Â Â Â Â Â Â Â Â Â Â 110 2015-03-01 00:07:11.000Â Â Â Â Â Â Â Â Â Â Â Â Â Â 110 2015-03-01 00:07:12.000Â Â Â Â Â Â Â Â Â Â Â Â Â Â 110 2015-03-01 00:07:13.000Â Â Â Â Â Â Â Â Â Â Â Â Â 110 2015-03-01 00:07:10.000Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 111 2015-03-01 00:07:11.000Â Â Â Â Â Â Â Â Â Â Â Â Â 111 2015-03-01 00:07:12.000Â Â Â Â Â Â Â Â Â Â Â Â Â 111 2015-03-01 00:07:13.000Â Â Â Â Â Â Â Â Â Â Â Â Â Â 111
I have inherited a database and looking to upgrade it from 2008 to 2014. I have imported the database into db projects but it has flagged warning s straight away because one of the previous contractors has created a bunch of stored procs with encryption.
how to import a text file with a list of NI numbers into a new table with a column to list all the NI numbers? I think I use the Select INTO clause, but not sure how to do this?
We are importing xer formats through the wizard to sqlserver database and It takes upto 35-45 mins for each import (single project), any option to reduce the time.Is they any other import options - which can give us faster results.
I setup this package to import data from a Sharepoint list to a SQL Server data table. The primary key of my SQL table is mapped to the Title column of my Sharepoint list. There is a possibility that duplicate values will be entered in the Title field of the Sharepoint list. So when importing data into my table via SSIS, my package always error-out when there it comes across duplicate values. how you others have managed data integrity when importing from a Sharepoint list with the Title column being mapped to the primary key of a table.
I have one column in SQL Server 2005 of data type VARCHAR(4000).
I have imported sql Server 2005 database data into one mdb file.After importing a data into the mdb file, above column data type converted into the memo type in the Access database.
now when I am trying to import a data from this MS Access File(db1.mdb) into the another SQL Server 2005 database, got the error of Unicode Converting a memo data type conversion in Export/Import data wizard.
Could you please let me know what is the reason?
I know that memo data type does not supported into the SQl Server 2005.
I am with SQL Server 2005 Standard Edition with SP2.
Please help me to understans this issue correctly?
We have a daily process, which copies millions of rows of data from one DB to another over Linked Server. Just checking on the best practise, are there more efficient ways than the Linked server to copy millions of rows of data from one DB to another? I checked bulk insert but that transfers the data from the file to DB not DB to DB.Â
I have created a simple package that uses a sql command to pull data from an oracle database and inserts the data into a sql 2005 table. Some of the data fields that i am pulling from contain two digits after the decimal point, however this data is lost when it gets into sql. I have even tried putting the data into a flat file, and still the data is lost.
In the package I have a ole db source connection which is the oracle database and when i do the preview i see all the data I need. I am very confused and tried a number of things to get the data into sql, but none work. Any ideas would be very helpful.
when i m importing data from excel to Sql using DTS the column which has text content was not imported as same in excel sheet. whereas a special character is appearing in between the lines. the text field contains multiple lines but the conetent is imported in single line .
I'm wondering if SSIS will be the solution to the problem I'm working on.
Some of our customers give us an Excel sheet with data they want to insert or update in the database.
I've created a package that will take an Excel sheet, do some data conversion so the data types match up and after that I use a Slowly Changing Data component to create the insert/update commands.
This works great. If a customer adds a new row to the Excel sheet or updates an existing row changes are nicely reflected in the database.
But now I€™ve got the following problem. The column names and the order of the columns in the Excel sheet are not standard and in the future it could happen a customer doesn't even use an Excel sheet but something totally different.
Can I use SSIS for this? Is it possible to let the user set the mappings trough some sort of user interface? I€™ve looked at programmatically creating the package but I€™ve got to say that€™s quit hard to do€¦ It would be easier to write the whole thing myself than to create the package trough code ;)
If not I thought about transforming the data in code before I pass it on to the SSIS package in something like XML. That way I can use standard column names and data types.
So how should I solve this problem? Use SSIS or not?
I'm new to SQL and DTS packages. I am trying to import data from an excel spreadsheet to an SQL server table via DTS package. It seems that the excel task looks at the first few records in a column to determine the datatype for that column. If the first few records are text, the entire column is imported as text. If numeric, the entire column is imported as numeric. There are about 25,000 records. In one field, the most important one, about half of the records begin with letters and the rest are all numbers. It is the subscriber ID field, and some subscriber IDs are all numbers, some are letters and numbers. The entire column should be imported as text. However, when I run the transform data task from the excel connection, none of the records that are all numbers are imported. I end up correctly importing only 13,000 of the 25,000 records. The rest are imported with the subscriberID field as <NULL>. I tried using the CAST or CONVERT function in the SQL query, but get the error message "Undefined Function."
hello, I create a txt file with a bash script, and i need to use it in a DTS package. But, i don't know how i can specify the type of my column. So in the transformations task, i have an error due to an incompatible type. what can i do to fix this error ? thanks,
I am creating a DTS package that is combining several tables, converting one column of data to a new column removing all special characters, then exporting the unique data based on this column and another column, and the max of other duplicates to a new table.
Now that I have the data in this table, I want to import any data that is not in my main table.
This "CLEANED" table does not have a designated "key" column, but the table I want to import the unique items does have an ID column that is also a primary key column.
DTS seems to want me to have a Key column to reference when importing from the CLEANED table to the MAIN table.
How would I go about checking the MAIN table against the CLEANED table, having DTS import only the unique items from the CLEANED table that are not present in the MAIN table based on three columns? The rest of the columns I want to just extract the MAX data from the duplicates.
Now here is the query I use to extract the unique values from the "CLEANING" table to get the data to the "CLEANED" table, but do not know how to use this to import into the MAIN table using something similar.
Code:
select partno2, MAX (partno) as partno, alt, MAX (C_alt) as C_alt, Max (cmpycd) as cmpycd, MAX (type) as type, compFN, MAX (pndesc) as pndesc, MAX (equipment) as equipment
into tbl_CLEANED from tbl_CLEANING group by partno2, alt, compFN ORDER BY partno, compFN
The three main columns I need to check against are: partno2 alt compFN I have named the columns the same in both tables.
partno2 is the column that has been copied from partno with all special characters & spaces removed. This is the main column I am using as a reference for unique values, then if no match, I have it check against the alt column, then the comFN column. If there are no matches in any of these columns, then I want to extract the data to the MAIN table.
How can I compare these tables and import only unique info to the MAIN table?
In addition, how can I also check items that are the same in both tables and update the MAX info for the other columns (not the three I use for reference - these I need to leave alone) and update those if there is more data in the CLEANED table then in the MAIN table?
I have a process that calls a proc that BCP's a delimited file into a table. Well the SOX police say a header and footer must be added to the file. Needless to say this screws my BCP process. Does anyone know how to strip a header and footer record from a text file using transact sql or have any other suggestions to strip the records?
I am trying to import data from excel into my server, but get this error message:
Error during transformation 'directcopyXform' for row number 1. Errors encountered so far in this task 1. TransformCopy 'DirectCopyXform' conversion error: Conversion invalid datatypes on coulumn pair 19 (source column '*9' (DBTYPE_WSTR( destination column 'F19' (DBTYPE_R8)
we are trying to import data from a flat file using an uptick (`) as a column separator and {CR/LF} as a record terminator. There is a variable number of columns for each record. The initial record in the flat file has 3 columns. Upon processing this record, the import sets all records to 3 columns and does not read the column separators past the second column (even though there may be up to 7 columns in the record).
This method worked ok in DTS2000 and it works with Excel. Any suggestions?
There's alot of discussion in this Forum concerning the importation of data into SSE.
I recently discovered that you can quite easily export tables directly from MSAccess to SSE. Simply 1) select the desired MSAccess table, 2) choose 'Export' from the file menu, 3) in the 'Save as Type' drop down, select ODBC databases(), 4) at this point, an 'Export' dialog with the name of the selected table appears, 5) click 'OK', 6) the Data Source Manager appears - go to 'Machine Data Source' and select a DSN that connects to SSE (you need to have set this DSN up before), 7) click 'OK' and and your table will be exported from MSAccess to SSE.
For whatever reason, the table you exported will always end up in SSEs 'Master' database tables. There is probably some work-around to correct this, but I havnt spent much time fooling with it.
Now, MSAccess has a very good parser for importing several types of external data, including Excel worksheets, CSV files, and text data. However, to get a satisfactory into MSAccess, you may need to edit your data files. Then, to import the data, from MSAccess select 'Get External Data' -> 'Import' from the File menu and just follow the instructions.
BTW, there is alot of confusing discussion concerning the ability of SSE to use DTS. Some have said that it is not supported, only in the full-blown version. Others have suggested you can download the DTS application from Microsoft and use it with SSE although it does not show up in the SSEMS directory tree.
I downloaded the file 'SQLServer2005_DTS.msi' and tried to install it. It appeared to install OK but I cannot find it anywhere on my machine. Weird, eh.
While most of this thread is in the way of a comment, I have a couple of questions:
1 - Is there some way to connect a machine DSN to a database in SSE that is other than 'Master' ?
2 - Are there better ways to import data into SSE ?
3 - Is there some way to move or copy a table from one SSE database to another ?
BTW, please do not respond to this thread by posting some link. Many of the links I have attempted to follow from this Forum are either irrelevant to the posted problem or are no longer available. If I wanted that kind of help, I could use Google or go to the library. Try to answer the question(s) directly. If you don't know the answer, say so, or at least, don't answer at all.
With SQL 2000 there was an Import/Export facility for importing data into a Sql database. Could somebody tell me how to import an old database which could be in Csv text or Paradox into my new SQL 2005 tables. Thanks
I have created an application that uses the login, create, etc login components in .net. How hard is it to convert all my old users, passwords, usertypes into the new tables. It almost looks like I have to do them by hand and created a new guid(userid), along with the same guid in the aspnet_usersinroles and aspnet_Membership. Is there a script to do this programatically?
Hi i have an excel spreadsheet in which I want to take the data and put them in a table, the table and excel speadsheet have the same unique-ID, what i need to do is retrieve the extra fields of the excel spreadsheet and match them up with the table. Is this possible, if so how?