rowcount

Move SQL Server data in limited (1000 row) chunks

假装没事ソ 提交于 2019-12-17 23:47:39
问题 I'm writing a process that archives rows from a SQL Server table based on a datetime column. I want to move all the rows with a date before X, but the problem is that there are millions of rows for each date, so doing a BEGIN TRANSACTION...INSERT...DELETE...COMMIT for each date takes too long, and locks up the database for other users. Is there a way that I can do it in smaller chunks? Maybe using ROWCOUNT or something like that? I'd originally considered something like this: SET ROWCOUNT

Row count of a column family in Cassandra

大兔子大兔子 提交于 2019-12-17 23:40:45
问题 Is there a way to get a row count (key count) of a single column family in Cassandra? get_count can only be used to get the column count. For instance, if I have a column family containing users and wanted to get the number of users. How could I do it? Each user is it's own row. 回答1: If you are working on a large data set and are okay with a pretty good approximation, I highly recommend using the command: nodetool --host <hostname> cfstats This will dump out a list for each column family

Grouping with partition and over in TSql

醉酒当歌 提交于 2019-12-14 04:02:58
问题 I have a simple table CREATE TABLE [dbo].[Tooling]( [Id] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](50) NOT NULL, [Status] [int] NOT NULL, [DateFinished] [datetime] NULL, [Tooling] [nvarchar](50) NULL, [Updated] [datetime] NULL, ) ON [PRIMARY] with following values SET IDENTITY_INSERT [dbo].[Tooling] ON GO INSERT [dbo].[Tooling] ([Id], [Name], [Status], [DateFinished], [Tooling], [Updated]) VALUES (1, N'Large', 0, NULL, NULL, CAST(N'2015-05-05 00:00:00.000' AS DateTime)) GO INSERT [dbo].

Does variable value set by Row Count Transformation take effect during execution of DFT in SSIS? or Conditional Split can read a variable correctly?

拈花ヽ惹草 提交于 2019-12-12 16:42:20
问题 I have a SSIS package where1 record (hard coded) flow through. I have variable in DFT scope. I assign value to variable using Row Count Transaformation. The value should be 1 i verify it by using script component. public override void PostExecute() { System.Windows.Forms.MessageBox.Show(ReadWriteVariables[0].Value.ToString()); base.PostExecute(); /* Add your code here for postprocessing or remove if not needed You can set read/write variables here, for example: Variables.MyIntVar = 100 */ } I

QFileSystemModel rowCount does not work as expected

不羁岁月 提交于 2019-12-12 12:15:59
问题 I am try an example in Model/View Programming. http://doc.qt.io/qt-5/model-view-programming.html To demonstrate how data can be retrieved from a model, using model indexes, we set up a QFileSystemModel without a view and display the names of files and directories in a widget. Although this does not show a normal way of using a model, it demonstrates the conventions used by models when dealing with model indexes. We construct a file system model in the following way: QFileSystemModel *model =

row count for visible cells only

ε祈祈猫儿з 提交于 2019-12-12 05:39:43
问题 I want to create a macro that will fill in blank cells with a formula. The formula will reference the cell above, but only after I apply Subtotal to my data, as well as only on the rows with a Total (see below Sample screenshot): So far my macro will apply the subtotal, then filter on the column with the totals and filter for anything with Total in the cell. Afterwards it counts all the invisible rows and subtracts 2 (I do not want to count the header and grand total). It takes the count and

Retrieve number of rows updated

女生的网名这么多〃 提交于 2019-12-11 17:46:24
问题 Below Dynamic SQL is updating 1319 rows. l_sql := 'UPDATE '||l_prefix||'CRS_CUSTOMERS SET CUSTOMER_SOURCE_REF_ID = :REF_ID EXECUTE IMMEDIATE l_sql USING i.CUSTOMER_REF_ID, i.CUSTOMER_ID; TO_CHAR(SQL%ROWCOUNT); The rowcount output is just one? How can i use any script to retrieve actual number of rows affected? 回答1: Your code should be like this: l_sql := 'UPDATE '||l_prefix||'CRS_CUSTOMERS SET CUSTOMER_SOURCE_REF_ID = :REF_ID'; EXECUTE IMMEDIATE l_sql USING i.CUSTOMER_REF_ID, i.CUSTOMER_ID;

Want to get total row count in footer of spring batch without customizing writer(Delegate Pattern)

时光怂恿深爱的人放手 提交于 2019-12-11 16:12:34
问题 This is my footer class:-- public class SummaryFooterCallback extends StepExecutionListenerSupport implements FlatFileFooterCallback{ private StepExecution stepExecution; @Override public void writeFooter(Writer writer) throws IOException { writer.write("footer - number of items written: " + stepExecution.getWriteCount()); } @Override public void beforeStep(StepExecution stepExecution) { this.stepExecution = stepExecution; } } This is my xml:-- <bean id="writer" class="org.springframework

Why must I add a DataGridView to a Form in order to get the data?

浪尽此生 提交于 2019-12-11 15:58:49
问题 I had to copy a datagridview to another, in order to iterate through it within a backgroundworker thread, creating an excel export. The copy was made to allow users to made some changes in the original datagridview, during the export. So I created a new DataGridView (programatically), and put a copy of the original DataTable into the DataSource property of the new DataGridView. However, I figured out that if I don't add the datagridview in the Controls (list) property of any Form, the

How can I do paging in Sybase without making temp table? (oracle rownum issue)

…衆ロ難τιáo~ 提交于 2019-12-11 04:07:22
问题 In Oracle, usually query like this for paging. SELECT * FROM (SELECT *, rownum rid FROM TABLEA WHERE rownum <= #pageend#) WHERE rid > #pagestart# However, there is no "rownum" function in Sybase DBMS. How can I do that query exactlly same in Sybase? I found some ways. use "rowcount" set rowcount 10 select * from TABLEA use identity (make temp table) SELECT *, ROWNUM=IDENTITY(8) INTO #TEMP FROM TABLEA SELECT * FROM #TEMP WHERE ROWNUM < #pageend# AND ROWNUM >= #pagestart# DROP TABLE #TEMP these