RecordCount In SQL CE??
Sep 12, 2007Does somebody know how to obtain the recordcount from a SqlCeResultSet ?
Thanks in advance!
Does somebody know how to obtain the recordcount from a SqlCeResultSet ?
Thanks in advance!
I have one Table i.e Transaction. I want to display the recordcount of particular user for current date. I have written qury for this but it return only one record as recordcount But the table contain 5 record for that particular user. Pls help me .
Query: CD store the current Date
CD = Text5.Value
Sql = "SELECT DISTINCTROW DummyTran.*FROM DummyTran"
Sql = Sql & " WHERE ((DummyTran.AssignedTo = ""SSS001"") And (DummyTran.Date = ""CD"")); "
Set rs = db.OpenRecordset(Sql)
T = rs.RecordCount
I am very disappinted where Datareader have no RecordCount where I can get the total records it read. I guess I found a way:
sql = "SELECT *, ROW_NUMBER() OVER (ORDER BY id DESC) AS c FROM ACCOUNTS ORDER BY c DESC"Dim command As SqlCommand = New SqlCommand(sql, New SqlConnection(_DBConnectionString)) command.Connection.Open() _ReturnDataReader = command.ExecuteReader(CommandBehavior.CloseConnection) command.Dispose() _TotalRecord = _ReturnDataReader.GetInt64(_ReturnDataReader.GetOrdinal("c"))
Have SQL Server 2005 count for me....
Charlie writes "The query below returns the date of the 3rd deposit due in a recordset, but if there are only 2 deposits due this query returns the second deposit due as the third. How can I force a null or blank on the third deposit if ther isn't one.
SELECT top 1 recordid, convert(varchar,deposit_due_on,107) AS DueDate
FROM (SELECT TOP 100 recordid,deposit_due_on FROM (SELECT TOP 3 recordid,deposit_due_on FROM TABLE_NAME
WHERE recordid=2)a order by a.deposit_due_on desc ) b
regards
Charlie"
Hi,
Could someone shed some light on the best way to check a table recordcount before run of DTS pkg.
We have a table that is populated in MS SQL from an Oracle database, and the contents of that table are the basis of a DTS package that we run.
Sometimes Oracle transfer bombs out and the table is empty but our process runs anyway. It screws everything up.
Can we check the recordcount of a table on the server, and if the recordcount > 1 then the process runs, if not, then the process aborts?
Thanks,
Dominic
I have a number of databases with large tables. I need to update them from time to time. I want to get the recordcount of the table and calculate based on that the amount of time it would take to update the table. Any idea who I can do this? I'm using coldfusion 8 with sql to do this. Any advice would be appreciate!
Thanks
Shuvi
I posted this question a little while ago but was not able to implement it. Now I am back to the same issue. Basically I want to get a recordcount from a table in Oracle and update an existing record in sql server with the value.
I am trying to accomplish this using a Execute SQL Task. In this task I am pointing to a Oracle DB that I am able to query from SSIS so connectivity is not an issue.
I have defined a variable EmpRC of type int32.
I have a following the the SQL Task:
query: select count(*) from emp;
result set=single row.
and on result set tab ResultName =0 and variable name is same defined above : User::EmpRC
I get an error when I run this:
[Execute SQL Task] Error: An error occurred while assigning a value to variable "EmpCompRC": "Unsupported data type on result set binding 0.".
I have tried using different data types for EmpRC but having no luck. any ideas?