How To Call Functions Via ODBC

Jul 23, 2005

Hello.

How can I call some functions on MSDE when working in Access (.mdb) that is
connected to MSDE via ODBC linked tables ? Especially
in-line functions, that I would like to use as recordset for my forms and
reports.
Can I call in-line functions using ADO ? I tried, but it seems that only
stored procedures are allowed (adCmdStoredProc)....

Thanks.

View 1 Replies


ADVERTISEMENT

Asynchronous Call In Stored Procedure / SQL Functions

May 9, 2008

Problem: Have to call SPs reside in 2 SQL server DBs which will return the table information, need to merge and perform sort the result and return the final result set. this is something like wrapper SP calling other SPs asynchronoulsy.

Can this be possible in SP / SQL functions to make asynchronous calls?

If yes can you please guide me to achive this.

If no, any alternative approach, or the reason why.

I appreciate your views on this.


-Hemanth

View 3 Replies View Related

Deploying CLR Sps Or Functions Which Call A Web Service To A Production Server

Aug 30, 2006

Dear fellow developers,

I have successfully developed a Transact-SQL stored procedure which calls a CLR function, which calls a web service. I am using a Visual Studio 2005 SQL Server Project to perform the necessary magic.

Is there a neat way to deploy this stuff to a production server?

It is bad enough deploying the sp and function, but the web server proxy also needs to be changed to refer to the production web service.

This all looks very nasty and complicated.

Am I missing something?

View 4 Replies View Related

ODBC-- Call Failed When Using VPN

Jul 5, 2006

Hello all.

Please excuse my lack of poper terminology when describing my issue to you, as I am very new to databases.

I have set up a SQL Server database which connects via MS Access. The application works fine, except when trying to connect through VPN.

Through System DSN, I changed the server name (FSERVER) to the server IP address, and test completed successfully. I am also able to ping the server when connected via VPN. However, when I try to start the application, I receive the following error after several seconds:

ODBC-- call failed.

That's it. No other information about the error. I read somewhere to make sure the MDAC versions are the same, which they are.

As I say, I am quite new to this, but would really appreciate any guidance to help me through.

Thanks in advance!
Nils

View 3 Replies View Related

ODBC -- Call Failed

Mar 10, 2008

Hello all,

I have a problem which I can't seem to understand what is the cause. Please help!!!

I have this access which run under oracle 10g. Here is the code (below) that I always get error in. When I got into this error, I go to Control Panel -> Administrative Tools-> Data Sources (ODBC) then I choose on acc (microsoft Access Driver (*.mdb)) and click Configure. I select the access and click repair. It get through and I thought that I solve the error, but every time that I close and open the access when try to run, I receive the same error again. If I goes to the same process, click repair. It work, but I have to do it every time that I close and re-open the access. Does anyone know how to make it default so that I don't have to go the same process every time. Thank you.

Run-time error '-2147467259 (80004005)':
ODBC -- call failed.




Code Snippet
Dim White As Object
Set White = CreateObject("APToolkit.Object")
White.openoutputfile "C:White_" & controlno & ".pdf"
White.openinputfile "C:White.pdf"
White.setmasterquery "DSN=acc", "", "", "-1", "select e.*, f.* from prod_test e, stc f where e.control_number=" & controlno
White.addrelatedquery "DSN=acc", "", "", "-1", "select *, PROD_items.TOT & ' (kgs)' as TOT, CDbl([qty]/300)*CDbl([price]) as PRICE from PROD_ITEMS where control_number=" & controlno & "", "True"
White.setdbmultirowseparator ""
White.doformformatting = True
White.SetDefaultDBMergeFlag -998
White.FlattenRemainingFormFields = True
White.dbtoform False
White.resetformfields
White.closeoutputfile
Set White= Nothing

View 13 Replies View Related

ODBC--call Failed Error

Feb 5, 2007

Hi!It has been weeks now that I have been trying to fix an error that Iencounter everytime it gets to the code at runtime:SQLStmt = "SELECT Sum([Quantity in Stock]) As TotalInStock,Sum([Cost] * [Quantity in Stock]) AS TotalCost " & _"FROM [Inventory Products] WHERE [ItemNumber] = '" & ItemNum & "'"Set InvP = CurDB.OpenRecordset(SQLStmt, DB_OPEN_DYNASET) '==>it gets the error hereI tried also to implement the same code using ADODB but still go the sameerror: "ODBC--call failed".There are other events where similar code is executed without any problemsat all.Any guidance would be helpful.Thanks

View 2 Replies View Related

Odbc Connection Call Failed

Mar 24, 2007

I moved a sql 2000 database to a sql 2005 server. I have a front end in access 2003. I manually created an ODBC data source system DSN using the ODBC Data Source Administrator just like it was on the other server. I can connect fine but users are saying their getting an odbc call fail. I created the connection and relinked the tables to the new server with the moved database. I completed the same task with another database and the user can connect fine. What could be the problem?

View 1 Replies View Related

ODBC-Call Failed - Access

Sep 15, 2006

We have this fairly simple Access database with a link table to a view in an SQL Server. The Select Query in Access is a simple select from this view with a view criteria set. Nothing fancy. What is driving is moderately crazy is that this Select Query in Access seems to work fine for months and than all of a sudden (same query performed around the same time with about the same workload on the SQL-Server) it responses with the helpful "ODBC-Call Failed" message. Closing the Access database, taking a coffee, coming back againg and try the exact same Select Query normally works, no "ODBC-Call Failed" message.

It not happens always, mosty we're fine.
When it happens it happens for all subsequent queries tried. We have to close and reopen the Access database and pray to the good Lord that it works.

We would be very interested in someone with a solution to this problem.

View 20 Replies View Related

MS Access ODBC Call Failed

Nov 14, 2007

