Author |
Topic |
flextera
Yak Posting Veteran
50 Posts |
Posted - 2014-09-17 : 15:13:49
|
Msg 7320, Level 16, State 2, Procedure selectlogHistory, Line 68Cannot execute the query "SELECT Tbl1001.DateTime Col1009,Tbl1001.TagName Col1010,Tbl1001.Value Col1011 FROM Runtime.dbo.AnalogHistory Tbl1001 WHERE Tbl1001.TagName=? AND Tbl1001.DateTime=? AND Tbl1001.wwRetrievalMode=N'Delta'" against OLE DB provider "INSQL" for linked server "INSQL". I get this error message when running a query. Keep in mind that this query is using linked servers in SQL. Thanks in advance |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-09-17 : 15:28:33
|
Show us the actual query and not just the error.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
flextera
Yak Posting Veteran
50 Posts |
Posted - 2014-09-17 : 15:49:16
|
I'm not looking for a fix in my query code. I am looking for information regarding this certain error. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-09-17 : 16:07:47
|
My point is that we need to see the query in order to help you with the error.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
flextera
Yak Posting Veteran
50 Posts |
Posted - 2014-09-17 : 16:50:47
|
Here is my stored procedure |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-09-17 : 16:56:30
|
I don't see INSQL anywhere in that stored procedure.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
flextera
Yak Posting Veteran
50 Posts |
Posted - 2014-09-17 : 16:59:32
|
Exactly why this is so confusing... |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2014-09-17 : 17:12:57
|
quote: Originally posted by flextera Msg 7320, Level 16, State 2, Procedure selectlogHistory, Line 68Cannot execute the query "SELECT Tbl1001.DateTime Col1009,Tbl1001.TagName Col1010,Tbl1001.Value Col1011 FROM Runtime.dbo.AnalogHistory Tbl1001 WHERE Tbl1001.TagName=? AND Tbl1001.DateTime=? AND Tbl1001.wwRetrievalMode=N'Delta'" against OLE DB provider "INSQL" for linked server "INSQL". I get this error message when running a query. Keep in mind that this query is using linked servers in SQL. Thanks in advance
Are there two stored procedures in play here? The error message is coming from line 68 of stored proc named selectlogHistory, and the code you have posted is for the stored procedure selectAnalogHistory (And which you deleted now :) |
|
|
flextera
Yak Posting Veteran
50 Posts |
Posted - 2014-09-17 : 17:17:16
|
No. There are definitely not two stored procedures running.I deleted it because I didn't want to much ex-poser of world class stored procedures. |
|
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-09-17 : 17:38:06
|
quote: Originally posted by flextera No. There are definitely not two stored procedures running.I deleted it because I didn't want to much ex-poser of world class stored procedures.
You're kidding right? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-09-17 : 17:57:28
|
quote: Originally posted by flextera world class stored procedures.
Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
flextera
Yak Posting Veteran
50 Posts |
Posted - 2014-09-18 : 08:52:31
|
Of course I'm kidding. I deleted it on accident. All I want is information regarding "Msg 7320, Level 16, State 2" And what could be causing this error. |
|
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-09-18 : 09:24:57
|
Your query uses a three-part database identifier, "Runtime.dbo.AnalogHistory". Normally a linked server would have four parts:server.database.schema.tableIs Runtime a database? If not, what is it exactly? |
|
|
flextera
Yak Posting Veteran
50 Posts |
Posted - 2014-09-18 : 10:07:45
|
Runtime is a database. AnalogHistory is a view. Runtime is the database that I get all my tables and views from.BUT Runtime is one of the many databases in the master. |
|
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-09-18 : 10:19:43
|
fine, so your query is NOT using a linked server, is it? |
|
|
flextera
Yak Posting Veteran
50 Posts |
Posted - 2014-09-18 : 10:25:47
|
I believe it is. It's grabbing information from a linked historian. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-09-18 : 10:44:31
|
Are there any triggers on the tables involved in the stored procedure? I can't remember if I saw any DML commands in it.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
flextera
Yak Posting Veteran
50 Posts |
Posted - 2014-09-18 : 10:48:21
|
I don't believe so. |
|
|
flextera
Yak Posting Veteran
50 Posts |
Posted - 2014-09-18 : 10:51:33
|
OLE DB provider "INSQL" for linked server "INSQL" returned message "Error: parameter 2 is NULL in a parameterized SQL query.".Msg 7320, Level 16, State 2, Procedure selectAnalogHistory, Line 68Cannot execute the query "SELECT Tbl1001.DateTime Col1009,Tbl1001.TagName Col1010,Tbl1001.Value Col1011 FROM Runtime.dbo.AnalogHistory Tbl1001 WHERE Tbl1001.TagName=? AND Tbl1001.DateTime=? AND Tbl1001.wwRetrievalMode=N'Delta'" against OLE DB provider "INSQL" for linked server "INSQL". FULL ERROR MESSAGE ^ |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2014-09-18 : 11:07:18
|
Look for the stored procedure or view that uses the query indicated in the error message using:SELECT * FROM SYS.OBJECTSWHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%SELECT Tbl1001.DateTime Col1009,Tbl1001.TagName Col1010,Tbl1001.Value Col1011 FROM Runtime.dbo.AnalogHistory%' That might give you a clue. |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2014-09-18 : 11:08:32
|
quote: Originally posted by flextera Of course I'm kidding. I deleted it on accident. All I want is information regarding "Msg 7320, Level 16, State 2" And what could be causing this error.
I must admit, for a moment there, I thought you were serious!! |
|
|
Next Page
|