I have two stand-alone recordsets. They have the exactly the same fields definitions. They come from different ADODB connections (Microsoft Jet). And I cannot merge them into one recordset.
I was trying to merge the second recordset into the first, but instead of adding the records, the first recordset becomes populated with infinite copies of the first record of the second recordset. This seems to me a VB6 bug.
Any help on how to go around this problem will be really appreciated. Thanks a lot. Frank
This is the code:
(Please note, the INVENTORY table contains different data but has the same structure in both databases.)
On the development environment i've got replication running with no trouble but when deploying in the production environment i get the error below
Has anyone seen this before and solved it? Another question: How to enable verbose history when using the MS SQL Server Management Studio to create a subscription.
Any help is welcome,
Ralf
TITLE: Microsoft SQL Server Management Studio------------------------------A call to SQL Server Reconciler failed. Try to resynchronize.HRESULT 0x80004005 (29006)The schema script 'd:MSSQL epldatauncTEST_KANSCE TEST20070522165445 blNaw_2.sch' could not be propagated to the subscriber.HRESULT 0x80070003 (0)The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write.HRESULT 0x80045017 (0)------------------------------BUTTONS:OK------------------------------
is it possible to concatenate 2 recordsets ? i have 2 select, and i need then to be displayed one after other.using union all the results are gathered, ordered like only one select.thanks for all
I've written a query which needs to return different records depending on its argument.
I've used an IF statment to test which of the three SELECT statments should be returned. However, when I try to access the data from VBA in Access I find that the recordset is empty, whereas the query returns thr correct data if I run it in the SQL environment. WHy is this? More importantly, how do I make it return records?
Code:
ALTER PROC [dbo].[spFilteredContractListByUser]
@UserID varchar(7) --The user's 'T' number
AS
PRINT 'User ID is' + @UserID
--Get this user's filter type from tbl
DECLARE @FilterType int
SELECT @FilterType = FilterID FROM tblFindContractUserFilter WHERE UserID = @UserID
-- Standard filter -- Returning all queries matching the username IF @FilterType = 1 BEGIN SELECT DISTINCT [Acc No], Business, Type, [Log Date], [Logged By], [Ack. Date], [Ack. By], [Late?] FROM qryQueriesWorkList WHERE (suser_sname = @UserID) END ELSE IF @FilterType = 2 -- Return only queries acknowledged by @UserID BEGIN SELECT DISTINCT q.[Acc No], q.Business, q.Type, q.[Log Date], q.[Logged By], q.[Ack. Date], q.[Ack. By], q.[Late?] FROM qryQueriesWorkList q WHERE (q.[Ack. By] = dbo.getEmployeeName(@UserID)) END ELSE IF @FilterType = 3 -- Return all the queries which have not been acknowledged BEGIN SELECT DISTINCT q.[Acc No], q.Business, q.Type, q.[Log Date], q.[Logged By], q.[Ack. Date], q.[Ack. By], q.[Late?] FROM qryQueriesWorkList q WHERE (q.[Ack. By] IS NULL) END
I need to decrease the amount of time it takes to return a set of data of the following format:
State[Provided vai user intput]->All Counties in State->All Cities in County->All Zones in City[usually < 50 or 75 per city]
current behavior: 1. currently user selects state all counties are returned from db 2. foreach county cities are returned 3. foreach city streets are returned 4. objects hydrated with data & display drawn
As you can see this gets expensive. I know there has to be a better way to do this. Any suggestions? We use sql server/c#.net.
I'm having SSIS block right now and thought I'd see if anyone had a simple solution to this.
What I have is SSN data coming in from several different tables, which needs to be inserted into a SurrogateSSN table which just uses an Identity field for the surrogate.
I normally build a seperate package for each detination table, so in each package that has SSN data in the source, I need to insert into the SurrogateSSN table (then I can use the surrogate values later in my package).
What I'm looking for is a simple solution if possible (preferrable using existing non-script tasks, or very short script), where I can pass in the SSN. Is there way to create a package that will accept a recordset (of SSN's) for this insert, that I can call from several different packages, and pass in the recordset of SSN's?
I think it whould be simpler to explain what I am trying to accomplish. I wish to pull a query to return multiple records from a SQL 7.0 database. The query is a customers standing order. I wish to make edits to multiple records then return those records for update. The HTML pages that I have seen all seem to display tables on a singular record format. Is it possible to display records in a 'Table' format and allow it to be updated. Can any one answer this or direct me to a site with the relevent info. Thanks Stuart Indtec@eircom.net
Using just SQL (within SQL Server 2000), I'm looking to output 2 (or more) recordsets from a one-to-many join between table all on one row. Help! Can someone please show me how to do this if it can be done.
SELECT - i.itemID AS ItemID, - p1.partID AS HLPartID, - p1.manf AS HLManf, - p1.name AS HLName, - p2.partID AS TLPartID, - p2.manf AS TLManf, - p2.name AS TLName
FROM - ZItems i - - - - INNER JOIN ZItemsToParts ip - - - - - - ON i.itemID = ip.itemID AND - - - - - - (ip.funktion = 'headlight' OR - - - - - - ip.funktion = 'taillight') AND - - - - - - i.itemID = 10 - - - - LEFT OUTER JOIN ZParts p1 - - - - - - ON ip.partID = p1.partID AND - - - - - - ip.funktion = 'headlight' - - - - LEFT OUTER JOIN ZParts p2 - - - - - - ON ip.partID = p2.partID AND - - - - - - ip.funktion = 'taillight'
************* Output *******************
Using "Query 1" I get this: (Note: HL = Headlight; TL = Taillight)
I wish to output the proceeding two record set in one row Any ideas how this can be done with SQL Server 2000 (with JOINS in the FROM clause)? - DESIRED OUTPUT:
Here's a question you'll never quit hearing: is there a convenient way to page through large recordsets in SQL Server 2000?
I'm writing some software which, for all intents and purposes, works like a messageboard: users can create threads, leave replies, and so on.
I have about a half million records in a few of my tables, and some of my queries return 1000s of results. I'd prefer not to return 1000s of records all at once, so I don't want to page my records in code; I'd rather page them in SQL Server. Naturally, I want to page replies. However, I don't know of a convenient way to page records in SQL Server 2000.
I have a single .asp page that opens a connection and then sequentiallyopens and closes 14 recordsets from stored procedures to obtain variousproduct information before closing the connection.Is it common practice to do something like this? Or is opening 14recordsets going to become a real problem when the page goes live and startsgetting high web traffic?Thank you in advance for any information you might provide.Dave
Hey,I've got an Classic ASP app pulling some records out of a DB, whichworked fine when it was Access. When we upped to SQL Server, all of asudden, when the Recordsets came back, all the dates were empty, eventhough the data was showing up in the DB.About a year ago (only code asp apps once and a while), I rememberseeing this and finding something that just had something to do with theorder in which something was being referenced, but I just can't for thelife of me remember what it was.The Dates are set as datetime, length of 8.Anyone know why this happens and a solution?many thanks,rob
I need to be able to run a DTS package from a computer that doesn't have any SQL tools on it. What do I need to copy over to that machine to do so? dtsrun.exe, dll's, etc. Thanks
What Does the "SQL" Stand for? I am just starting to teach myself Visual Studio Programing and some other applications. I can build any computer system that is out there and I have; So I think it is now time for me to study modern programing.
I started waching the Visual LESSONS, provided by Microsoft and I must say "Programing has come a long way since Micosoft (BASICA) and (DOS)"..... I am very enthusiastic about the new wave Software laguages....
Computing has been my hobby as well as a outstanding educational tool, I feel that what makes it so great is that you can spend all you life working or playing with them and NEVER reach and end.... So as a retired Machine and ToolMaker I will lean a new field at my own pace.... And Who Knows????????????
Thank you All......... ToolMan59........ Long Life And Good Health to All.......
I'm writing some stored procedures that first do an Insert or an Update, and then also do a Select to return a Recordset back to an ADO client. However an Insert or Update causes a closed recordset to be produced in ADO. I can skip over the closed recordset with the NextRecordset method.
So the question is, is there any way of stopping the closed recordset being returned? I don't want to have to call the NextRecordset method from ADO as this would mean that the client would need to know about the implementation of the stored procedure.
Has anyone got any ideas on how to get round this?
I am doing some mods to an existing db web app in asp. I am providing a facility to copy a subset of related records in a few tables. I am using one recordset to read in the selected records and then copying the data into another recordset creating a new record in the same table. I have to then pick up the @@IDENTITY of the new record so that I can update linked records in other tables.
The @@IDENTITY value returned is null unless I close the selection recordset.
I have created a simplified version of the code to demonstrate this.
The underlying table is called 'test' and it has 2 fields, 'test_id', integer, identity and 'test_desc' varchar(50)
ASP Code
<% dim objConn, objRS1, objRS2, objRS3
sub OpenDatabase() 'open database object here instead of in page Set objConn = Server.CreateObject("ADODB.Connection") 'Connect object to database through global.asa application variable objConn.Open = Application("test_ConnectionString") 'Create recordset object to use Set objRS1 = Server.CreateObject("ADODB.Recordset") Set objRS2 = Server.CreateObject("ADODB.Recordset") end sub
sub CloseDatabase Set objRS1 = Nothing Set objRS2 = Nothing objConn.Close Set objConn = Nothing end sub
function UnNull(numval) if isnull(numval) then UnNull="NULL" else UnNull=cstr(numval) end if end function
OpenDatabase
strSQLQuery = "select * from test where test_id in (1,2) order by test_id" objRS1.Open strSQLQuery, objConn, 1, 3
do while not objRS1.eof objRS2.Open "test", objConn, 1, 3 objRS2.AddNew old_test_id = objRS1("test_id")
Hi All!I need help with a Statement!I am working with an Access2000 DB.I have the following Problem.ChNrLinieDatum Code 39 Stückzahl BHL1 BHL2 BMRH582-064L2.1008.03.2005 02:30:00FCAA14821701582-064L2.1008.03.2005 02:30:00FCAA14871701582-114L2.1208.03.2005 01:00:00FAC827501240582-114L2.1208.03.2005 01:00:00FAC827441240582-114L2.1208.03.2005 01:00:00FAC827501240582-094L2.707.03.2005 19:45:00FAE74323481582-094L2.707.03.2005 19:45:00FAE74489481582-094L2.707.03.2005 19:45:00FAE74489481581-294L2.807.03.2005 18:20:00FA8V2658221581-294L2.807.03.2005 18:20:00FA8V2652221581-294L2.807.03.2005 18:20:00FA8V2658221582-114L2.1207.03.2005 17:45:00FAAR20721236As you can see I have a few recordsets that are double. The Thing is, thereis an ID that makes them different.I need a Statement that deletes the surplus records where 'Datum' and'Linie' are identical to another record. 1 record has to remain of course.I thought of something like this.DELETE FROM tbAuswertWHERE EXISTS(SELECT *FROM tbAuswertWHERE (Linie AND Datum)IN (SELECT Linie AND Datum AS SuchkritFROM tbAuswertGROUP BY SuchkritHAVING ((Count(Suchkrit)>1)))But I get an error:You wanted to execute a Query that did not have the following expression'Not Linie = 0 And Not Datum = 0' in its AggregatefunctionPerhaps you ccan help me.ThanksJulia--Message posted via http://www.sqlmonster.com
I'm currently running the following statement that is used in a CrystalReport. Basically, a record is returned when the T_PAYMENT.amounthas a record in the database based on the value of the T_MULTILIST.codefield. Currently, if there is no record returned, there is no listingin the report for the given T_MULTILIST.code.The user now wants a record to be displayed on the report when there isno record in the database - she wants it to display a value of '$0'for the given T_MULTILIST.code record. I tried to explain the fact thatis not possible the way things stand at the moment. Basically I needsome typeof case statement that says 'if there is no record returned, create asingle record and set T_PAYMENT.amount = 0' AFTER each query has beenexecuted.Anyone have any idea how to accomplish this?SELECT DISTINCT'English Language Arts, Grade 1' as Rec_Type, 'English Language Arts(Consumable)' as Super_Type, '' as Other_Type, 'Continuing Contracts'as Proc_Type,T_MULTILIST_GRADE.grade, T_MULTILIST.description, T_MULTILIST.code,T_PAYMENT.amountFROM (T_MULTILIST T_MULTILIST INNER JOIN (T_PAYMENT T_PAYMENTINNER JOIN T_SHIPPING_DETAILT_SHIPPING_DETAIL ONT_PAYMENT.transaction_id=T_SHIPPING_DETAIL.transac tion_id)ON T_MULTILIST.code=T_SHIPPING_DETAIL.multilist_code) INNER JOINT_MULTILIST_GRADE T_MULTILIST_GRADE ONT_MULTILIST.code=T_MULTILIST_GRADE.multilist_code, T_ORDER, T_REQUISITION, T_REQUISITION_DETAILWHERET_ORDER.id = T_SHIPPING_DETAIL.order_id ANDT_REQUISITION.id = T_ORDER.requisition_id ANDT_REQUISITION_DETAIL.requisition_id = T_REQUISITION.id ANDT_REQUISITION_DETAIL.latest_record_flag = 1 ANDT_REQUISITION.latest_record_flag = 1 ANDT_ORDER.latest_record_flag = 1AND (T_MULTILIST.code='1040')AND (T_MULTILIST.expiration_year >= '2006' )AND (T_REQUISITION.requested_shipment_date >= '2006' + '0601'AND T_REQUISITION.requested_shipment_date < dateadd(YY, 1,'2006' + '0601' ) )UNIONSELECT DISTINCT'English Language Arts, Kindergarten' as Rec_Type, 'EnglishLanguage Arts (Consumable)' as Super_Type,'' as Other_Type, 'Continuing Contracts' as Proc_Type,T_MULTILIST_GRADE.grade, T_MULTILIST.description,T_MULTILIST.code, T_PAYMENT.amountFROM (T_MULTILIST T_MULTILIST INNER JOIN (T_PAYMENT T_PAYMENTINNER JOIN T_SHIPPING_DETAIL T_SHIPPING_DETAILON T_PAYMENT.transaction_id=T_SHIPPING_DETAIL.transac tion_id)ON T_MULTILIST.code=T_SHIPPING_DETAIL.multilist_code) INNER JOINT_MULTILIST_GRADE T_MULTILIST_GRADE ONT_MULTILIST.code=T_MULTILIST_GRADE.multilist_code, T_ORDER, T_REQUISITION, T_REQUISITION_DETAILWHERET_ORDER.id = T_SHIPPING_DETAIL.order_id ANDT_REQUISITION.id = T_ORDER.requisition_id ANDT_REQUISITION_DETAIL.requisition_id = T_REQUISITION.id ANDT_REQUISITION_DETAIL.latest_record_flag = 1 ANDT_REQUISITION.latest_record_flag = 1 ANDT_ORDER.latest_record_flag = 1AND (T_MULTILIST.code='0040')and (T_MULTILIST.expiration_year >= '2006' )AND (T_REQUISITION.requested_shipment_date >= '2006' + '0601'AND T_REQUISITION.requested_shipment_date < dateadd(YY, 1,'2006' + '0601' ) )Up to 40 more UNION statements follow the above 2.
Hello,This problem perplexes me and I hope that someone has done somethingefficient.Take for example the data in the MASTER..SYSPERFINFO:SELECTCAST(RTRIM(INSTANCE_NAME) AS VARCHAR(15)),CAST(RTRIM(COUNTER_NAME) AS VARCHAR(31)),CAST(RTRIM(CNTR_VALUE) AS VARCHAR(10))FROM MASTER..SYSPERFINFOWHERE INSTANCE_NAME = N'TEMPDB'tempdb Data File(s) Size (KB) 51200tempdb Log File(s) Size (KB) 1272tempdb Log File(s) Used Size (KB) 738tempdb Percent Log Used 58tempdb Active Transactions 0tempdb Transactions/sec 186281tempdb Repl. Pending Xacts 0tempdb Repl. Trans. Rate 0tempdb Log Cache Reads/sec 0tempdb Log Cache Hit Ratio 0tempdb Log Cache Hit Ratio Base 0tempdb Bulk Copy Rows/sec 0tempdb Bulk Copy Throughput/sec 0tempdb Backup/Restore Throughput/sec 0tempdb DBCC Logical Scan Bytes/sec 0tempdb Shrink Data Movement Bytes/sec 0tempdb Log Flushes/sec 1578tempdb Log Bytes Flushed/sec 67882496tempdb Log Flush Waits/sec 226tempdb Log Flush Wait Time 47tempdb Log Truncations 248tempdb Log Growths 3tempdb Log Shrinks 0<I did the CAST and LTRIM so that it looks better when displayed in abrowser>I would like to keep statistics in a table with the following columns:INSTANCE_NAME,DATA_FILE_SIZE,LOG_FILE_FIZE,ACTIVE_TRANS,TRANS_PER_SECSo, instead of having a table with three columns and 23 rows(only 4 ofwhich I want), I would have a single row with 4 columns(plus theInstance_Name).Visualy, I want to call this a 90 degree rotation. Here's what theselect statement would then look like:SELECT *FROM SYSPERFINFO_ARCHIVEWHERE INSTANCE_NAME = N'TEMPDB'Here's the result set:tempdb 51200 1272 0 185198Is it possible to 'rotate' a recordset into columns?How would it be done?Gracias.
We're using ADO disconnected recordsets. On SQL 2000, we could update these on the client (without propagating the changes to the server) even if the underlying view or table was non-updatable.
When running our apps against SQL 2005 (using the same client-side environment), we can no longer change any attributes of those disconnected recordsets, that connect to a non-updatable database object (the rest of the app runs fine, we can update all updatable database objects through disconnected recordsets) . Does SQL 2005 respond to such calls differently from SQL 2000, so that ADO recordsets are built in a new way (which makes them read-only in our setting)?
I am creating a report from a stored procedure that returns multiples record sets. For an example, my stored procedure is as follows
CREATE PROCEDURE MYPROCEDURE AS
BEGIN SELECT * FROM TABLE1 SELECT * FROM TABLE2 SELECT * FROM TABLE3 END
Now lets say I want to create a report that will display the result of the query no 2 (which is SELECT * FROM TABLE2 in this example). How can I do this? Is there any way to bind the second record set to the report dataset with out changing the stored procedure? I will appreciate any kind of suggestions on this Thanks Moim
Does anyone know what aspnet_regsql.exe requires to run stand-alone? I have to apply the .NET 2.0 Management/Role API to a sql2000 database on a machine that does not have the .net 2.0 framework installed.
Here is the scenario: We have an existing production non clustered SQL 2000 server instance that we need to migrate to a new clustered SQL 2000 server instance. We need to accomplish this without affecting the FQDN that applications use to call this server. I found this article on a solution to rename the server after an xcopy of the entire db structure. Here is the link http://vyaskn.tripod.com/moving_sql_server.htm. The other issue that we are trying to resolve is the time it takes for the snapshots of replication to run (in our case almost a full day). That is why this approach looked like it may be a good solution for us.
Here is the question: Is it possible to move our existing database to a new clustered environment without having to change the FQDN that other applications use to access this database and without having to reinitialize replication?
Can I have warm stand by database on SQL 2000 Server.The source server will be SQL 7.0. In another words can i shipp transaction logs from SQL 7.0 and make Warm stand by on SQL 2000 with SQL 7.0 full and transaction log backups Thanks Mike
I have a sql server db that works fine when I connect via the internet and from the network, but when I try to connect after disconnecting from the network it doesn't find the database (even though the sql server db is on the machine I am using after disconnecting, of course).
Is there something wrong with my connection string? Could it be the Windows/SQL Server/Mixed Authentication mode?
Maybe the best question I could ask is, if I want to run sql server as a web back-end, as a network utility, and as a local db for a windows app, how should I have it set up from a security/authentication standpoint?
My management ask me use logshipping in the part of Disaster Recovery plan,as per i know i have put target database in STAND BY mode in logshipping if ACTIVE MODE fail's how can i bring back the logshipped DB to active