I am having an issue that i can't seem to resolve. By no means am I an expert with odbc connections and what not but any help would be great.

here is my issue. I have a 64 Bit terminal server that is running MS Access. I have defined my DSN within the 32 bit admin utility and it connects without a problem As soon as i try to link tables and make a connection to the database from within Access i recieve an "ODBC CALL FAILED" message.

I enabled tracing and here is what i got.....this doesn't mean anything to me but hopefully it does to someone.....


PaintJobShip_Ma 1388-ecc ENTER SQLAllocEnv
HENV * 002DB3C4

PaintJobShip_Ma 1388-ecc EXIT SQLAllocEnv with return code 0 (SQL_SUCCESS)
HENV * 0x002DB3C4 ( 0x07f42538)

PaintJobShip_Ma 1388-ecc ENTER SQLAllocConnect
HENV 07F42538
HDBC * 002DB4D4

PaintJobShip_Ma 1388-ecc EXIT SQLAllocConnect with return code 0 (SQL_SUCCESS)
HENV 07F42538
HDBC * 0x002DB4D4 ( 0x07f425e0)

PaintJobShip_Ma 1388-ecc ENTER SQLSetConnectOption
HDBC 07F425E0
SQLINTEGER 103 <SQL_LOGIN_TIMEOUT>
SQLPOINTER 0x00000014

PaintJobShip_Ma 1388-ecc EXIT SQLSetConnectOption with return code 0 (SQL_SUCCESS)
HDBC 07F425E0
SQLINTEGER 103 <SQL_LOGIN_TIMEOUT>
SQLPOINTER 0x00000014 (BADMEM)

PaintJobShip_Ma 1388-ecc ENTER SQLSetConnectAttrW
SQLHDBC 07F425E0
SQLINTEGER 30002 <unknown>
SQLPOINTER [Unknown attribute 30002]
SQLINTEGER -3

PaintJobShip_Ma 1388-ecc EXIT SQLSetConnectAttrW with return code 0 (SQL_SUCCESS)
SQLHDBC 07F425E0
SQLINTEGER 30002 <unknown>
SQLPOINTER [Unknown attribute 30002]
SQLINTEGER -3

PaintJobShip_Ma 1388-ecc ENTER SQLDriverConnectW
HDBC 07F425E0
HWND 000800D4
WCHAR * 0x4BF78088 [ -3] "****** 0"
SWORD -3
WCHAR * 0x4BF78088
SWORD 2
SWORD * 0x00000000
UWORD 1 <SQL_DRIVER_COMPLETE>

PaintJobShip_Ma 1388-ecc EXIT SQLDriverConnectW with return code -1 (SQL_ERROR)
HDBC 07F425E0
HWND 000800D4
WCHAR * 0x4BF78088 [ -3] "****** 0"
SWORD -3
WCHAR * 0x4BF78088
SWORD 2
SWORD * 0x00000000
UWORD 1 <SQL_DRIVER_COMPLETE>

DIAG [S1000] [Oracle][ODBC][Ora]ORA-06413: Connection not open.
(6413)

