Same Order Doesn't Work - Invalid Descriptor Index
I'm getting this "invalid descriptor index" exception while trying to fetch a record from the table.
The query is "select * from <tablename> where <columnname> = 'xyz'". The column name is correct and indeed a record with 'xyz' value exists. The record is getting fetched too...! But I'm having this particular error while trying to retrieve a couple of fields with rs.getString().
The order of columns in the table is same as the order in which I'm retrieving them. And I'm not facing any problem retrieving another field which has width of 200 characters.
I'll be very grateful indeed if someone can help me out of this particular problem...
I've got the following query:
SELECT zA."ID" AS fA_A
, zA."TEXT" AS fA_B
FROM Test."Booking" AS zC
) AS fA_E
FROM Test."Stack" AS zA
WHERE zA."ID" = ?
With this query I call:
- SQLPrepare -> SQL_SUCCESS=0
- SQLNumParams -> SQL_SUCCESS=0, pcpar = 1
- SQLDescribeParam( 1 ) -> SQL_ERROR=-1, [Microsoft][ODBC SQL Server Driver]Invalid parameter number", "[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index"
Is there a problem with this calling sequence or this query? Or is this a problem of SQL Server?
I'm testing db to db transactional replication on a box ( all on the same box ) and the distribution agent fails with the above error. I know it's something to do with the physical server as this test works on other servers fine. SQL2k Ent sp4 on w2k3 ent sp1. ( clustered )
Server and Agent accounts are in local admins, tried push and pull, named and anonymous. Replication also fails if I use the default snapshot location. I suspect policy restrictions ( maybe on the sql service accounts ) Any pointers would be helpful - there are no errors other than above, sadly.
We recently upgraded a SQL 7.0 SP2 database to SQL 2000 SP2. The web server that connects to both databases (we have 2 up that we can switch back and forth) is Win2K with the SQL Server ODBC driver of 2000.80.194.00 (I'm thinking this came w/ W2K) But I think I installed the 7.0 client connectivity on the web server.
I have a few questions:
1. Any reason why this would happen with the SQL upgrade?
2. What is the ideal situation for client/server ODBC drivers / MDAC client.. If I have a SQL 2000 SP2 server do I install SQL 2000 client on the web server and also the service pack on the web server?
Thanks and please ask if you need more info..
In previous versions of MSSQL and on every other SQL engine I've tried the following pseudo-code works.
SQLExecDirect('select employeeid, photo, notes from employees where employeeid = 1')
SQLGetData(for column 3)
SQLGetData(for column 2)
With the Native Client I get an error 07009 "[Microsoft][SQL Native Client]Invalid Descriptor Index"
Is this a bug in the Native Client or am I making an incorrect assumption that I can get data in any order?
We've run into a problem using SQLDescribeParam with the SQL Server ODBC driver (or SQL Native Client driver). The basic sequence that shows the issue is this:
SQLPrepare(select * from foo where col1 = ?)
SQLFreeStmt(SQL_CLOSE) /* NOT RESET_PARAMS */
SQLPrepare(select * from foo where col1 = ? and col2 = ?)
SQLDescribeParam(2) ==> returns "Invalid Descriptor Index"
If I leave out the SQLBindParameter, then the last SQLDescribeParam works just fine. Also, if I make the SQLFreeStmt use SQL_RESET_PARAMS then it works fine. However, I don't have direct control over the ODBC code being used, so I wanted to see if this known behavior. I've tried a couple of other ODBC drivers that support SQLDescribeParam and they work fine with the above sequence.
Can someone tell me why SQL seems to ignore my order by clause?I tried to run through the debugger, but the debugger stops at theselect statement line and then returns the result set; so, I have noidea how it is evaluating the order by clause.THANK YOU!CREATE proc sprAllBooks@SortAscend varchar(4),@SortColumn varchar(10)asIf @SortAscend = 'DESC'Select titles.title_id, title, au_lname, au_fname,Convert(varchar(12), pubdate, 101) as PubDatefrom authorsinner jointitleauthoronauthors.au_id = titleauthor.au_idinner jointitlesontitleauthor.title_id = Titles.title_idORDER BY au_lnameCASE @SortColumn WHEN 'title' THEN title END,CASE @SortColumn WHEN 'au_lname' THEN au_lname END,CASE @SortColumn WHEN 'PubDate' THEN PubDate ENDDESCELSESelect titles.title_id, title, au_lname, au_fname,Convert(varchar(12), pubdate, 101) as PubDatefrom authorsinner jointitleauthoronauthors.au_id = titleauthor.au_idinner jointitlesontitleauthor.title_id = Titles.title_idORDER BYCASE @SortColumn WHEN 'title' THEN title END,CASE @SortColumn WHEN 'au_lname' THEN au_lname END,CASE @SortColumn WHEN 'PubDate' THEN PubDate ENDGO
Hello all,The followinq qurey returns sometimes values of null to some of this columns, byK,byT,byD. the column F wil not contains any nulls, and 0 will be populated in it at any case of .Now, the problem is that when sorting out F the sort will not work when there is null parameters in byK because teh fact that a 0 values is greater then NULL value, and the sort of F will not take in considiration. So I guess the question is how can I sort NULL values and 0 values to be the same weight in the sort by command? SELECT A.gym_id as gym,s_id, week, gym_name, boxer, league, sum(points)
points,sum(byK)as byK, sum(byT) as byT,sum(byPoints) as byPoints ,
sum(byD) as byD, count(C.gym) as F
FROM A inner JOIN B ON A.gym_id = B.gym_id
left JOIN C ON A.gym_id = C.gym
WHERE (B.l_id = ?text
group by A.gym_id
order by points DESC,byK DESC,byT DESC, byPoints DESC, byD DESC,F ASC
I have created view by jaoining two table and have order by clause.
The sql generated is as follows
SELECT TOP (100) PERCENT dbo.UWYearDetail.*, dbo.UWYearGroup.*
FROM dbo.UWYearDetail INNER JOIN
dbo.UWYearGroup ON dbo.UWYearDetail.UWYearGroupId = dbo.UWYearGroup.UWYearGroupId
ORDER BY dbo.UWYearDetail.PlanVersionId, dbo.UWYearGroup.UWFinancialPlanSegmentId, dbo.UWYearGroup.UWYear, dbo.UWYearGroup.MandDFlag,
If I run sql the results are displayed in proper order but the view only order by first item in order by clause.
Has somebody experience same thing? How to fix this issue?
When I run the select its fine but I cannot delete..... i have done this many times and it has worked.... I cannot see the error what am i missing
inner join eqnow_names
on eqnow.empnumber = eqnow_names.empnumber
eqnow_names.names is null
i get this error
Server: Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'inner'.
I'm pretty new to DTS, so forgive me if this is basic. I created a simple DTS package to run a query and export it to a text file. I can execute the package fine from my workstation through EM, but when I try to execute the job to run the package I get this error:
Error = -2147467259 (80004005) Error string: Error opening datafile: Access is denied.
I think that maybe SQL Agent doesn't have the right permissions to write to that network drive. What should the permissions be?
This is probably very simple, but I can't get passed this problem.
I have a report in MS Access that uses info generated by a query. One of the text fields in the query contains either the word 'Select' or the name of a course.
The report should display a space if the value is 'Select', or the actual value of the field in any other case. The field can never contain a null value.
in the text box on the report, but this only returns #error regardless of the actual content of the field.
What am I doing wrong?
I create and schedule a SQL job to run every minute to update a table base on certain condition but it doesn't work. Job history says successful every time but the table doesn't get updated.
However if I move it to Query Analyzer and run it under dba, it will work. Thinking that it may have to do with the user the job run as, I then change run as user from self to dba. But still SQL job won't update my table.
Anything about user permission or security that I can check? Or it there any other possibility?
Msg 15123, Level 16, State 1, Procedure sp_configure, Line 78
The configuration option 'user instances enabled' does not exist, or it may be an advanced option.
Valid configuration options are
Hi to all, I'm building (and learn) an application with VB Express. In "edit dataset with designer" I've build this sql query:
SELECT tbl_soggetto.[ID Soggetto], tbl_soggetto_tipo.Tipo, tbl_soggetto.[Cognome/Denominazione], tbl_soggetto.Nome, tbl_soggetto.Indirizzo, tbl_soggetto.CAP, tbl_soggetto.CittÃ , tbl_soggetto.Provincia, tbl_soggetto.[Telefono 1], tbl_soggetto.[Telefono 2], tbl_soggetto.[Telefono 3], tbl_soggetto.[Telefono 4], tbl_soggetto.[eM@il 1], tbl_soggetto.[eM@il 2], tbl_soggetto.Note
FROM tbl_soggetto INNER JOIN tbl_soggetto_tipo ON tbl_soggetto.[ID Tipo] = tbl_soggetto_tipo.[ID Tipo]
WHERE (tbl_soggetto.[Cognome/Denominazione] LIKE '%' + @Testo + '%')
The LIKE doesn't work!
I call the query with Me.griglia.DataSource = Me.TA_tbl_soggetto_ricerca.Search_Cognome(Me.txt_trova.Text.Trim)
But with LIKE '%ABC%' work!
Me.griglia.DataSource = Me.TA_tbl_soggetto_ricerca.Search_Cognome()
Someone can help me? Thanks...
When I try to install the problem I get the following error.
The SQL Server service failed to start. For more information, see the SQL Server Books Online topics, "How to: View SQL Server 2005 Setup Log Files" and "Starting SQL Server Manually."
The log tells me nothing useful. I can't start the thing manually because after clicking cancel on the error message, the installer proceeds to roll back the installation.
How do I fix this problem?
This is the autogenerated code from the SelectCommand of my DataAdapter, except the red text. This DataAdapter is used to fill a DataGrid. What I want to do, is to calculate the total memory (4 slots) / PC.This code makes the sum of all memory of all PC's together.I'm not sure if the group by clause is needed here ...Me.OleDbSelectCommand1.CommandText = "SELECT PC.ID, PC.Nummer, PC.Netwerknaam, Case_Type.Type AS Case_Type, Processor_T" & _"ype.Type AS Processor_Type, Processor_Snelheid.Snelheid AS Processor_Snelheid, " & _"(SELECT SUM(Memory) FROM Memory, PC, RAM WHERE RAM.PcID = PC.ID AND RAM.GrootteID = Memory.ID)" & _"AS Memory, OS.Naam AS OS, OS_SP.Nummer AS OS_SP, Gebru" & _"iker.Naam AS Gebruiker_Naam, Status.Status, PC.Tagged FROM (Status RIGHT OUTER J" & _"OIN ((((((((PC LEFT OUTER JOIN (RAM LEFT OUTER JOIN Geheugen ON RAM.GrootteID = " & _"Geheugen.ID) ON PC.ID = RAM.PcID) LEFT OUTER JOIN Case_Type ON PC.Case_TypeID = " & _"Case_Type.ID) LEFT OUTER JOIN OS_SP ON PC.OS_SpID = OS_SP.ID) LEFT OUTER JOIN Ge" & _"bruiker ON PC.GebruikersID = Gebruiker.ID) LEFT OUTER JOIN Processor_Snelheid ON" & _" PC.Processor_SnelheidID = Processor_Snelheid.ID) LEFT OUTER JOIN Processor_Type" & _" ON PC.Processor_TypeID = Processor_Type.ID) LEFT OUTER JOIN OS ON PC.OsID = OS." & _"ID) LEFT OUTER JOIN Switchbox_Details ON PC.ID = Switchbox_Details.PcID) ON Stat" & _"us.ID = PC.StatusID) GROUP BY PC.ID, PC.Nummer, PC.Netwerknaam, Case_Type.Type, " & _"Processor_Type.Type, Processor_Snelheid.Snelheid, OS.Naam, OS_" & _"SP.Nummer, Gebruiker.Naam, Status.Status, PC.Tagged"I would like to know how to calculate the total memory for each separate PC.Hope you can help me.
Dear GroupI'd be grateful if you can help me with the following. I'm trying toconnect to an instance of MSDE called BALTD.The instance has SQL authentication enabled and the service is running.Somehow it doesn't what it should do according to MSDN.When I try connectiong with the following (and variations of it) itjust doesn't do anything. Any ideas why?osql -u sa -s localMSSQL$BALTDC:Documents and SettingsMartin>osql -u sa -s localMSSQL$BALTDusage: osql [-U login id] [-P password][-S server] [-H hostname] [-E trusted connection][-d use database name] [-l login timeout] [-t query timeout][-h headers] [-s colseparator] [-w columnwidth][-a packetsize] [-e echo input] [-I Enable QuotedIdentifiers][-L list servers] [-c cmdend] [-D ODBC DSN name][-q "cmdline query"] [-Q "cmdline query" and exit][-n remove numbering] [-m errorlevel][-r msgs to stderr] [-V severitylevel][-i inputfile] [-o outputfile][-p print statistics] [-b On error batch abort][-X disable commands [and exit with warning]][-O use Old ISQL behavior disables the following]<EOF> batch processingAuto console width scalingWide messagesdefault errorlevel is -1 vs 1[-? show syntax summary]C:Documents and SettingsMartin>Thanks very much for your help and efforts!Martin
I'm working with mssql 6.5
I have an primary key column with Identity property.
And at the moment server doesn't insert the proper value to this column.
Error message is following
Msg 2601, Level 14, State 3
Attempt to insert duplicate key row in object 'Spot' with unique index 'XPKSpot'
Command has been aborted.
The datatype of this column is int, and number of rows ~17000.
If I execute select @@identity it returns null.
I wanted to create a new trigger, but Enterprise Manager tells me about an "Incorrect syntax near @UpdatedByID, line 28". I double-checked everything, but it still does not work :mad: .
Any hints :confused: ?
Here is the statement (line 28 is marked with ***):
CREATE TRIGGER TransferToABII ON [dbo].[CALGeneral]
DECLARE @Event varchar(255),
SELECT @Event = Event,
@BBaseUID = BBaseUID,
@StartDate = StartDate,
@EndDate = EndDate,
@Details = Details,
@AddressID = AddressID,
@UpdatedByID = UpdatedBy,
@ProjectID = ProjectID
EXEC BrainBase.dbo.BB_NEW_CREATE_NoteTask_Ret *** (@UpdatedByID,
@ActID = @ActID OUTPUT,
@EventID = @EventID OUTPUT)
UPDATE CALGeneral SET ActID = @ActID WHERE ID = INSERTED.ID
IF @@ERROR <> 0
I created query which should update first 100 rows in the table.
When I run it I have the message:The command(s) completed successfully.
But when I run select*from sales I can see that nothing have been changed.
Where is my mistake in this query:
set qty = '2'
where convert (varchar(4),qty)in (select top 3 ord_num
where stor_id = '8042' and payterms = 'net 30')
Anyone have a clue how to fix this error. The dts package works fine when run outside the job but fails when run as a job. The job is run by the sql server admisistrator. Everything is local(sql agent, database, etc.). We are sure it is a permission problem but where?
DTSRun: Loading... Error: -2147008507 (80074005); Provider Error: 0 (0) Error string: Unspecified error Error source: Microsoft Data Transformation Services (DTS) Package Help file: sqldts.hlp Help context: 713 Error: -2147467259 (80004005); Provider Error: 6 (6) Error string: [DBNMPNTW]Specified SQL server not found. Error source: Microsoft OLE DB Provider for SQL Server Help file: Help context: 0. Process Exit Code 1. The step failed.ob. Everything is local and being run by the administrator. We are sure it is a permission problem but where?
I had a SQL Server falure. I rebiuld Master and tried to attach my database
with sp_attach_db? but get an error
Expression: rowLog.RowCount () == 1 || pPage->IsEmpty ()
Process ID: 119
I try to copy a DB from one server to another. On the target server an older version of the DB has been deleted and I now try to attach the new version using "sp_attach_db DBname, Filelocation", but I always get an error "Device Activation error. The physical file name 'D:mssql7dataAgency_log.ldf' may be incorrect"
"Database 'Agency' cannot be Created"
To me it seems that the database is looking for the log files (now deleted).
I've tried forcing a new log file I created using the same locations for the mdfs. I've tried using create a new database and replace the mdf file, but nothing works.
I'm combining first name, last name, middle name, and an ID number together into an alias. Then I need to match that alias with a variable passed to the page (its a search results page). The problem is it claims that there is no table with the name of my alias. Anyone know what I'm doing wrong?
A mockup of the SQL looks like this:
SELECT UserID, Last_Name + ', ' + First_Name + ' ' + Middle_Name + '.' AS name
WHERE name LIKE 'variable%'
Everything looks right with the results, if I take out the WHERE clause it has name displayed properly and joined together with the rest of the data in the results properly.
Thanks in advance for any help that can be provided!
I have a query that doesn't work when i use 4 name convention instead of a openquery. The msg is below. Anyone know what is going on?
Both queries are the same but one doesn't work.
SELECT TOP 1 * FROM OPENQUERY(AS400_PROD, 'SELECT * FROM PPTREASUSA.ORDDET')
-- doesnt work
SELECT TOP 1 * FROM AS400_PROD.S1030Y3M.PPTREASUSA.ORDDET
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: Unspecified error]
[OLE/DB provider returned message: [IBM][iSeries Access ODBC Driver][DB2 UDB]CPF5715 - File ORDDET01 in library QTEMP not found.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBSchemaRowset::GetRowset returned 0x80004005: ].