Hi can any one help me with the skeleton script (sample one)of running Bulk insert in batches........ I need to do it in batches as the input data is huge.....
The logic is I have to insert thru bcp in fact table...
After that batch execution for 50,000 thousand record.... wise.... if any of the batch failes i need to identify and have to rerun from that point onwards...... this is OLAP thing...
I'm using ASP.net to do a Select and I want to insert all the results into a table that is stored locally I can put an SP local but cant put on the other DB
How would i achieve this batch insert? is it possible?
Hi, I am in the middle of writing a console application that acquires data from dynamic odbc connections and inserts the results into a MSSQL database. I'm currently using a datareader to generate multiple calls to a stored procedure and batch execute them by means of a simple counter; this works fine. However, I'm a little concerned that it seems to take so long to execute the sql stored procs and was wondering if anyone may know of any methods to help speed it up either on the app side or sql, or both. I had a quick word with our dba who spoke briefly about some kind of process where by the application fires the request across to the database and carries on leaving the db to queue the request or something to that effect. He ran away before I could get any sort of sense out of him. Any help greatly appreciated Thanks
How do you prevent this:"If you import a very large number of rows, dividing the data into batches can offer advantages. After each batch complete, the transaction is logged. If, for any reason, a bulk-import operation terminates before completion, only the current transaction (batch) is rolled back." How can I let the whole batch rollback, instead only the current transaction (batch) rolling back?
I'm using MS JDBC driver to connect to SQLServer 2005 and trying to perform batch insert. Here is the code i'm using:
Code Snippet
try { // Assume we have a valid con con.setAutoCommit(false);
// this is the simplified SQL for the purposes of this example StringBuffer sql = new StringBuffer(); sql.append("INSERT INTO temp_batchOpt ("); sql.append("temp)"); sql.append(" VALUES (?)");
// the correct number of insertions are made if(r != null) for(int x: r) System.out.println("inserted "+x);
SQLServerResultSet keyRS = (SQLServerResultSet)insertStatement.getGeneratedKeys(); while (keyRS.next()) { int id = keyRS.getInt(1); System.out.println("**filling id ="+id); } con.commit(); } catch (BatchUpdateException bue) { bue.printStackTrace(); } catch(SQLException sqle){ sqle.printStackTrace(); } finally { // close the connection... }
I'm getting the following exception:
Code Snippetinserted 1 inserted 1 inserted -2 inserted 1 inserted -2 inserted 1 inserted -2 inserted 1 inserted -2 inserted 1 com.microsoft.sqlserver.jdbc.SQLServerException: The statement must be run before the generated keys are available. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getGeneratedKeys(Unknown Source) at com.x.U.m.Transformer.prefetchData(Transformer.java:285) at com.x.U.m.Transformer.init(Transformer.java:51) at com.x.U.m.XMLParse.main(XMLParse.java:215)
I can get the getGeneratedKeys() to work fine with single update (not usign batch update). Is batch + getGenerated key not supported?
I have a full backup scheduled at 12.00AM ET and have a batch import on 11.55PM(5 min before full backup) which takes 30min to complete .Will the backup cover the data which is being imported?
I want to Insert 10000 rows at a time and commit in sql server , Isthere a way to do it if the source tables have no id fields ?What would be the most efficient method?ThanksAjay
I€™m facing a SQL batch insert issue on Windows 64 bit (IA-64) platform. I€™m using €˜Column-Wise Binding€™ of parameters. The example program hosted on Microsoft site (http://msdn2.microsoft.com/en-us/library/ms709287.aspx) returns error of SQL_NEED_DATA for batch insert on Windows 64 bit platform. The same code works fine on 32 bit platform. I€™m using SQL Server 2000 as the database and tried using both native SQL server ODBC driver and Merant 5.2 ODBC drivers. Any help on this will be greatly appreciated.
Our OLAP environment involves an ETL/Data Warehouse/Data Mart server and a cube publisher server. We would like to learn how to automate the Archival/Restore of OLAP databases. We are currently doing it manually though OLAP Manager. Any help would be appreciated. Thanks. James.
-- James E. Bothamley Senior Database Administrator Dave & Buster's, Inc. 2481 Manana Dallas, TX 75220
Work Phone (214) 904-2296 email jbothaml@DaveAndBusters.Com
"Once in a while you can get shown the light in the strangest of places if you look at it right"
I need to take a variable from a tabel in SQL Server pass to a Batch file and execute the batch file. Right now I can exec the batch file with XP_CMDSHELL but how can I pass the variable to the batch file and loop through all the variables.
I am using the following batch file to execute a script that creates a db and all its objects in the local sql express:
sqlcmd -S (local)SQLExpress -i C:CreateDB.sql
This works fine, but I'm wondering if there's an easy way to put the script in the batch file, so users don't have to worry about putting the script in the C drive. I tried getting rid of the i parameter and pasting the script from the sql file into the batch file, but it didn't work.
How do I use vba string functions in MDX queries? The on-line help says that the functions can be used but I can't figure out the right syntax for it. PLEASE HELP! I want to take the first letter from a level i.e.([NET INCOME] in the e.g. below) and display it.
For eg. WITH MEMBER [DIMENSION].[NET INCOME].A AS 'LEFT({[DIMENSION].[NET INCOME].MEMBERS,1})' SELECT measures ON COLUMNS, [DIMENSION].MEMBERS ON ROWS FROM CUBE a.
I have install OLAP srvice on SQL Server 7.0 server. When I try to connect to OLAP server I get the following error: 'cannot connect to the registry on the server computer'
Has anyone tried installing an OLAP Manager 2000 instance on a server that already supports SQL 7.0 and OLAP 7.0? We will not be using the OLAP 7.0 instance so we would like to either upgrage OLAP 7.0 to OLAP 2000 or unistall OLAP 7.0 altogether. Any feedback would be helpful. Thanks. James.
I was working with an OLAP Services Processing Task when I ran into some difficulties. I was prompted with a message which told me that the object could not be found. When I went back to the OLAP Manager I was not able to see the databases for that server.
Does anyone know why I can no longer see these databases i have tried refreshing/rebooting......??
Analysis services is installed on a Windows 2000 server (call it computer A) in Domain A. SQL 2000 has been installed on the server using mixed security. All of the SQL services are running under an account in Domain A (not local system). The problem is the computer (call it computer B) I wish to run Analysis Manager on and use to administer the Analysis services on Computer A is in Domain B. There are no trusts between Domain A and Domain B. Can Analysis services be administered by a computer in a domain not trusting the domain that the server running Analysis server is in? Any help would be appreciated. Thanks
Hi, Can anyone tell me where to fine some good help on designing Date type dimensions in an OLAP cube. This particular thing has been a pain for me.. I have a Time dimension in my CUBE which has year-week-day as levels. I want the week to start from Monday and span seven days ( naturally !! ). But OLAP surprises and entertains me by showing different number of days in every week. Whatever I do, it never starts a week on Monday and spans it for next 7 days consistently.
I've installed SQL7.0 and OLAP service on my PC(windows 95), but I cannot find the OLAP Manager. Can an OLAP Manager be installed on Windows 95? If it cannot, can I create an OLAP database (or application) on my PC?
I have installed OLAP services along with SQL Server 7.0. I want to use the sample MDX application supplied with the CD. When I try to use the dsample application, it comes up with a dialog to enter the server name and gives me an error unable to connect to the OLAP server. My computer is Windows 98. Do I need to install OLAP Server ? If so how ?
So I am starting to look at an OLAP problem having been an OLTP DB wonk for several years.
All very nice. Am bending my head aorund cubes and the dimensions trciks and learing to choose them more carefully.
Have wokred through the various chapters of various SQL books (OLTP books with a couple of chapters of OLAP I admit) and am starting to feel if not comfortable with it at leats not compleetly terrified.
Now the Analysis manager in SQL is all well and good but I'm not about to hand it to the accounting monkeys that work here.
Does anyone have any suggetsions of some good OLAP specific books and any Cube viewing tools/suites/utilities that I can give to the computer-illiterate bean counters I work for?
I'm new to this forum and as well as new to OLAP testing . I would like to know OLAP testing and guidance for SQL server anlaysis services .
I have been trying install SQL server 2000 in my system but it not going through, Can anybody send information how to install SQL server and how to play with sample database.
I'm trying to retrieve calculated members from a cube using the OPENQUERY function and a OLAP linked server, the results from MDX Queries are then stored to a SQL Server DB Table.
below is the error message I get:
Could not get the data of the row from the OLE DB provider 'MSOLAP'. OLE DB error trace [OLE/DB Provider 'MSOLAP' IRowset::GetData returned 0x80040e21: Data status returned from the provider: [COLUMN_NAME=[Measures].[first column] STATUS=DBSTATUS_E_UNAVAILABLE], [COLUMN_NAME=[Measures].[second column] STATUS=DBSTATUS_E_UNAVAILABLE]]
When I run the same query in MDX Sample Application it works fine!