DIAG [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed (0)

DIAG [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed (0)

PaintJobShip_Ma 1388-ecc ENTER SQLErrorW
HENV 07F42538
HDBC 07F425E0
HSTMT 00000000
WCHAR * 0x002DB390 (NYI)
SDWORD * 0x002DB3DC
WCHAR * 0x036A4458
SWORD 4095
SWORD * 0x002DB3C8

PaintJobShip_Ma 1388-ecc EXIT SQLErrorW with return code 0 (SQL_SUCCESS)
HENV 07F42538
HDBC 07F425E0
HSTMT 00000000
WCHAR * 0x002DB390 (NYI)
SDWORD * 0x002DB3DC (6413)
WCHAR * 0x036A4458 [ 102] "[Oracle][ODBC][Ora]ORA-06413: Connection not open. a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"
SWORD 4095
SWORD * 0x002DB3C8 (102)

PaintJobShip_Ma 1388-ecc ENTER SQLErrorW
HENV 07F42538
HDBC 07F425E0
HSTMT 00000000
WCHAR * 0x002DB390 (NYI)
SDWORD * 0x002DB3DC
WCHAR * 0x036A44D6
SWORD 4032
SWORD * 0x002DB3C8

PaintJobShip_Ma 1388-ecc EXIT SQLErrorW with return code 0 (SQL_SUCCESS)
HENV 07F42538
HDBC 07F425E0
HSTMT 00000000
WCHAR * 0x002DB390 (NYI)
SDWORD * 0x002DB3DC (0)
WCHAR * 0x036A44D6 [ 66] "[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed"
SWORD 4032
SWORD * 0x002DB3C8 (66)

PaintJobShip_Ma 1388-ecc ENTER SQLErrorW
HENV 07F42538
HDBC 07F425E0
HSTMT 00000000
WCHAR * 0x002DB390 (NYI)
SDWORD * 0x002DB3DC
WCHAR * 0x036A456C
SWORD 3957
SWORD * 0x002DB3C8

PaintJobShip_Ma 1388-ecc EXIT SQLErrorW with return code 0 (SQL_SUCCESS)
HENV 07F42538
HDBC 07F425E0
HSTMT 00000000
WCHAR * 0x002DB390 (NYI)
SDWORD * 0x002DB3DC (0)
WCHAR * 0x036A456C [ 66] "[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed"
SWORD 3957
SWORD * 0x002DB3C8 (66)

PaintJobShip_Ma 1388-ecc ENTER SQLErrorW
HENV 07F42538
HDBC 07F425E0
HSTMT 00000000
WCHAR * 0x002DB390 (NYI)
SDWORD * 0x002DB3DC
WCHAR * 0x036A4602
SWORD 3882
SWORD * 0x002DB3C8

PaintJobShip_Ma 1388-ecc EXIT SQLErrorW with return code 100 (SQL_NO_DATA_FOUND)
HENV 07F42538
HDBC 07F425E0
HSTMT 00000000
WCHAR * 0x002DB390 (NYI)
SDWORD * 0x002DB3DC
WCHAR * 0x036A4602
SWORD 3882
SWORD * 0x002DB3C8

PaintJobShip_Ma 1388-ecc ENTER SQLFreeConnect
HDBC 07F425E0

PaintJobShip_Ma 1388-ecc EXIT SQLFreeConnect with return code 0 (SQL_SUCCESS)
HDBC 07F425E0


any help would be great....thanks.

View 3 Replies View Related

ODBC Call Failed, How To Trap Error?

Feb 9, 2006

Hi All,

I have a database with primary and Unique key contraints on SQL Server 2000. I'm front ending it with Access 2k.

I want to trap the error when the Unique key constraint is hit, but i can't capture the error number. All attempts return error 0.

The error i get is
[Microsoft][ODBC SQL Server Driver][SQL Server]Violation of UNIQUE KEY constraint 'IX_lut_Referral_Source'. Cannot insert duplicate key in object 'lut_Referral_Source'. (#2627)[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated. (#3621)

I've tried the soultion given here http://support.microsoft.com/kb/q185384 but now get a Type mismatch error on errStored

SaveRecODBCErr:
' The function failed because of an ODBC error.
' Below are a list of some of the known error numbers.
' If you are not receiving an error in this list,
' add that error to the Select Case statement.
For Each errStored In DBEngine.Errors

Thanks for your help

View 1 Replies View Related

ODBC--Call Failed - Collation Conflict

Mar 21, 2007

Hi Everyone,

I am fairly new to MS-SQL so excuse my ignorance if I have any.

I am trying to add and link a new table to an existing database. I can add the database and colums and add some data into it, and even run a query on it. However, if I try to run a query using the new table and and existing table (linked) I get the following error:

ODBC--call failed.
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot resolve collation conflict for equal to operation. (#446)

Any ideas?

my Server and SQL specs: SBS2003 & MSSQL ver 8.0

View 6 Replies View Related

ODBC Call Fail/Record Locked

May 3, 2004

I have recently moved some native Access tables to SQL Server 7. These tables are updated in code. When the update is done via a SQL statement, I get
"This record is being modified by another user. . . Save, Copy to Clipboard, Drop Changes"

When the record is being updated via DAO code, I get,
"ODBC Call Fail"

Both errors are most irritating and I desperately need to find a way around this. Any suggestions would be greatly appreciated.

Crystal

View 1 Replies View Related

ODBC Called Failed During SQL Insert Into Call

May 1, 2008

Hi

Wrote this snipet of code to use Insert Into. I have an ODBC connection to Oracle with the Tables linked. I can edit, add write querries and do everything I need to do except do an Insert Into. So I am thinking it is my code and seeking guidance.

I select add data from a button on the form. It then calls the code below. I know it is making it up to the db.execute statement and failing at that point. Funny thing is I only get the error "ODBC Call Failed" and no other snippets of information. On top of that I can not relink to the tables as they are now unaccessible and I have to completely close down the program and restart. Any help/assistance will be greatly appreciated. Thank you, Here is the code:

Code Start:

Private Sub btn_add_rca_record_Click()
On Error GoTo Err_btn_add_rca_record_Click
Dim db As Database
Dim rsCust As Recordset
Dim strSQL As String
Dim nbrRcaTicketId As Long

Set db = CurrentDb

nbrRcaTicketId = (100 + (DCount("*", "RCA_TABLE")))

strSQL = "Select * from RCA_TABLE "
Set rsCust = db.OpenRecordset(strSQL, DB_OPEN_DYNASET)
MsgBox "start of sql string"
strSQL = "INSERT INTO RCA_TABLE "
strSQL = strSQL & "( RCA_TICKET_ID, REPORT_AUTHOR_STAFF_ID, REPORT_START_DATE, REPORT_CLOSE_DATE, REPORTS_PARTICIPANTS_REVIEW, "
strSQL = strSQL & " INCIDENT_TICKET_NUMBER,INCIDENT_SEVERITY_LEVEL,INCIDENT_START_DATE_EVENT,INCIDENT_START_TIME_EVENT,INCIDENT_TIME_SERVICE_DOWN,INCIDENT_END_DATE_EVENT,INCIDENT_TIME_SERVICE_UP,INCIDENT_TIME_UP_TO_CUSTOMER,INCIDENT_OUTAGE_DURATION,INCIDENT_DETECTION_METHOD,INCIDENT_DISCOVERED_BY,INCIDENT_RESP_GROUP,INCIDENT_OWNER,INCIDENT_PRODUCTS_AFFECTED,INCIDENT_CUSTOMERS_AFFECTED, "
strSQL = strSQL & " CHANGE_EXTENT_AFFECTED, CHANGE_CAUSED_BY_CHANGE, CHANGE_RFC_NUMBER, CHANGE_BACK_OUT_INITIATED, CHANGE_RFC_FOLLOWUP_NUMBER, "
strSQL = strSQL & " PROBLEM_OWNER, PROBLEM_CATEGORY, PROBLEM_STATUS, PROBLEM_IMPACT, PROBLEM_URGENCY, "
strSQL = strSQL & " INCIDENT_SECONDARY_TICKET_NBR,INCIDENT_EVENT_DESCRIPTION,PROBLEM_DETAILS,DISCUSSION_DONE_RIGHT,DISCUSSION_PROCEDURAL_ISSUE,DISCUSSION_BETTER_NEXT_TIME,DISCUSSION_PREVENT_PROBLEM,PROBLEM_WWORKAROUND )"
strSQL = strSQL & " ALT_TICKET1,ALT_SYSTEM1,ALT_STATUS1,ALT_DATE_OPENED1,ALT_DATE_CLOSED1,ALT_SEVERITY_LEVEL1,ALT_PRIMARYOWNER1,ALT_LINK1,ALT_TICKET2, "
strSQL = strSQL & " ALT_SYSTEM2,ALT_STATUS2,ALT_DATE_OPENED2,ALT_DATE_CLOSED2,ALT_SEVERITY_LEVEL2,ALT_PRIMARYOWNER2,ALT_LINK2 )"
strSQL = strSQL & " values ('"
strSQL = strSQL & nbrRcaTicketId & "','"
strSQL = strSQL & Me!nbr_REPORT_AUTHOR_STAFF_ID & "','"
strSQL = strSQL & Me!dte_Report_Start_Date & "','"
strSQL = strSQL & Me!dte_Report_Close_date & "','"
strSQL = strSQL & Me!str_Report_Paticipants_In_Review & "','"
strSQL = strSQL & Me!nbr_Incident_Ticket_Number & "','"
strSQL = strSQL & Me!nbr_Incident_Severity_Level & "','"
strSQL = strSQL & Me!dte_Incident_Start_date & "','"
strSQL = strSQL & Me!dte_Incident_Start_Time_Event & "','"
strSQL = strSQL & Me!dte_Incident_Time_Service_Down & "','"
strSQL = strSQL & Me!dte_Incident_End_date & "','"
strSQL = strSQL & Me!dte_Incident_Time_Service_Up & "','"
strSQL = strSQL & Me!dte_Incident_Time_Up_To_Customer & "','"
strSQL = strSQL & Me!nbr_Incident_Outage_Duration & "','"
strSQL = strSQL & Me!nbr_Incident_Detection_Method & "','"
strSQL = strSQL & Me!nbr_Incident_Discovered_By & "','"
strSQL = strSQL & Me!nbr_Incident_Resp_Group & "','"
strSQL = strSQL & Me!str_Incident_Owner & "','"
strSQL = strSQL & Me!str_Incident_Products_Affected & "','"
strSQL = strSQL & Me!str_Incident_Customers_Affected & "','"
strSQL = strSQL & Me!str_Change_Extent_Affected & "','"
strSQL = strSQL & Me!str_Change_Caused_by_Change & "','"
strSQL = strSQL & Me!nbr_Change_RFC_Number & "','"
strSQL = strSQL & Me!str_Change_Back_out_Initiated & "','"
strSQL = strSQL & Me!nbr_Change_RFC_Followup_Number & "','"
strSQL = strSQL & Me!nbr_Problem_Owner & "','"
strSQL = strSQL & Me!nbr_Problem_Category & "','"
strSQL = strSQL & Me!nbr_Problem_Status & "','"
strSQL = strSQL & Me!nbr_Problem_Impact & "','"
strSQL = strSQL & Me!nbr_Problem_Urgency & "','"
strSQL = strSQL & Me!nbr_Incident_Secondary_Ticket_Numbers & "','"
strSQL = strSQL & Me!str_Incident_Event_Description & "','"
strSQL = strSQL & Me!str_Problem_Details & "','"
strSQL = strSQL & Me!str_Discussion_Done_Right & "','"
strSQL = strSQL & Me!str_Discussion_Procedural_Issue & "','"
strSQL = strSQL & Me!str_Discussion_Better_Next_Time & "','"
strSQL = strSQL & Me!str_Discussion_Prevent_Problem & "','"
strSQL = strSQL & Me!str_Problem_WWorkaround & "','"
strSQL = strSQL & Me!nbr_ALT_TICKET1 & "','"
strSQL = strSQL & Me!nbr_ALT_SYSTEM1 & "','"
strSQL = strSQL & Me!nbr_ALT_STATUS1 & "','"
strSQL = strSQL & Me!dte_ALT_DATE_OPENED1 & "','"
strSQL = strSQL & Me!dte_ALT_DATE_CLOSED1 & "','"
strSQL = strSQL & Me!nbr_ALT_SEVERITY_LEVEL1 & "','"
strSQL = strSQL & Me!nbr_ALT_PRIMARYOWNER1 & "','"
strSQL = strSQL & Me!str_ALT_LINK1 & "','"
strSQL = strSQL & Me!nbr_ALT_TICKET2 & "','"
strSQL = strSQL & Me!nbr_ALT_SYSTEM2 & "','"
strSQL = strSQL & Me!nbr_ALT_STATUS2 & "','"
strSQL = strSQL & Me!dte_ALT_DATE_OPENED2 & "','"
strSQL = strSQL & Me!dte_ALT_DATE_CLOSED2 & "','"
strSQL = strSQL & Me!nbr_ALT_SEVERITY_LEVEL2 & "','"
strSQL = strSQL & Me!nbr_ALT_PRIMARYOWNER2 & "','"
strSQL = strSQL & Me!str_ALT_LINK2 & "');"


db.Execute strSQL

MsgBox nbrRcaTicketId & " has been added to the Customer table."

Call ClearControls

rsCust.Close
db.Close

Exit_btn_add_rca_record_Click:
Exit Sub
Err_btn_add_rca_record_Click:
MsgBox Error$
rsCust.Close
db.Close
GoTo Exit_btn_add_rca_record_Click:

End Sub

Code End:

View 1 Replies View Related

ODBC Stored Procedure Call Rolls Back

Apr 18, 2008

Hi,

I have a ms access application with a button. Clicking this button runs a sql server 2000 stored procedure. The stored procedure updates product information. When I click the button it updates the products fine. When the users (with lesser permissions than me) click the button, no error message is sent but the transactions are rolled back. Does anyone know why or how this could happen? Please let me know before I pull out the last strands of hair from my head.

Thank you,
Anand

View 4 Replies View Related

ODBC Trusted_Connection Call To SQLGetInfo Returns DBO As User Name, Not NT User

Sep 26, 2004

Hello, all:
I am connecting to SQL Server 2000 with a trusted connection, and that is working fine. I then am issuing a SQLGetInfo call to find out the SQL_USER_NAME, which is always returning dbo instead of (my) Windows NT login name, which I expect to see. THe authentication is (apparently) confirmed by the SQL Server session monitor where it shows the right Windows NT user name logged in, over ODBC. With a standard SQL Login, untrusted, I definitely get the right user name back, not dbo.

So:

Login Type / user id /returned value from SQLGetInfo

Windows Authentication / Windows login / dbo
SQL Authentication / Windows login (UID) / UID

The problem is that I am trying to confirm that the userid entered in a dialog or passed on the command line to my application matches the actual connected user name inside SQL Server....


My questions:
Is there some pathology in Trusted_Connections that masks the Windows/NT login name and always returns UID 'dbo' from a call to SQLGetInfo? Is there a MSS (public) stored procedure that can robustly give back the logged in user name so I can bypass the SQLGetInfo call?

View 2 Replies View Related

I Just Want One Entry For Each Call, With SLA Status 'Breach' If Any Of The Stages For The Call Were Out Of SLA.

Mar 19, 2008

Hi,

I am producing a php report using SQL queries to show the SLA status of our calls. Each call has response, fix & completion targets. If any of these targets are breached, the whole SLA status is set as 'Breach'.

The results table should look like the one below:





CallRef.

Description

Severity



ProblemRef

Logged
Date

Call
Status

SLA Status



C0001

Approval for PO€™s not received

2



DGE0014

05-01-06 14:48

Resolved

Breach


C0002

PO€™s not published

2



DGE0014

06-01-06 10:21

Resolved

OK


C0003

Approval for PO€™s not received from Siebel.

2



n/a

05-01-06 14:48

Investigating

OK



















Whereas I can pick the results for the first 6 columns from my Select query, the 'SLA Status' column requires the following calculation:

if (due_date < completed_date)
{ sla_status = 'OK';
}
else sla_status = 'Breach';

The Select statement in my query is looking like this...

Select Distinct CallRef, Description, Severity, ProblemRef, Logdate, Status, Due_date, Completed_date;

The problem is that my query is returning multiple entries for each stage of the call (see below), whereas I just want one entry for each call, with SLA status 'Breach' if any of the stages for the call were out of SLA.






CallRef.

Description

Severity



ProblemRef

Logged
Date

Call
Status

SLA Status



C0001

Approval for PO€™s not received

2



DGE0014

05-01-06 14:48

Resolved

Breach


C0001

Approval for PO€™s not received

2



DGE0014

05-01-06 14:48

Resolved

OK


C0001

Approval for PO€™s not received

2



DGE0014

05-01-06 14:48

Resolved

Breach



















Any help will be much much appreciated, this issue has been bothering me for some time now!!!




View 7 Replies View Related

SQL Server 2005: CLR Functions Vs SQL Functions

May 26, 2006

I was playing around with the new SQL 2005 CLR functionality andremembered this discussion that I had with Erland Sommarskog concerningperformance of scalar UDFs some time ago (See "Calling sp_oa* infunction" in this newsgroup). In that discussion, Erland made thefollowing comment about UDFs in SQL 2005:[color=blue][color=green]>>The good news is that in SQL 2005, Microsoft has addressed several of[/color][/color]these issues, and the cost of a UDF is not as severe there. In fact fora complex expression, a UDF in written a CLR language may be fasterthanthe corresponding expression using built-in T-SQL functions.<<I thought the I would put this to the test using some of the same SQLas before, but adding a simple scalar CLR UDF into the mix. The testinvolved querying a simple table with about 300,000 rows. Thescenarios are as follows:(A) Use a simple CASE function to calculate a column(B) Use a simple CASE function to calculate a column and as a criterionin the WHERE clause(C) Use a scalar UDF to calculate a column(D) Use a scalar UDF to calculate a column and as a criterion in theWHERE clause(E) Use a scalar CLR UDF to calculate a column(F) Use a scalar CLR UDF to calculate a column and as a criterion inthe WHERE clauseA sample of the results is as follows (time in milliseconds):(295310 row(s) affected)A: 1563(150003 row(s) affected)B: 906(295310 row(s) affected)C: 2703(150003 row(s) affected)D: 2533(295310 row(s) affected)E: 2060(150003 row(s) affected)F: 2190The scalar CLR UDF function was significantly faster than the classicscalar UDF, even for this very simple function. Perhaps a more complexfunction would have shown even a greater difference. Based on this, Imust conclude that Erland was right. Of course, it's still faster tostick with basic built-in functions like CASE.In another test, I decided to run some queries to compare built-inaggregates vs. a couple of simple CLR aggregates as follows:(G) Calculate averages by group using the built-in AVG aggregate(H) Calculate averages by group using a CLR aggregate that similatesthe built-in AVG aggregate(I) Calculate a "trimmed" average by group (average excluding highestand lowest values) using built-in aggregates(J) Calculate a "trimmed" average by group using a CLR aggregatespecially designed for this purposeA sample of the results is as follows (time in milliseconds):(59 row(s) affected)G: 313(59 row(s) affected)H: 890(59 row(s) affected)I: 216(59 row(s) affected)J: 846It seems that the CLR aggregates came with a significant performancepenalty over the built-in aggregates. Perhaps they would pay off if Iwere attempting a very complex type of aggregation. However, at thispoint I'm going to shy away from using these unless I can't find a wayto do the calculation with standard SQL.In a way, I'm happy that basic SQL still seems to be the fastest way toget things done. With the addition of the new CLR functionality, Isuspect that MS may be giving us developers enough rope to comfortablyhang ourselves if we're not careful.Bill E.Hollywood, FL------------------------------------------------------------------------- table TestAssignment, about 300,000 rowsCREATE TABLE [dbo].[TestAssignment]([TestAssignmentID] [int] NOT NULL,[ProductID] [int] NULL,[PercentPassed] [int] NULL,CONSTRAINT [PK_TestAssignment] PRIMARY KEY CLUSTERED([TestAssignmentID] ASC)--Scalar UDF in SQLCREATE FUNCTION [dbo].[fnIsEven](@intValue int)RETURNS bitASBEGINDeclare @bitReturnValue bitIf @intValue % 2 = 0Set @bitReturnValue=1ElseSet @bitReturnValue=0RETURN @bitReturnValueEND--Scalar CLR UDF/*using System;using System.Data;using System.Data.SqlClient;using System.Data.SqlTypes;using Microsoft.SqlServer.Server;public partial class UserDefinedFunctions{[Microsoft.SqlServer.Server.SqlFunction(IsDetermini stic=true,IsPrecise=true)]public static SqlBoolean IsEven(SqlInt32 value){if(value % 2 == 0){return true;}else{return false;}}};*/--Test #1--Scenario A - Query with calculated column--SELECT TestAssignmentID,CASE WHEN TestAssignmentID % 2=0 THEN 1 ELSE 0 END ASCalcColumnFROM TestAssignment--Scenario B - Query with calculated column as criterion--SELECT TestAssignmentID,CASE WHEN TestAssignmentID % 2=0 THEN 1 ELSE 0 END ASCalcColumnFROM TestAssignmentWHERE CASE WHEN TestAssignmentID % 2=0 THEN 1 ELSE 0 END=1--Scenario C - Query using scalar UDF--SELECT TestAssignmentID,dbo.fnIsEven(TestAssignmentID) AS CalcColumnFROM TestAssignment--Scenario D - Query using scalar UDF as crierion--SELECT TestAssignmentID,dbo.fnIsEven(TestAssignmentID) AS CalcColumnFROM TestAssignmentWHERE dbo.fnIsEven(TestAssignmentID)=1--Scenario E - Query using CLR scalar UDF--SELECT TestAssignmentID,dbo.fnIsEven_CLR(TestAssignmentID) AS CalcColumnFROM TestAssignment--Scenario F - Query using CLR scalar UDF as crierion--SELECT TestAssignmentID,dbo.fnIsEven_CLR(TestAssignmentID) AS CalcColumnFROM TestAssignmentWHERE dbo.fnIsEven(TestAssignmentID)=1--CLR Aggregate functions/*using System;using System.Data;using System.Data.SqlClient;using System.Data.SqlTypes;using Microsoft.SqlServer.Server;[Serializable][Microsoft.SqlServer.Server.SqlUserDefinedAggregate (Format.Native)]public struct Avg{public void Init(){this.numValues = 0;this.totalValue = 0;}public void Accumulate(SqlDouble Value){if (!Value.IsNull){this.numValues++;this.totalValue += Value;}}public void Merge(Avg Group){if (Group.numValues > 0){this.numValues += Group.numValues;this.totalValue += Group.totalValue;}}public SqlDouble Terminate(){if (numValues == 0){return SqlDouble.Null;}else{return (this.totalValue / this.numValues);}}// private accumulatorsprivate int numValues;private SqlDouble totalValue;}[Serializable][Microsoft.SqlServer.Server.SqlUserDefinedAggregate (Format.Native)]public struct TrimmedAvg{public void Init(){this.numValues = 0;this.totalValue = 0;this.minValue = SqlDouble.MaxValue;this.maxValue = SqlDouble.MinValue;}public void Accumulate(SqlDouble Value){if (!Value.IsNull){this.numValues++;this.totalValue += Value;if (Value < this.minValue)this.minValue = Value;if (Value > this.maxValue)this.maxValue = Value;}}public void Merge(TrimmedAvg Group){if (Group.numValues > 0){this.numValues += Group.numValues;this.totalValue += Group.totalValue;if (Group.minValue < this.minValue)this.minValue = Group.minValue;if (Group.maxValue > this.maxValue)this.maxValue = Group.maxValue;}}public SqlDouble Terminate(){if (this.numValues < 3)return SqlDouble.Null;else{this.numValues -= 2;this.totalValue -= this.minValue;this.totalValue -= this.maxValue;return (this.totalValue / this.numValues);}}// private accumulatorsprivate int numValues;private SqlDouble totalValue;private SqlDouble minValue;private SqlDouble maxValue;}*/--Test #2--Scenario G - Average Query using built-in aggregate--SELECT ProductID, Avg(Cast(PercentPassed AS float))FROM TestAssignmentGROUP BY ProductIDORDER BY ProductID--Scenario H - Average Query using CLR aggregate--SELECT ProductID, dbo.Avg_CLR(Cast(PercentPassed AS float)) AS AverageFROM TestAssignmentGROUP BY ProductIDORDER BY ProductID--Scenario I - Trimmed Average Query using built in aggregates/setoperations--SELECT A.ProductID,CaseWhen B.CountValues<3 Then NullElse Cast(A.Total-B.MaxValue-B.MinValue ASfloat)/Cast(B.CountValues-2 As float)End AS AverageFROM(SELECT ProductID, Sum(PercentPassed) AS TotalFROM TestAssignmentGROUP BY ProductID) ALEFT JOIN(SELECT ProductID,Max(PercentPassed) AS MaxValue,Min(PercentPassed) AS MinValue,Count(*) AS CountValuesFROM TestAssignmentWHERE PercentPassed Is Not NullGROUP BY ProductID) BON A.ProductID=B.ProductIDORDER BY A.ProductID--Scenario J - Trimmed Average Query using CLR aggregate--SELECT ProductID, dbo.TrimmedAvg_CLR(Cast(PercentPassed AS real)) ASAverageFROM TestAssignmentGROUP BY ProductIDORDER BY ProductID

View 9 Replies View Related

Integration Services :: Unable To See 64bit ODBC Driver From SSIS Odbc Connection?

Jun 1, 2015

I am using SSIS 2014 with the below .net framework version and installed in Windows server 2012 R2 . I have installed my client's odbc drivers (both 32 bit and 64 bit) in my production server and created ODBC system DSNs for 32 bit and 64 bit.

When i open SSIS 2014 and tried to create the odbc connection but i can able to see only the 32 bit system DSN connection ,i can't able to see my 64 bit odbc system dsn connection.

Microsoft Visual Studio 2012 Shell (Integrated)
Version 11.0.50727.1 RTMREL
Microsoft .NET Framework
Version 4.5.51650

SQL Server Integration Services   
Microsoft SQL Server Integration Services Designer
Version 12.0.1524.0

And i installed my client odbc drivers(32,64 bit) and created ODBC system DSNs in my local system and when i open ssis 2014 and i can able to see both the ODBC system DSNS(32,64) connections from SSIS ODBC connection.

I am using below version of .net framework in my local system which was installed in windows 7 and i have SSIS 2012 also installed in my system and i can able to see both ODBC connections using 2012 as well in my local system.

Microsoft Visual Studio 2012 Shell (Integrated)
Version 11.0.50727.1 RTMREL
Microsoft .NET Framework
Version 4.5.50938

SQL Server Integration Services   
Microsoft SQL Server Integration Services Designer
Version 12.0.1524.0

why i can not see the ODBC 64 bit system DSN connection from SSIS in my production server ?

View 9 Replies View Related

How Can I Use Create Or Alter Statements With ODBC And Microsoft Access ODBC Driver (*mdb)?

May 13, 2007



Hi,



I am using VB.NET 2005 and set up an ODBC connection via ODBC.ODBCConnection to a MDB database. Therefor, I use the "Microsoft Access ODBC Driver (*.mdb)".



When I set up a ODBCCommand like "ALTER DATABASE..." or "CREATE TABLE..." and issue it with the com.ExecuteNonQuery() command, I get an error from ODBC driver, that a SQL statement has to begin with SELECT, INSERT, UPDATE or DELETE.



How can I use DDL statements via ODBC?



I would appreciate if you could help me to use ODBC for that - no OLE, no ADO.



Thanks for help!



Regards,

Stefan D.

View 14 Replies View Related

Can't Find SQL Native Client In ODBC Connection Manager In SQL Server Open Database Connectivity (ODBC)

Feb 13, 2007

I apologize if this is not the correct forum for this posting. Looking at the descriptions, it appeared to be the best choice.

I am running Windows XP Pro SP2. I have installed the SQL Native Client for
XP. However, when I try to add a new data source through ODBC Connection
Manager, SQL Native Client is not listed as an option. I have followed this procedure on three other systems with no problems. What would be causing the
SQL Native Client to not show up in the list of available ODBC data sources?

View 4 Replies View Related

MS OLE DB For ODBC With Oracle ODBC Source Headaches

Dec 25, 2005

Hi all,I am having trouble getting linked Oracle 9 server in MS SQL Server2005 Express to work properly. My machine is running Windows XP.The Microsoft and Oracle OLE DB Providers have problems dealing withOracle's Numeric Data Type, so I decided to use Microsoft's OLE DB forODBC Provider and an Oracle ODBC source. When using the Microsoft ODBCfor Oracle Driver in my ODBC source I have inconsistent behavior.Sometimes my queries are processed properly, then other times I get thefollowing errorOLE DB provider "MSDASQL" for linked server "ODBCBEAST" returnedmessage "[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttrfailed".OLE DB provider "MSDASQL" for linked server "ODBCBEAST" returnedmessage "[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttrfailed".OLE DB provider "MSDASQL" for linked server "ODBCBEAST" returnedmessage "[Microsoft][ODBC driver for Oracle][Oracle]".Msg 7303, Level 16, State 1, Line 1Cannot initialize the data source object of OLE DB provider "MSDASQL"for linked server "ODBCBEAST".I have no idea why sometimes I can connect to the linked server with noproblems andwhy other times it performs like this. I'm not changing anything aboutthe system I can think of. When I use an Oracle client (PL/SQL) I haveabsolutely no problems connecting. TNSPING returns that the connectionis good.This is unacceptable so I decided to try my luck with the Oracle 10gODBC driver. However when I use this and perform an openquery selectagainst the linked server I get back only 11 rows, when I know that thedatabase has over 100 rows (in fact when using the Microsoft ODBCdriver and it works that's what I get). I figured maybe the buffersetting needed to be raised in the ODBC configuration so I took it from64000 to 600000 (a magnitude of 10) but I still get back only 11 rows.I'm at my wit's end.Any suggestions on resolving one or the other problem would be muchappreciated.Thanks much

View 2 Replies View Related

Compatible Versions Of Ms SQL Server, ODBC Driver, Driver Manager And ODBC API Spec

Oct 28, 2004

Hi,

Please help share with me if you know the version compatibility matrix of Ms SQL Server, ODBC driver (sqlsrv32.dll), Driver Manager (odbc32.dll) and ODBC API spec. For instance, how can I know Ms SQL Server 2000 can work with which version of sqlsrv32.dll, a particular version of sqlsrv32.dll can work with which version of odbc32.dll and a certain version of sqlsrv32.dll/odbc32.dll conforms to which version of ODBC API spec (e.g. 3.5).

Any help will be appreciated.

Thanks,

vtluu.

View 1 Replies View Related

Microsoft.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]

Dec 10, 2003

Hi Everybody,


On localhost this application works fine but when I put on remote server. I am getting following errors. For both localhost and server, I am using same remote sql 2000. I will appreciate any help.

Thanks,

Arif



Server Error in '/' Application.
--------------------------------------------------------------------------------

ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ')'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Microsoft.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ')'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[OdbcException: ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ')'.]
Microsoft.Data.Odbc.OdbcConnection.HandleError(IntPtr hHandle, SQL_HANDLE hType, RETCODE retcode) +27
Microsoft.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method) +838
Microsoft.Data.Odbc.OdbcCommand.ExecuteNonQuery() +80
Calgary.venues.Page_Load(Object sender, EventArgs e) in c:inetpubwwwrootCalgarySitevenuesvenues.aspx.vb:32
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

View 5 Replies View Related

SPs, Functions And

Feb 22, 2007

Guys I need help with sql server 2005 syntax
My goal is up update a table called UserStats.
I have numerous functions in SQL that return Scalars (one for each statistics I want to use)
How do I then use a stored proceedure to return a table of the values for use on my site?

View 1 Replies View Related

Functions?

Mar 25, 2006

WIthin SQL Server 2005, there are functions.  This feature is new to me and I haven't found anyone that has written their own fucntions?  I'm wondering if functions are written the same as stored procedures, and can a function be called from a stored procedure or even from within a query.
 

View 2 Replies View Related

First/Last Functions In SQL?

Mar 12, 2007

hello Im having a difficult time translating this query from Access to SQL because it uses the First/Last functions.

I have a 'Projects' Table and a 'Project_Comments' table, each has a 'Project_ID' field which links the 2 together. What I need to do is retrieve a Project List from the Projects Table and also the first Comment of each project based on the Commend_date field in the Project_Comments table. This is the MS ACCESS query:


SELECT Projects.Project_Number, Projects.Project_Name, First(Project Comments.Comment_Date), First(Project_Comments.Notes)
FROM Projects Left Join Projec_Comments ON
Projects.Project_Number = Project_Comments.Project_Number
GROUP BY Projects.Project_Number, Projects.Project_Name


Now I can use Min() for the Date instead of First, however I dont know what to do with the Notes field. Any help on how to get this over to sql would be greatly appreciated!

View 2 Replies View Related

Functions Help

Jun 3, 2008

Hi,

I have created a function that returns a comma seperated list of product id's from a table. I need to call this function from a stored procedure to help filter my product results, something like the following:

SET @SQL = 'SELECT dbo.Products.ProductID FROM dbo.Products WHERE dbo.Products.ProductID IN (' + dbo.GetModels('dbo.Products.ProductID', '') + '))'

The problem I am having when executing the above is:

"Conversion failed when converting the varchar value 'dbo.Products.ProductID' to data type int."

Can anyone shed some light on how I can call the function, feeding through the product ID from the row of the select statement I am trying to execute (if this makes sense).

Any help would be great.

Matt

View 4 Replies View Related

SQL Functions

Aug 25, 2005

Iam trying to convert a date string to date format.....in access I could just use CDate, but SQL apparently does not allow this.
Any help appreciated
Thanks

View 4 Replies View Related

Using Own Functions

Aug 12, 2005

Hello,how I can use a function of my own within a select statement. I triedcreate function funny() returns intas beginreturn( 2 )end goand then "select funny()" but 'funny' is not a recognized function name.How can I solve this?thanks and regardsMark

View 1 Replies View Related

Functions

Jul 20, 2005

Hi,,I'm having a problem with calling a function from an activex scriptwithin a data transformation. the function takes 6 inputs and returnsa single output. My problem is that after trying all of the stuff onBOL I still can't get it to work. It's on the same database and I'mrunning sql 2000.when I try to call it I get an error message saying "object requiredfunctionname" If I put dbo in front of it I get "object required dbo".Can anyone shed any light on how i call this function and assign theoutput value returned to a variable name.thanks.

View 7 Replies View Related

SQL Functions

Aug 10, 2007

Hello,

I've created a function that performs modulo. I understand that SQL server 2000 / 2005 uses % for modulo, but we have an application that was written for Oracle. Oracle has a mod(dividend, divisor) function.

As to not rewite the queries, I would like to implement the function below:

the function executes properly but I must prefix it with the dbo schema.

Net: I can execute --- select dbo.mod(9,2) and it returns a 1 just like it should.

but I can not execute --- select mod(9,2) I receive the error "'mod' is not a recognized function name." on SQL 2000 and 2005.


If I can execute select mod(9,2) then I won't need to re-write any queries.

Also, on SQL 2005, I have tried to adjust the default shema, and the execute as clause, but neither helped my cause.

I'm going to try building the function in the CLR, but I think I will be faced with the same problem.

Can someone point me in the right direction?

Thanks

Tom



create function mod
(
@dividend int,
@divisor int
)
RETURNS int
as
begin
declare @mod int
select @mod = @dividend % @divisor
return @mod
end


View 3 Replies View Related

Functions In Functions

Sep 24, 2007

Hi,

I have to calculate data in function with "EXEC". During runtime I get the Error:

"Only functions and extended stored procedures can be executed from within a function."

I would use a Stored Procedure, but the function is to be called from a view. I don't understand, why that should not be possible. Is there any way to shut that message down or to work around?
btw: Storing all the data in a table, would mean a lot of work, I rather not like to do. ;-)

Thx for any help
Blubb10

View 8 Replies View Related

FUNCTIONS

Jun 14, 2007

I just installed SSRS 2005 and I have experience with SQL.



How come this function does not work?



SELECT SUBSTRING(YEAR_MONTH, 1, 2) AS Expr1
FROM table1



I get a message which states that this command is not supported by the provider?



It works fine with other SQL tools like winsql?



thanks

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved