[LINQ, C#]No Overload For Method 'DataContext' Takes '0' Arguments Error In DataClasses.designer.cs

May 31, 2008

I have problem with LINQ. I have created SQL Server 2005 database Database.mdf in App_Data folder with two tables - Pages and PagesGroups. Table Pages consist of fields PageID, AspxForm, DescriptionEN, DescriptionPL, PagesGroupID, NavNameEN, NavNamePL, PageActive, NavToolTipEN, NavToolTipPL and table PagesGroups consist of PagesGroupID, NavGroupNameEN, NavGroupNamePL, NavGroupToolTipEN, NavGroupToolTipPL, GroupDescriptionPL, GroupDescriptionEN, GroupActive. I added example rows. I created DataClasses.dbml, where Pages is child of PagesGroups, and DataClasses.designer.cs, which cause error "No overload for method 'DataContext' takes '0' arguments", in App_Code folder. I started writing LINQ commands in master page (DataClassesDataContext db = new DataClassesDataContext(); var pages = from p in db.Pages select new { Description = p.PagesGroup.GroupDescriptionPL };).

What should I write in DataClasses.designer.cs that errors does not occur? What is wrong in my DataClasses.designer.cs?

I wrote source of DataClasses.designer.cs, MasterPage.master and error message below.

App_Code/DataClasses.designer.cs:


using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Data.Linq;

using System.Data.Linq.Mapping;

using System.Linq;

using System.Linq.Expressions;using System.Reflection;

 

 

[System.Data.Linq.Mapping.DatabaseAttribute(Name="Database")]

public partial class DataClassesDataContext : System.Data.Linq.DataContext

{

 private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();

 

 public System.Data.Linq.Table<Page> Pages

{

get

{return this.GetTable<Page>();

}

}

 public System.Data.Linq.Table<PagesGroup> PagesGroups

{

get

{return this.GetTable<PagesGroup>();

}

}

}

[Table(Name="dbo.Pages")]

public partial class Page : INotifyPropertyChanging, INotifyPropertyChanged

{



private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);



private int _PageID;



private string _AspxForm;



private string _DescriptionEN;



private string _DescriptionPL;



private int _PagesGroupID;



private string _NavNameEN;



private string _NavNamePL;



private bool _PageActive;



private string _NavToolTipEN;



private string _NavToolTipPL;



private EntityRef<PagesGroup> _PagesGroup;







public Page()

{

this._PagesGroup = default(EntityRef<PagesGroup>);

}



[Column(Storage="_PageID", AutoSync=AutoSync.Always, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]

public int PageID

{

get

{

return this._PageID;

}

set

{

if ((this._PageID != value))

{

this.SendPropertyChanging();

this._PageID = value;

this.SendPropertyChanged("PageID");

}

}

}



[Column(Storage="_AspxForm", DbType="Char(10) NOT NULL", CanBeNull=false)]

public string AspxForm

{

get

{

return this._AspxForm;

}

set

{

if ((this._AspxForm != value))

{

this.SendPropertyChanging();

this._AspxForm = value;

this.SendPropertyChanged("AspxForm");

}

}

}



[Column(Storage="_DescriptionEN", DbType="NText", UpdateCheck=UpdateCheck.Never)]

public string DescriptionEN

{

get

{

return this._DescriptionEN;

}

set

{

if ((this._DescriptionEN != value))

{

this.SendPropertyChanging();

this._DescriptionEN = value;

this.SendPropertyChanged("DescriptionEN");

}

}

}



[Column(Storage="_DescriptionPL", DbType="NText", UpdateCheck=UpdateCheck.Never)]

public string DescriptionPL

{

get

{

return this._DescriptionPL;

}

set

{

if ((this._DescriptionPL != value))

{

this.SendPropertyChanging();

this._DescriptionPL = value;

this.SendPropertyChanged("DescriptionPL");

}

}

}



[Column(Storage="_PagesGroupID", DbType="Int NOT NULL")]

public int PagesGroupID

{

get

{

return this._PagesGroupID;

}

set

{

if ((this._PagesGroupID != value))

{

if (this._PagesGroup.HasLoadedOrAssignedValue)

{

throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();

}

this.SendPropertyChanging();

this._PagesGroupID = value;

this.SendPropertyChanged("PagesGroupID");

}

}

}



[Column(Storage="_NavNameEN", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]

public string NavNameEN

{

get

{

return this._NavNameEN;

}

set

{

if ((this._NavNameEN != value))

{

this.SendPropertyChanging();

this._NavNameEN = value;

this.SendPropertyChanged("NavNameEN");

}

}

}



[Column(Storage="_NavNamePL", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]

public string NavNamePL

{

get

{

return this._NavNamePL;

}

set

{

if ((this._NavNamePL != value))

{

this.SendPropertyChanging();

this._NavNamePL = value;

this.SendPropertyChanged("NavNamePL");

}

}

}



[Column(Storage="_PageActive", DbType="Bit NOT NULL")]

public bool PageActive

{

get

{

return this._PageActive;

}

set

{

{

this.OnPageActiveChanging(value);

this.SendPropertyChanging();

this._PageActive = value;

this.SendPropertyChanged("PageActive");

}

}

}

private void OnPageActiveChanging(bool value)

{

throw new NotImplementedException();

}



[Column(Storage="_NavToolTipEN", DbType="NText", UpdateCheck=UpdateCheck.Never)]

public string NavToolTipEN

{

get

{

return this._NavToolTipEN;

}

set

{

if ((this._NavToolTipEN != value))

{

this.SendPropertyChanging();

this._NavToolTipEN = value;

this.SendPropertyChanged("NavToolTipEN");

}

}

}



[Column(Storage="_NavToolTipPL", DbType="NText", UpdateCheck=UpdateCheck.Never)]

public string NavToolTipPL

{

get

{

return this._NavToolTipPL;

}

set

{

if ((this._NavToolTipPL != value))

{

this.SendPropertyChanging();

this._NavToolTipPL = value;

this.SendPropertyChanged("NavToolTipPL");

}

}

}



[Association(Name="PagesGroup_Page", Storage="_PagesGroup", ThisKey="PagesGroupID", IsForeignKey=true)]

public PagesGroup PagesGroup

{

get

{

return this._PagesGroup.Entity;

}

set

{

PagesGroup previousValue = this._PagesGroup.Entity;

if (((previousValue != value)

|| (this._PagesGroup.HasLoadedOrAssignedValue == false)))

{

this.SendPropertyChanging();

if ((previousValue != null))

{

this._PagesGroup.Entity = null;

previousValue.Pages.Remove(this);

}

this._PagesGroup.Entity = value;

if ((value != null))

{

value.Pages.Add(this);

this._PagesGroupID = value.PagesGroupID;

}

else

{

this._PagesGroupID = default(int);

}

this.SendPropertyChanged("PagesGroup");

}

}

}



public event PropertyChangingEventHandler PropertyChanging;



public event PropertyChangedEventHandler PropertyChanged;



protected virtual void SendPropertyChanging()

{

if ((this.PropertyChanging != null))

{

this.PropertyChanging(this, emptyChangingEventArgs);

}

}



protected virtual void SendPropertyChanged(String propertyName)

{

if ((this.PropertyChanged != null))

{

this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));

}

}

}

[Table(Name="dbo.PagesGroups")]

public partial class PagesGroup : INotifyPropertyChanging, INotifyPropertyChanged

{



private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);



private int _PagesGroupID;



private string _NavGroupNameEN;



private string _NavGroupNamePL;



private string _NavGroupToolTipEN;



private string _NavGroupToolTipPL;



private string _GroupDescriptionEN;



private string _GroupDescriptionPL;



private bool _GroupActive;



private EntitySet<Page> _Pages;







public PagesGroup()

{

this._Pages = new EntitySet<Page>(new Action<Page>(this.attach_Pages), new Action<Page>(this.detach_Pages));

}



[Column(Storage="_PagesGroupID", AutoSync=AutoSync.Always, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]

public int PagesGroupID

{

get

{

return this._PagesGroupID;

}

set

{

if ((this._PagesGroupID != value))

{

this.SendPropertyChanging();

this._PagesGroupID = value;

this.SendPropertyChanged("PagesGroupID");

}

}

}



[Column(Storage="_NavGroupNameEN", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]

public string NavGroupNameEN

{

get

{

return this._NavGroupNameEN;

}

set

{

if ((this._NavGroupNameEN != value))

{

this.SendPropertyChanging();

this._NavGroupNameEN = value;

this.SendPropertyChanged("NavGroupNameEN");

}

}

}



[Column(Storage="_NavGroupNamePL", DbType="NVarChar(50) NOT NULL", CanBeNull=false)]

public string NavGroupNamePL

{

get

{

return this._NavGroupNamePL;

}

set

{

if ((this._NavGroupNamePL != value))

{

this.SendPropertyChanging();

this._NavGroupNamePL = value;

this.SendPropertyChanged("NavGroupNamePL");

}

}

}



[Column(Storage="_NavGroupToolTipEN", DbType="NText", UpdateCheck=UpdateCheck.Never)]

public string NavGroupToolTipEN

{

get

{

return this._NavGroupToolTipEN;

}

set

{

if ((this._NavGroupToolTipEN != value))

{

this.SendPropertyChanging();

this._NavGroupToolTipEN = value;

this.SendPropertyChanged("NavGroupToolTipEN");

}

}

}



[Column(Storage="_NavGroupToolTipPL", DbType="NText", UpdateCheck=UpdateCheck.Never)]

public string NavGroupToolTipPL

{

get

{

return this._NavGroupToolTipPL;

}

set

{

if ((this._NavGroupToolTipPL != value))

{

this.SendPropertyChanging();

this._NavGroupToolTipPL = value;

this.SendPropertyChanged("NavGroupToolTipPL");

}

}

}



[Column(Storage="_GroupDescriptionEN", DbType="NText", UpdateCheck=UpdateCheck.Never)]

public string GroupDescriptionEN

{

get

{

return this._GroupDescriptionEN;

}

set

{

if ((this._GroupDescriptionEN != value))

{

this.SendPropertyChanging();

this._GroupDescriptionEN = value;

this.SendPropertyChanged("GroupDescriptionEN");

}

}

}



[Column(Storage="_GroupDescriptionPL", DbType="NText", UpdateCheck=UpdateCheck.Never)]

public string GroupDescriptionPL

{

get

{

return this._GroupDescriptionPL;

}

set

{

if ((this._GroupDescriptionPL != value))

{

this.SendPropertyChanging();

this._GroupDescriptionPL = value;

this.SendPropertyChanged("GroupDescriptionPL");

}

}

}



[Column(Storage="_GroupActive", DbType="Bit NOT NULL")]

public bool GroupActive

{

get

{

return this._GroupActive;

}

set

{

if ((this._GroupActive != value))

{

this.SendPropertyChanging();

this._GroupActive = value;

this.SendPropertyChanged("GroupActive");

}

}

}



[Association(Name="PagesGroup_Page", Storage="_Pages", OtherKey="PagesGroupID")]

public EntitySet<Page> Pages

{

get

{

return this._Pages;

}

set

{

this._Pages.Assign(value);

}

}



public event PropertyChangingEventHandler PropertyChanging;



public event PropertyChangedEventHandler PropertyChanged;



protected virtual void SendPropertyChanging()

{

if ((this.PropertyChanging != null))

{

this.PropertyChanging(this, emptyChangingEventArgs);

}

}



protected virtual void SendPropertyChanged(String propertyName)

{

if ((this.PropertyChanged != null))

{

this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));

}

}



private void attach_Pages(Page entity)

{

this.SendPropertyChanging();

entity.PagesGroup = this;

}



private void detach_Pages(Page entity)

{

this.SendPropertyChanging();

entity.PagesGroup = null;

}

}

MasterPage.master:


...

using System.Data.Linq;

using System.Data.Linq.Mapping;

using System.Globalization;

using System.Linq;

using System.Linq.Expressions;


...

public partial class MasterPage : System.Web.UI.MasterPage

{public void Page_Load(object sender, EventArgs e)

{

...

DataClassesDataContext db = new DataClassesDataContext();

...

if (Page.UICulture == "Polish")

{

...var pages = from p in db.Pages

where p.PagesGroup.GroupActive == true && p.PageActive == trueselect new { PagesGroupDescription = p.PagesGroup.GroupDescriptionPL };

}

else

{var pages = from p in db.Pages

where p.PagesGroup.GroupActive == true && p.PageActive == true

select new { PagesGroupDescription = p.PagesGroup.GroupDescriptionEN };

...

}

...

}

}

Error:


Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1501: No overload for method 'DataContext' takes '0' argumentsc:UsersAdministratorDocumentsMy Web SitesKamil Szmit (szmitek)App_CodeDataClasses.designer.cs(25,22): error CS1501: No overload for method 'DataContext' takes '0' arguments
c:WindowsassemblyGAC_MSILSystem.Data.Linq3.5.0.0__b77a5c561934e089System.Data.Linq.dll: (Location of symbol related to previous error)

View 1 Replies


ADVERTISEMENT

Error Message: No Overload For Method 'sqlparameter' Takes 1 Arguments

May 19, 2008

Dear All,
 
I have a problem while trying to update the content of my page to the database by the means of a stored procedure
string OcompConnection = ConfigurationManager.ConnectionStrings["GenUserCode"].ConnectionString;
 System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(OcompConnection);
System.Data.SqlClient.SqlCommand ocmd = new System.Data.SqlClient.SqlCommand("Dealer_Insert", conn);ocmd.CommandType = CommandType.StoredProcedure;
ocmd.Parameters.Add(new SqlParameter("@UserCode"), SqlDbType.NVarChar);
ocmd.Parameters["@UserCode"] = TxtUserCode;
 
and also there is another error message saying that argument1: can not comvert from system.data.sqlclient.sqlparameter to string.
What am i Missing???
Eventually there is the try{open} and finally{close}
 
Many Thanks

View 3 Replies View Related

What Does 'No Overload For Method 'Insert' Takes '1' Arguments' Mean?

Dec 10, 2007

code that caused this error: line AddInBookSqlDataSource2.Insert(item);protected void inbookButton_Click(object sender, EventArgs e){
try{
AddInBookSqlDataSource1.Insert();
}catch (Exception ex){
uploadSPoneLabel.Text = "Saved Failed: SP One" + ex.Message;
}foreach (ListItem item in authorsListBox5.Items){
try{
AddInBookSqlDataSource2.Insert(item);
saveStatusLabel.Text = "Save Successful: SP Two";
}catch (Exception ex1){saveStatusLabel.Text = "Save Failed: SP Two" + ex1.Message;
}
}
}
any help appreciated
Thanks in advance

View 1 Replies View Related

No Overload For Method 'FillByEmployeeID' Takes '2

Oct 19, 2007

Hello, I am designing a small databse example.
The database only contains one table 'Employee'.
Only five fields: EmployeeID(primary key), firstName,lastName,phoneNumber,Salary.
Salary is an integer.
Now I drag some buttons to the form. One button is to find employee by ID, find employee by last name and find all employees inside a certain salary range.
My Table Adapter--Change the Update and Delete command to only need 1
parameter(primary key).
But I get three compiling errors.

Error1No overload for method 'FillByEmployeeID' takes '2' arguments
Error2No overload for method 'FillBylastName' takes '2' arguments
Error3No overload for method 'FillBySalary' takes '2' arguments

Here is my codes

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HUIDB
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void employeeBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.employeeBindingSource.EndEdit();
this.employeeTableAdapter.Update(this.dataSet1.Employee);

}

private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'dataSet1.Employee' table. You can move, or remove it, as needed.
this.employeeTableAdapter.Fill(this.dataSet1.Employee);

}


private void ADD_Click(object sender, EventArgs e)
{
String EmployeeID = textBox1.Text;
String firstName = textBox2.Text;
String lastName = textBox3.Text;
String phoneNumber = textBox4.Text;
int Salary = Int32.Parse(textBox5.Text);
employeeTableAdapter.Fill(this.dataSet1.Employee);
}

private void DELETE_Click(object sender, EventArgs e)
{
String EmployeeID = textBox1.Text;
if (this.employeeTableAdapter.Delete(EmployeeID) == 0)
MessageBox.Show("Deletion failed");
else
this.employeeTableAdapter.Fill(this.dataSet1.Employee);
}

private void UPDATE_Click(object sender, EventArgs e)
{
String EmployeeID = textBox1.Text;
String firstName = textBox2.Text;
String lastName = textBox3.Text;
String phoneNumber = textBox4.Text;
int Salary = Int32.Parse(textBox5.Text);
if (this.employeeTableAdapter.Update(EmployeeID, firstName, lastName, phoneNumber,Salary, EmployeeID) == 0)
MessageBox.Show("Update failed");
else
this.employeeTableAdapter.Fill(this.dataSet1.Employee);
}

private void FIND_Click(object sender, EventArgs e)
{
String EmployeeID = textBox1.Text;
String lastName = textBox3.Text;
int Salary = Int32.Parse(textBox5.Text);
this.employeeTableAdapter.FillByEmployeeID(dataSet1.Employee, EmployeeID); // wrong here
this.employeeTableAdapter.FillBylastName(dataSet1.Employee, lastName); // wrong here
this.employeeTableAdapter.FillBySalary(dataSet1.Employee, Salary); // wrong here
}

private void REFRESH_Click(object sender, EventArgs e)
{
this.employeeTableAdapter.Fill(this.dataSet1.Employee);
}
}
}

Could you please give me some advice?
Thanks!

View 1 Replies View Related

BC30516: Overload Resolution Failed Because No Accessible 'New' Accepts This Number Of Arguments Error

Feb 18, 2008

Hello, I want to get data from datatable as below. I am getting error:
BC30516: Overload resolution failed because no accessible 'New' accepts this number of arguments.  I did not understand what is wrong. Because everything is same as msdn library.
my codebehind is:
Imports System.Data
Imports System.Data.Sql
Imports System.Data.SqlClientPartial Class Default2 Inherits System.Web.UI.Page
 
Private Shared Function GetConnectionString() As String
' To avoid storing the connection string in your code,
' you can retrieve it from a configuration file.
Return "Data Source=Database;Initial Catalog=otel;Integrated Security=True;Pooling=False"
End FunctionProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadDim connectionString As String = _
GetConnectionString()
' Create a SqlConnection to the database.Using connection As SqlConnection = New SqlConnection(connectionString)
 
' Create a SqlDataAdapter for the Suppliers table.Dim mailsAdapter As SqlDataAdapter = _ New SqlDataAdapter()
' A table mapping names the DataTable.mailsAdapter.TableMappings.Add("Table", "Pages")
connection.Open()Dim PagesCommand As SqlCommand = New SqlCommand( _"SELECT * FROM Pages", _
connection)
PagesCommand.CommandType = CommandType.Text
' Set the SqlDataAdapter's SelectCommand.
mailsAdapter.SelectCommand = PagesCommand
' Fill the DataSet.
Dim dataSet1 As Dataset = New Dataset("Pages") 'ERROR MESSAGE HERE...........................................mailsAdapter.Fill(dataSet1)
connection.Close()LblPageName.Text = CStr(dataSet1.Tables("Pages").Rows(0).Item(1))
TxtPageTitle.Text = CStr(dataSet1.Tables("Pages").Rows(0).Item(2))TxtPageSummary.Text = CStr(dataSet1.Tables("Pages").Rows(0).Item(3))
Rte1.Text = CStr(dataSet1.Tables("Pages").Rows(0).Item(4))TxtPageimgUrl.Text = CStr(dataSet1.Tables("Pages").Rows(0).Item(5))
End Using
End Sub
 
End Class

View 1 Replies View Related

How To Check Old-value VS New-value For A Linq-To-SQL OnValidate Extensibility Method

May 29, 2008

All --
Please  help.
I need to know how to check old-value VS new-value for a Linq-To-SQL OnValidate Extensibility Method.
Below is some sample code that shows, more-or-less, what I am trying to do.public partial class MyObject{ #region Extensions

 partial void OnValidate(System.Data.Linq.ChangeAction action) {  if (action == System.Data.Linq.ChangeAction.Update)  {   if ((Ssn_Value_Old) == (Ssn_Value_New))   {    //Continue. The new-value is the same as the old-value; so, do not bother checking for existence.   }   else   {    if (this.IsExistingSsn(Ssn_Value_New))    {     throw new System.ApplicationException("The input is not valid. The new-value for the SSN is already existing.");    }    else    {     //Continue. The new-ssn does not already exist.    }   }  }  else  {   //Continue. This is not an update operation.  } }

 #endregion //Extensions}

Do you know how to do this without a separate lookup?
Please advise.
Thank you.
-- Mark Kamoski 
 

View 1 Replies View Related

Argument Not Specified For Parameter 'arguments' Of Public Function Select(arguments As System.Web.DatasourceSelect Arguments As Collections Ienumerable

Mar 25, 2007

I have an SqlDataSource control on my aspx page, this is connected to database by a built in procedure that returns a string dependent upon and ID passed in.
 I have the followinbg codewhich is not complet, I woiuld appriciate any help to produce the correct code for the code file
 Function GetCategoryName(ByVal ID As Integer) As String          sdsCategoriesByID.SelectParameters("ID").Direction = Data.ParameterDirection.Input          sdsCategoriesByID.SelectParameters.Item("ID").DefaultValue = 3          sdsCategoriesByID.Select() <<<< THIS LINE COMES UP WITH ERROR 1End Function
ERROR AS FOLLOWS
argument not specified for parameter 'arguments' of public function Select(arguments as System.Web.DatasourceSelect Arguments as Collections ienumerable
 
Help I have not got much more hair to loose
Thanks Steve

View 5 Replies View Related

Linq: SQL Network Interfaces, Error: 26 - Error Locating Server/Instance Specified

May 15, 2008

Hello, I have deployed myWebApp on the IIS. All went well now, but the site does not have any connection with the database.  I've already done a search on the error 26, which gave me alot of hints about solving the problem.Still I'm gettting this error. I already enabled the remote connections through the sql surface area configuration.Could it have something to do with the fact that I use LINQ? I can't find any connectionstring to modify anywhere ...  Help would be appreciated. 

View 6 Replies View Related

Error LINQ : Query A SQL Server Database !

Mar 31, 2008

I have an example : A Simple Database Query using LINQ to SQL
Before creating the project, I using SQLmetal to generate the Nosthwind Entity Classes "Northwind.cs" 
c:sqlmetal /namespace:nwind /code:Northwind.cs /pluralize /functions /sprocs /views "C:CongChinhNorthwindNorthwind.mdf"
and then, I add the Northwind.cs in my project.
CODE  1 using System;
2
3 using System.Linq;
4
5 using System.Text;
6
7 using nwind;
8
9
10
11 namespace Ex
12
13 {
14
15 class Program
16
17 {
18
19 static void Main(string[] args)
20
21 {
22
23 Northwind db = new Northwind(@"Data Source=.SQLEXPRESS;Initial Catalog=Northwind");
24
25 var cust =
26
27 from c in db.Customers
28
29 where c.City == "Rio de Janeiro"
30
31 select c;
32
33 foreach (var kh in cust) //---> SQLException was unhandled
34
35 Console.WriteLine("{0}", kh.CompanyName);
36
37 Console.ReadLine();
38
39 }
40
41 }
42
43 }
 But when I run the program. It throws a SQLExecption : Login failed for user ''. The user is not associated with a trusted SQL Server connection.I'm using SQLExpress and server name : CONGCHINHSQLEXPRESS and Windows Authentication
I don't know how to solve this problem. Somebody help me,please !

View 1 Replies View Related

Too Many Arguments Error In SQL Server?

Jul 20, 2004

"Procedure or function sptblTrgFACalculator_Insert_v2 has too many arguments specified"

This error was produced when i tried to insert 12 arguments into my table.Is there a limit to the number of arguments you can pass into your stored procedure?

View 3 Replies View Related

With OPTION ( FORCE ORDER ), SQL Takes 1 Second And Without It Takes 2 Hours Before Cancelled

Apr 9, 2007

Could some body in microsoft database team explain this behavior? Problem is predominant when cardinality of a column is very high and a where clause is specified on that column. Both use the same index.



select a12.DATE_INVOICE_ID DATE_INVOICE_ID,

a11.CUSTOMER_ID CUSTOMER_ID,

sum(a11.EXTENDED_PRICE) WJXBFS1,

sum(a11.TOTAL_COST) WJXBFS2,

(sum(a11.EXTENDED_PRICE) - sum(a11.TOTAL_COST)) WJXBFS3

from FACT_SALES_LINE a11

join RLTN_V_SL_INVOICE_YTD a12

on (a11.DATE_INVOICE_ID = a12.DATE_INVOICE_CYTD_ID)

join LKP_V_SL_EXPENSE_CODE a13

on (a11.EXPENSE_CODE_ID = a13.EXPENSE_CODE_ID)

join LKP_V_SL_LAST_STATUS a14

on (a11.LAST_STATUS_ID = a14.LAST_STATUS_ID)

join LKP_V_SL_NEXT_STATUS a15

on (a11.NEXT_STATUS_ID = a15.NEXT_STATUS_ID)

join LKP_V_SL_ORDER_TYPE a16

on (a11.ORDER_TYPE_ID = a16.ORDER_TYPE_ID)

where (a11.CUSTOMER_ID in (1523364, 1522717, 1523004, 1523728, 1523809, 1523012)

and a12.DATE_INVOICE_ID = 106365

and a16.ORDER_TYPE_SRCCD not in ( 'ST','SG','SI','SU','SK','DL','S1','YU')

and a11.BUSINESS_UNIT_ID in (461100, 461400, 461600)

and a13.EXPENSE_CODE_SRCCD <> 'LC'

and a15.NEXT_STATUS_SRCCD = '999'

and a14.LAST_STATUS_SRCCD in ( '620','914') )

group by a12.DATE_INVOICE_ID,

a11.CUSTOMER_ID

OPTION ( FORCE ORDER )



PLAN without force order:



select a12.DATE_INVOICE_ID DATE_INVOICE_ID, a11.CUSTOMER_ID CUSTOMER_ID, sum(a11.EXTENDED_PRICE) WJXBFS1, sum(a11.TOTAL_COST) WJXBFS2, (sum(a11.EXTENDED_PRICE) - sum(a11.TOTAL_COST)) WJXBFS3 from FACT_SALES_LINE a11 join RLTN_V_SL_INVOICE_YTD a12 on (a11.DATE_INVOICE_ID = a12.DATE_INVOICE_CYTD_ID) join LKP_V_SL_EXPENSE_CODE a13 on (a11.EXPENSE_CODE_ID = a13.EXPENSE_CODE_ID) join LKP_V_SL_LAST_STATUS a14 on (a11.LAST_STATUS_ID = a14.LAST_STATUS_ID) join LKP_V_SL_NEXT_STATUS a15 on (a11.NEXT_STATUS_ID = a15.NEXT_STATUS_ID) join LKP_V_SL_ORDER_TYPE a16 on (a11.ORDER_TYPE_ID = a16.ORDER_TYPE_ID) where (a11.CUSTOMER_ID in (1523364, 1522717, 1523004, 1523728, 1523809, 1523012) and a12.DATE_INVOICE_ID = 106365 and a16.ORDER_TYPE_SRCCD not in ( 'ST','SG','SI','SU','SK','DL','S1','YU') and a11.BUSINESS_UNIT_ID in (461100, 461400, 461600) and a13.EXPENSE_CODE_SRCCD <> 'LC' and a15.NEXT_STATUS_SRCCD = '999' and a14.LAST_STATUS_SRCCD in ( '620','914') ) group by a12.DATE_INVOICE_ID, a11.CUSTOMER_ID 1 1 0 NULL NULL 1 NULL 1.138269 NULL NULL NULL 2.716851 NULL NULL SELECT 0 NULL
|--Compute Scalar(DEFINE[Expr1022]=[Expr1020]-[Expr1021])) 1 2 1 Compute Scalar Compute Scalar DEFINE[Expr1022]=[Expr1020]-[Expr1021]) [Expr1022]=[Expr1020]-[Expr1021] 1.138269 0 1.138269E-07 66 2.716851 [a11].[CUSTOMER_ID], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID], [Expr1020], [Expr1021], [Expr1022] NULL PLAN_ROW 0 1
|--Compute Scalar(DEFINE[Expr1020]=CASE WHEN [Expr1023]=(0) THEN NULL ELSE [Expr1024] END, [Expr1021]=CASE WHEN [Expr1025]=(0) THEN NULL ELSE [Expr1026] END)) 1 3 2 Compute Scalar Compute Scalar DEFINE[Expr1020]=CASE WHEN [Expr1023]=(0) THEN NULL ELSE [Expr1024] END, [Expr1021]=CASE WHEN [Expr1025]=(0) THEN NULL ELSE [Expr1026] END) [Expr1020]=CASE WHEN [Expr1023]=(0) THEN NULL ELSE [Expr1024] END, [Expr1021]=CASE WHEN [Expr1025]=(0) THEN NULL ELSE [Expr1026] END 1.138269 0 1.273072E-06 49 2.716851 [a11].[CUSTOMER_ID], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID], [Expr1020], [Expr1021] NULL PLAN_ROW 0 1
|--Stream Aggregate(GROUP BY[a11].[CUSTOMER_ID]) DEFINE[Expr1023]=COUNT_BIG([JDE_DATA].[dbo].[FACT_SALES_LINE].[EXTENDED_PRICE] as [a11].[EXTENDED_PRICE]), [Expr1024]=SUM([JDE_DATA].[dbo].[FACT_SALES_LINE].[EXTENDED_PRICE] as [a11].[EXTENDED_PRICE]), [Expr1025]=COUNT_BIG([JDE_DATA].[dbo].[FACT_SALES_LINE].[TOTAL_COST] as [a11].[TOTAL_COST]), [Expr1026]=SUM([JDE_DATA].[dbo].[FACT_SALES_LINE].[TOTAL_COST] as [a11].[TOTAL_COST]), [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID]=ANY([JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID]))) 1 4 3 Stream Aggregate Aggregate GROUP BY[a11].[CUSTOMER_ID]) [Expr1023]=COUNT_BIG([JDE_DATA].[dbo].[FACT_SALES_LINE].[EXTENDED_PRICE] as [a11].[EXTENDED_PRICE]), [Expr1024]=SUM([JDE_DATA].[dbo].[FACT_SALES_LINE].[EXTENDED_PRICE] as [a11].[EXTENDED_PRICE]), [Expr1025]=COUNT_BIG([JDE_DATA].[dbo].[FACT_SALES_LINE].[TOTAL_COST] as [a11].[TOTAL_COST]), [Expr1026]=SUM([JDE_DATA].[dbo].[FACT_SALES_LINE].[TOTAL_COST] as [a11].[TOTAL_COST]), [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID]=ANY([JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID]) 1.138269 0 1.273072E-06 49 2.716851 [a11].[CUSTOMER_ID], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID], [Expr1023], [Expr1024], [Expr1025], [Expr1026] NULL PLAN_ROW 0 1
|--Sort(ORDER BY[a11].[CUSTOMER_ID] ASC)) 1 5 4 Sort Sort ORDER BY[a11].[CUSTOMER_ID] ASC) NULL 1.17323 0.01126126 0.0001004628 41 2.71685 [a11].[CUSTOMER_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 0 1
|--Nested Loops(Inner Join, OUTER REFERENCES[a11].[DATE_INVOICE_ID])) 1 6 5 Nested Loops Inner Join OUTER REFERENCES[a11].[DATE_INVOICE_ID]) NULL 1.17323 0 8.671883E-06 41 2.705488 [a11].[CUSTOMER_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 0 1
|--Nested Loops(Inner Join, OUTER REFERENCES[a11].[EXPENSE_CODE_ID])) 1 7 6 Nested Loops Inner Join OUTER REFERENCES[a11].[EXPENSE_CODE_ID]) NULL 2.074613 0 8.671883E-06 41 2.702026 [a11].[CUSTOMER_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [a11].[DATE_INVOICE_ID] NULL PLAN_ROW 0 1
| |--Nested Loops(Inner Join, OUTER REFERENCES[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID])) 1 8 7 Nested Loops Inner Join OUTER REFERENCES[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]) NULL 2.074613 0 8.671883E-06 45 2.697204 [a11].[CUSTOMER_ID], [a11].[EXPENSE_CODE_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [a11].[DATE_INVOICE_ID] NULL PLAN_ROW 0 1
| | |--Stream Aggregate(GROUP BY[a11].[FSL_SEQ_NO]) DEFINE[a11].[CUSTOMER_ID]=ANY([JDE_DATA].[dbo].[FACT_SALES_LINE].[CUSTOMER_ID] as [a11].[CUSTOMER_ID]), [a11].[EXPENSE_CODE_ID]=ANY([JDE_DATA].[dbo].[FACT_SALES_LINE].[EXPENSE_CODE_ID] as [a11].[EXPENSE_CODE_ID]), [a11].[TOTAL_COST]=ANY([JDE_DATA].[dbo].[FACT_SALES_LINE].[TOTAL_COST] as [a11].[TOTAL_COST]), [a11].[EXTENDED_PRICE]=ANY([JDE_DATA].[dbo].[FACT_SALES_LINE].[EXTENDED_PRICE] as [a11].[EXTENDED_PRICE]), [a11].[DATE_INVOICE_ID]=ANY([JDE_DATA].[dbo].[FACT_SALES_LINE].[DATE_INVOICE_ID] as [a11].[DATE_INVOICE_ID]), [JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]=ANY([JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]))) 1 9 8 Stream Aggregate Aggregate GROUP BY[a11].[FSL_SEQ_NO]) [a11].[CUSTOMER_ID]=ANY([JDE_DATA].[dbo].[FACT_SALES_LINE].[CUSTOMER_ID] as [a11].[CUSTOMER_ID]), [a11].[EXPENSE_CODE_ID]=ANY([JDE_DATA].[dbo].[FACT_SALES_LINE].[EXPENSE_CODE_ID] as [a11].[EXPENSE_CODE_ID]), [a11].[TOTAL_COST]=ANY([JDE_DATA].[dbo].[FACT_SALES_LINE].[TOTAL_COST] as [a11].[TOTAL_COST]), [a11].[EXTENDED_PRICE]=ANY([JDE_DATA].[dbo].[FACT_SALES_LINE].[EXTENDED_PRICE] as [a11].[EXTENDED_PRICE]), [a11].[DATE_INVOICE_ID]=ANY([JDE_DATA].[dbo].[FACT_SALES_LINE].[DATE_INVOICE_ID] as [a11].[DATE_INVOICE_ID]), [JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]=ANY([JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]) 2.074613 0 0.1950575 49 2.692634 [a11].[CUSTOMER_ID], [a11].[EXPENSE_CODE_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [a11].[DATE_INVOICE_ID], [JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] NULL PLAN_ROW 0 1
| | | |--Nested Loops(Inner Join, OUTER REFERENCES[a11].[ORDER_TYPE_ID]) OPTIMIZED) 1 10 9 Nested Loops Inner Join OUTER REFERENCES[a11].[ORDER_TYPE_ID]) OPTIMIZED NULL 390113 0 1.630672 53 2.497577 [a11].[FSL_SEQ_NO], [a11].[CUSTOMER_ID], [a11].[EXPENSE_CODE_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [a11].[DATE_INVOICE_ID], [JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] NULL PLAN_ROW 0 1
| | | |--Nested Loops(Inner Join, OUTER REFERENCES[a11].[LAST_STATUS_ID])) 1 12 10 Nested Loops Inner Join OUTER REFERENCES[a11].[LAST_STATUS_ID]) NULL 2.074613 0 9.189784E-06 53 0.0406176 [a11].[FSL_SEQ_NO], [a11].[ORDER_TYPE_ID], [a11].[CUSTOMER_ID], [a11].[EXPENSE_CODE_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [a11].[DATE_INVOICE_ID] NULL PLAN_ROW 0 1
| | | | |--Nested Loops(Inner Join, OUTER REFERENCES[a11].[NEXT_STATUS_ID])) 1 13 12 Nested Loops Inner Join OUTER REFERENCES[a11].[NEXT_STATUS_ID]) NULL 2.198513 0 0.0001337915 57 0.03713583 [a11].[FSL_SEQ_NO], [a11].[ORDER_TYPE_ID], [a11].[CUSTOMER_ID], [a11].[LAST_STATUS_ID], [a11].[EXPENSE_CODE_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [a11].[DATE_INVOICE_ID] NULL PLAN_ROW 0 1
| | | | | |--Index Seek(OBJECT[JDE_DATA].[dbo].[FACT_SALES_LINE].[IX_FACT_SALES_LINE_06] AS [a11]), SEEK[a11].[CUSTOMER_ID]=(1522717) OR [a11].[CUSTOMER_ID]=(1523004) OR [a11].[CUSTOMER_ID]=(1523012) OR [a11].[CUSTOMER_ID]=(1523364) OR [a11].[CUSTOMER_ID]=(1523728) OR [a11].[CUSTOMER_ID]=(1523809)), WHERE[JDE_DATA].[dbo].[FACT_SALES_LINE].[BUSINESS_UNIT_ID] as [a11].[BUSINESS_UNIT_ID]=(461100) OR [JDE_DATA].[dbo].[FACT_SALES_LINE].[BUSINESS_UNIT_ID] as [a11].[BUSINESS_UNIT_ID]=(461400) OR [JDE_DATA].[dbo].[FACT_SALES_LINE].[BUSINESS_UNIT_ID] as [a11].[BUSINESS_UNIT_ID]=(461600)) ORDERED FORWARD) 1 14 13 Index Seek Index Seek OBJECT[JDE_DATA].[dbo].[FACT_SALES_LINE].[IX_FACT_SALES_LINE_06] AS [a11]), SEEK[a11].[CUSTOMER_ID]=(1522717) OR [a11].[CUSTOMER_ID]=(1523004) OR [a11].[CUSTOMER_ID]=(1523012) OR [a11].[CUSTOMER_ID]=(1523364) OR [a11].[CUSTOMER_ID]=(1523728) OR [a11].[CUSTOMER_ID]=(1523809)), WHERE[JDE_DATA].[dbo].[FACT_SALES_LINE].[BUSINESS_UNIT_ID] as [a11].[BUSINESS_UNIT_ID]=(461100) OR [JDE_DATA].[dbo].[FACT_SALES_LINE].[BUSINESS_UNIT_ID] as [a11].[BUSINESS_UNIT_ID]=(461400) OR [JDE_DATA].[dbo].[FACT_SALES_LINE].[BUSINESS_UNIT_ID] as [a11].[BUSINESS_UNIT_ID]=(461600)) ORDERED FORWARD [a11].[FSL_SEQ_NO], [a11].[ORDER_TYPE_ID], [a11].[CUSTOMER_ID], [a11].[BUSINESS_UNIT_ID], [a11].[LAST_STATUS_ID], [a11].[NEXT_STATUS_ID], [a11].[EXPENSE_CODE_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [a11].[DATE_INVOICE_ID] 32.00753 0.0268287 0.00104035 66 0.02786905 [a11].[FSL_SEQ_NO], [a11].[ORDER_TYPE_ID], [a11].[CUSTOMER_ID], [a11].[BUSINESS_UNIT_ID], [a11].[LAST_STATUS_ID], [a11].[NEXT_STATUS_ID], [a11].[EXPENSE_CODE_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [a11].[DATE_INVOICE_ID] NULL PLAN_ROW 0 1
| | | | | |--Index Seek(OBJECT[JDE_DATA].[dbo].[LU_NEXT_STATUS].[IX_LU_NEXT_STATUS_1]), SEEK[JDE_DATA].[dbo].[LU_NEXT_STATUS].[NEXT_STATUS_SRCCD]=N'999' AND [JDE_DATA].[dbo].[LU_NEXT_STATUS].[NEXT_STATUS_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[NEXT_STATUS_ID] as [a11].[NEXT_STATUS_ID]) ORDERED FORWARD) 1 15 13 Index Seek Index Seek OBJECT[JDE_DATA].[dbo].[LU_NEXT_STATUS].[IX_LU_NEXT_STATUS_1]), SEEK[JDE_DATA].[dbo].[LU_NEXT_STATUS].[NEXT_STATUS_SRCCD]=N'999' AND [JDE_DATA].[dbo].[LU_NEXT_STATUS].[NEXT_STATUS_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[NEXT_STATUS_ID] as [a11].[NEXT_STATUS_ID]) ORDERED FORWARD NULL 1 0.003125 0.0001581 9 0.008185391 NULL NULL PLAN_ROW 0 32.00753
| | | | |--Index Seek(OBJECT[JDE_DATA].[dbo].[LU_LAST_STATUS].[IX_LU_LAST_STATUS_1]), SEEK[JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_SRCCD]=N'620' AND [JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[LAST_STATUS_ID] as [a11].[LAST_STATUS_ID] OR [JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_SRCCD]=N'914' AND [JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[LAST_STATUS_ID] as [a11].[LAST_STATUS_ID]) ORDERED FORWARD) 1 16 12 Index Seek Index Seek OBJECT[JDE_DATA].[dbo].[LU_LAST_STATUS].[IX_LU_LAST_STATUS_1]), SEEK[JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_SRCCD]=N'620' AND [JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[LAST_STATUS_ID] as [a11].[LAST_STATUS_ID] OR [JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_SRCCD]=N'914' AND [JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[LAST_STATUS_ID] as [a11].[LAST_STATUS_ID]) ORDERED FORWARD NULL 1 0.003125 0.0001581 9 0.003472585 NULL NULL PLAN_ROW 0 2.198513
| | | |--Index Seek(OBJECT[JDE_DATA].[dbo].[FACT_SALES_LINE].[IX_FACT_SALES_LINE_01]), SEEK[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] as [a11].[ORDER_TYPE_ID]) ORDERED FORWARD) 1 17 10 Index Seek Index Seek OBJECT[JDE_DATA].[dbo].[FACT_SALES_LINE].[IX_FACT_SALES_LINE_01]), SEEK[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] as [a11].[ORDER_TYPE_ID]) ORDERED FORWARD [JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] 188041.3 0.2616435 0.2070025 11 0.8262868 [JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] NULL PLAN_ROW 0 2.074613
| | |--Clustered Index Seek(OBJECT[JDE_DATA].[dbo].[LU_ORDER_TYPE].[PK__LU_ORDER_TYPE__265B8A40] AS ), SEEK.[ORDER_TYPE_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]), WHERE[JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'DL' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'S1' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SG' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SI' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SK' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'ST' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SU' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'YU') ORDERED FORWARD) 1 31 8 Clustered Index Seek Clustered Index Seek OBJECT[JDE_DATA].[dbo].[LU_ORDER_TYPE].[PK__LU_ORDER_TYPE__265B8A40] AS ), SEEK.[ORDER_TYPE_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]), WHERE[JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'DL' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'S1' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SG' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SI' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SK' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'ST' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SU' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'YU') ORDERED FORWARD .[ORDER_TYPE_SRCCD] 1 0.003125 0.0001581 14 0.004555401 .[ORDER_TYPE_SRCCD] NULL PLAN_ROW 0 2.074613
| |--Clustered Index Seek(OBJECT[JDE_DATA].[dbo].[LU_EXPENSE_CODE].[PK__LU_EXPENSE_CODE__2843D2B2]), SEEK[JDE_DATA].[dbo].[LU_EXPENSE_CODE].[EXPENSE_CODE_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[EXPENSE_CODE_ID] as [a11].[EXPENSE_CODE_ID]), WHERE[JDE_DATA].[dbo].[LU_EXPENSE_CODE].[EXPENSE_CODE_SRCCD]<>N'LC') ORDERED FORWARD) 1 32 7 Clustered Index Seek Clustered Index Seek OBJECT[JDE_DATA].[dbo].[LU_EXPENSE_CODE].[PK__LU_EXPENSE_CODE__2843D2B2]), SEEK[JDE_DATA].[dbo].[LU_EXPENSE_CODE].[EXPENSE_CODE_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[EXPENSE_CODE_ID] as [a11].[EXPENSE_CODE_ID]), WHERE[JDE_DATA].[dbo].[LU_EXPENSE_CODE].[EXPENSE_CODE_SRCCD]<>N'LC') ORDERED FORWARD [JDE_DATA].[dbo].[LU_EXPENSE_CODE].[EXPENSE_CODE_SRCCD] 1 0.003125 0.0001581 16 0.004812614 [JDE_DATA].[dbo].[LU_EXPENSE_CODE].[EXPENSE_CODE_SRCCD] NULL PLAN_ROW 0 2.074613
|--Index Seek(OBJECT[JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[IX_REL_CALENDAR_YEAR_TO_DATE_01]), SEEK[JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID]=(106365) AND [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID_CYTD]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[DATE_INVOICE_ID] as [a11].[DATE_INVOICE_ID]) ORDERED FORWARD) 1 33 6 Index Seek Index Seek OBJECT[JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[IX_REL_CALENDAR_YEAR_TO_DATE_01]), SEEK[JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID]=(106365) AND [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID_CYTD]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[DATE_INVOICE_ID] as [a11].[DATE_INVOICE_ID]) ORDERED FORWARD [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] 1 0.003125 0.0001581 11 0.003452996 [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 0 2.074613



PLAN WITH FORCE ORDER:



select a12.DATE_INVOICE_ID DATE_INVOICE_ID, a11.CUSTOMER_ID CUSTOMER_ID, sum(a11.EXTENDED_PRICE) WJXBFS1, sum(a11.TOTAL_COST) WJXBFS2, (sum(a11.EXTENDED_PRICE) - sum(a11.TOTAL_COST)) WJXBFS3 from FACT_SALES_LINE a11 join RLTN_V_SL_INVOICE_YTD a12 on (a11.DATE_INVOICE_ID = a12.DATE_INVOICE_CYTD_ID) join LKP_V_SL_EXPENSE_CODE a13 on (a11.EXPENSE_CODE_ID = a13.EXPENSE_CODE_ID) join LKP_V_SL_LAST_STATUS a14 on (a11.LAST_STATUS_ID = a14.LAST_STATUS_ID) join LKP_V_SL_NEXT_STATUS a15 on (a11.NEXT_STATUS_ID = a15.NEXT_STATUS_ID) join LKP_V_SL_ORDER_TYPE a16 on (a11.ORDER_TYPE_ID = a16.ORDER_TYPE_ID) where (a11.CUSTOMER_ID in (1523364, 1522717, 1523004, 1523728, 1523809, 1523012) and a12.DATE_INVOICE_ID = 106365 and a16.ORDER_TYPE_SRCCD not in ( 'ST','SG','SI','SU','SK','DL','S1','YU') and a11.BUSINESS_UNIT_ID in (461100, 461400, 461600) and a13.EXPENSE_CODE_SRCCD <> 'LC' and a15.NEXT_STATUS_SRCCD = '999' and a14.LAST_STATUS_SRCCD in ( '620','914') ) group by a12.DATE_INVOICE_ID, a11.CUSTOMER_ID OPTION ( FORCE ORDER ) 1 1 0 NULL NULL 1 NULL 1.08425 NULL NULL NULL 9.249098 NULL NULL SELECT 0 NULL
|--Compute Scalar(DEFINE[Expr1022]=[Expr1020]-[Expr1021])) 1 2 1 Compute Scalar Compute Scalar DEFINE[Expr1022]=[Expr1020]-[Expr1021]) [Expr1022]=[Expr1020]-[Expr1021] 1.08425 0 1.08425E-07 66 9.249098 [a11].[CUSTOMER_ID], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID], [Expr1020], [Expr1021], [Expr1022] NULL PLAN_ROW 0 1
|--Compute Scalar(DEFINE[Expr1020]=CASE WHEN [Expr1035]=(0) THEN NULL ELSE [Expr1036] END, [Expr1021]=CASE WHEN [Expr1037]=(0) THEN NULL ELSE [Expr1038] END)) 1 3 2 Compute Scalar Compute Scalar DEFINE[Expr1020]=CASE WHEN [Expr1035]=(0) THEN NULL ELSE [Expr1036] END, [Expr1021]=CASE WHEN [Expr1037]=(0) THEN NULL ELSE [Expr1038] END) [Expr1020]=CASE WHEN [Expr1035]=(0) THEN NULL ELSE [Expr1036] END, [Expr1021]=CASE WHEN [Expr1037]=(0) THEN NULL ELSE [Expr1038] END 1.08425 0 1.204394E-06 49 9.249098 [a11].[CUSTOMER_ID], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID], [Expr1020], [Expr1021] NULL PLAN_ROW 0 1
|--Stream Aggregate(GROUP BY[a11].[CUSTOMER_ID]) DEFINE[Expr1035]=COUNT_BIG([JDE_DATA].[dbo].[FACT_SALES_LINE].[EXTENDED_PRICE] as [a11].[EXTENDED_PRICE]), [Expr1036]=SUM([JDE_DATA].[dbo].[FACT_SALES_LINE].[EXTENDED_PRICE] as [a11].[EXTENDED_PRICE]), [Expr1037]=COUNT_BIG([JDE_DATA].[dbo].[FACT_SALES_LINE].[TOTAL_COST] as [a11].[TOTAL_COST]), [Expr1038]=SUM([JDE_DATA].[dbo].[FACT_SALES_LINE].[TOTAL_COST] as [a11].[TOTAL_COST]), [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID]=ANY([JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID]))) 1 4 3 Stream Aggregate Aggregate GROUP BY[a11].[CUSTOMER_ID]) [Expr1035]=COUNT_BIG([JDE_DATA].[dbo].[FACT_SALES_LINE].[EXTENDED_PRICE] as [a11].[EXTENDED_PRICE]), [Expr1036]=SUM([JDE_DATA].[dbo].[FACT_SALES_LINE].[EXTENDED_PRICE] as [a11].[EXTENDED_PRICE]), [Expr1037]=COUNT_BIG([JDE_DATA].[dbo].[FACT_SALES_LINE].[TOTAL_COST] as [a11].[TOTAL_COST]), [Expr1038]=SUM([JDE_DATA].[dbo].[FACT_SALES_LINE].[TOTAL_COST] as [a11].[TOTAL_COST]), [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID]=ANY([JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID]) 1.08425 0 1.204394E-06 49 9.249098 [a11].[CUSTOMER_ID], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID], [Expr1035], [Expr1036], [Expr1037], [Expr1038] NULL PLAN_ROW 0 1
|--Sort(ORDER BY[a11].[CUSTOMER_ID] ASC)) 1 5 4 Sort Sort ORDER BY[a11].[CUSTOMER_ID] ASC) NULL 1.103783 0.01126126 0.0001002863 41 9.249096 [a11].[CUSTOMER_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 0 1
|--Parallelism(Gather Streams) 1 6 5 Parallelism Gather Streams NULL NULL 1.103783 0 0.02850539 41 9.237735 [a11].[CUSTOMER_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 1 1
|--Merge Join(Inner Join, MANY-TO-MANY MERGE[a11].[ORDER_TYPE_ID])=(.[ORDER_TYPE_ID]), RESIDUAL[JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_ID] as .[ORDER_TYPE_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] as [a11].[ORDER_TYPE_ID])) 1 7 6 Merge Join Inner Join MANY-TO-MANY MERGE[a11].[ORDER_TYPE_ID])=(.[ORDER_TYPE_ID]), RESIDUAL[JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_ID] as .[ORDER_TYPE_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] as [a11].[ORDER_TYPE_ID]) NULL 1.103783 0.0004695 0.001520579 41 9.209229 [a11].[CUSTOMER_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 1 1
|--Sort(ORDER BY[a11].[ORDER_TYPE_ID] ASC)) 1 8 7 Sort Sort ORDER BY[a11].[ORDER_TYPE_ID] ASC) NULL 1.103783 0.002815315 2.507257E-05 45 0.09645625 [a11].[ORDER_TYPE_ID], [a11].[CUSTOMER_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 1 1
| |--Bitmap(HASH[a11].[ORDER_TYPE_ID]), DEFINE[Bitmap1034])) 1 9 8 Bitmap Bitmap Create HASH[a11].[ORDER_TYPE_ID]) [Bitmap1034] 1.103783 0 0.02850667 45 0.09361587 [a11].[ORDER_TYPE_ID], [a11].[CUSTOMER_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 1 1
| |--Parallelism(Repartition Streams, Hash Partitioning, PARTITION COLUMNS[a11].[ORDER_TYPE_ID])) 1 10 9 Parallelism Repartition Streams PARTITION COLUMNS[a11].[ORDER_TYPE_ID]) NULL 1.103783 0 0.02850667 45 0.09361587 [a11].[ORDER_TYPE_ID], [a11].[CUSTOMER_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 1 1
| |--Nested Loops(Inner Join, OUTER REFERENCES[a11].[NEXT_STATUS_ID])) 1 11 10 Nested Loops Inner Join OUTER REFERENCES[a11].[NEXT_STATUS_ID]) NULL 1.103783 0 4.031072E-06 45 0.06510919 [a11].[ORDER_TYPE_ID], [a11].[CUSTOMER_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 1 1
| |--Nested Loops(Inner Join, OUTER REFERENCES[a11].[LAST_STATUS_ID])) 1 12 11 Nested Loops Inner Join OUTER REFERENCES[a11].[LAST_STATUS_ID]) NULL 3.857486 0 3.344787E-05 49 0.06137029 [a11].[ORDER_TYPE_ID], [a11].[CUSTOMER_ID], [a11].[NEXT_STATUS_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 1 1
| | |--Nested Loops(Inner Join, OUTER REFERENCES[a11].[EXPENSE_CODE_ID])) 1 13 12 Nested Loops Inner Join OUTER REFERENCES[a11].[EXPENSE_CODE_ID]) NULL 32.00753 0 3.344787E-05 53 0.05315145 [a11].[ORDER_TYPE_ID], [a11].[CUSTOMER_ID], [a11].[LAST_STATUS_ID], [a11].[NEXT_STATUS_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 1 1
| | | |--Nested Loops(Inner Join, OUTER REFERENCES[a11].[DATE_INVOICE_ID], [Expr1033]) WITH UNORDERED PREFETCH) 1 14 13 Nested Loops Inner Join OUTER REFERENCES[a11].[DATE_INVOICE_ID], [Expr1033]) WITH UNORDERED PREFETCH NULL 32.00753 0 3.344787E-05 57 0.03554453 [a11].[ORDER_TYPE_ID], [a11].[CUSTOMER_ID], [a11].[LAST_STATUS_ID], [a11].[NEXT_STATUS_ID], [a11].[EXPENSE_CODE_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 1 1
| | | | |--Index Seek(OBJECT[JDE_DATA].[dbo].[FACT_SALES_LINE].[IX_FACT_SALES_LINE_06] AS [a11]), SEEK[a11].[CUSTOMER_ID]=(1522717) OR [a11].[CUSTOMER_ID]=(1523004) OR [a11].[CUSTOMER_ID]=(1523012) OR [a11].[CUSTOMER_ID]=(1523364) OR [a11].[CUSTOMER_ID]=(1523728) OR [a11].[CUSTOMER_ID]=(1523809)), WHERE[JDE_DATA].[dbo].[FACT_SALES_LINE].[BUSINESS_UNIT_ID] as [a11].[BUSINESS_UNIT_ID]=(461100) OR [JDE_DATA].[dbo].[FACT_SALES_LINE].[BUSINESS_UNIT_ID] as [a11].[BUSINESS_UNIT_ID]=(461400) OR [JDE_DATA].[dbo].[FACT_SALES_LINE].[BUSINESS_UNIT_ID] as [a11].[BUSINESS_UNIT_ID]=(461600)) ORDERED FORWARD) 1 16 14 Index Seek Index Seek OBJECT[JDE_DATA].[dbo].[FACT_SALES_LINE].[IX_FACT_SALES_LINE_06] AS [a11]), SEEK[a11].[CUSTOMER_ID]=(1522717) OR [a11].[CUSTOMER_ID]=(1523004) OR [a11].[CUSTOMER_ID]=(1523012) OR [a11].[CUSTOMER_ID]=(1523364) OR [a11].[CUSTOMER_ID]=(1523728) OR [a11].[CUSTOMER_ID]=(1523809)), WHERE[JDE_DATA].[dbo].[FACT_SALES_LINE].[BUSINESS_UNIT_ID] as [a11].[BUSINESS_UNIT_ID]=(461100) OR [JDE_DATA].[dbo].[FACT_SALES_LINE].[BUSINESS_UNIT_ID] as [a11].[BUSINESS_UNIT_ID]=(461400) OR [JDE_DATA].[dbo].[FACT_SALES_LINE].[BUSINESS_UNIT_ID] as [a11].[BUSINESS_UNIT_ID]=(461600)) ORDERED FORWARD [a11].[ORDER_TYPE_ID], [a11].[CUSTOMER_ID], [a11].[BUSINESS_UNIT_ID], [a11].[LAST_STATUS_ID], [a11].[NEXT_STATUS_ID], [a11].[EXPENSE_CODE_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [a11].[DATE_INVOICE_ID] 32.00753 0.0268287 0.0002600876 62 0.02708879 [a11].[ORDER_TYPE_ID], [a11].[CUSTOMER_ID], [a11].[BUSINESS_UNIT_ID], [a11].[LAST_STATUS_ID], [a11].[NEXT_STATUS_ID], [a11].[EXPENSE_CODE_ID], [a11].[TOTAL_COST], [a11].[EXTENDED_PRICE], [a11].[DATE_INVOICE_ID] NULL PLAN_ROW 1 1
| | | | |--Index Seek(OBJECT[JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[IX_REL_CALENDAR_YEAR_TO_DATE_01]), SEEK[JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID]=(106365) AND [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID_CYTD]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[DATE_INVOICE_ID] as [a11].[DATE_INVOICE_ID]) ORDERED FORWARD) 1 17 14 Index Seek Index Seek OBJECT[JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[IX_REL_CALENDAR_YEAR_TO_DATE_01]), SEEK[JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID]=(106365) AND [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID_CYTD]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[DATE_INVOICE_ID] as [a11].[DATE_INVOICE_ID]) ORDERED FORWARD [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] 1 0.003125 0.0001581 11 0.008185391 [JDE_DATA].[dbo].[REL_CALENDAR_YEAR_TO_DATE].[DATE_ID] NULL PLAN_ROW 1 32.00753
| | | |--Clustered Index Seek(OBJECT[JDE_DATA].[dbo].[LU_EXPENSE_CODE].[PK__LU_EXPENSE_CODE__2843D2B2]), SEEK[JDE_DATA].[dbo].[LU_EXPENSE_CODE].[EXPENSE_CODE_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[EXPENSE_CODE_ID] as [a11].[EXPENSE_CODE_ID]), WHERE[JDE_DATA].[dbo].[LU_EXPENSE_CODE].[EXPENSE_CODE_SRCCD]<>N'LC') ORDERED FORWARD) 1 18 13 Clustered Index Seek Clustered Index Seek OBJECT[JDE_DATA].[dbo].[LU_EXPENSE_CODE].[PK__LU_EXPENSE_CODE__2843D2B2]), SEEK[JDE_DATA].[dbo].[LU_EXPENSE_CODE].[EXPENSE_CODE_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[EXPENSE_CODE_ID] as [a11].[EXPENSE_CODE_ID]), WHERE[JDE_DATA].[dbo].[LU_EXPENSE_CODE].[EXPENSE_CODE_SRCCD]<>N'LC') ORDERED FORWARD [JDE_DATA].[dbo].[LU_EXPENSE_CODE].[EXPENSE_CODE_SRCCD] 1 0.003125 0.0001581 16 0.01755811 [JDE_DATA].[dbo].[LU_EXPENSE_CODE].[EXPENSE_CODE_SRCCD] NULL PLAN_ROW 1 32.00753
| | |--Index Seek(OBJECT[JDE_DATA].[dbo].[LU_LAST_STATUS].[IX_LU_LAST_STATUS_1]), SEEK[JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_SRCCD]=N'620' AND [JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[LAST_STATUS_ID] as [a11].[LAST_STATUS_ID] OR [JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_SRCCD]=N'914' AND [JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[LAST_STATUS_ID] as [a11].[LAST_STATUS_ID]) ORDERED FORWARD) 1 19 12 Index Seek Index Seek OBJECT[JDE_DATA].[dbo].[LU_LAST_STATUS].[IX_LU_LAST_STATUS_1]), SEEK[JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_SRCCD]=N'620' AND [JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[LAST_STATUS_ID] as [a11].[LAST_STATUS_ID] OR [JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_SRCCD]=N'914' AND [JDE_DATA].[dbo].[LU_LAST_STATUS].[LAST_STATUS_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[LAST_STATUS_ID] as [a11].[LAST_STATUS_ID]) ORDERED FORWARD NULL 1 0.003125 0.0001581 9 0.008185391 NULL NULL PLAN_ROW 1 32.00753
| |--Index Seek(OBJECT[JDE_DATA].[dbo].[LU_NEXT_STATUS].[IX_LU_NEXT_STATUS_1]), SEEK[JDE_DATA].[dbo].[LU_NEXT_STATUS].[NEXT_STATUS_SRCCD]=N'999' AND [JDE_DATA].[dbo].[LU_NEXT_STATUS].[NEXT_STATUS_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[NEXT_STATUS_ID] as [a11].[NEXT_STATUS_ID]) ORDERED FORWARD) 1 20 11 Index Seek Index Seek OBJECT[JDE_DATA].[dbo].[LU_NEXT_STATUS].[IX_LU_NEXT_STATUS_1]), SEEK[JDE_DATA].[dbo].[LU_NEXT_STATUS].[NEXT_STATUS_SRCCD]=N'999' AND [JDE_DATA].[dbo].[LU_NEXT_STATUS].[NEXT_STATUS_ID]=[JDE_DATA].[dbo].[FACT_SALES_LINE].[NEXT_STATUS_ID] as [a11].[NEXT_STATUS_ID]) ORDERED FORWARD NULL 1 0.003125 0.0001581 9 0.003734868 NULL NULL PLAN_ROW 1 3.857486
|--Parallelism(Repartition Streams, Hash Partitioning, PARTITION COLUMNS.[ORDER_TYPE_ID]), ORDER BY.[ORDER_TYPE_ID] ASC), WHEREPROBE([Bitmap1034])=TRUE)) 1 21 7 Parallelism Repartition Streams PARTITION COLUMNS.[ORDER_TYPE_ID]), ORDER BY.[ORDER_TYPE_ID] ASC), WHEREPROBE([Bitmap1034])=TRUE) NULL 20.5 0 0.0285224 11 9.11078 .[ORDER_TYPE_ID] NULL PLAN_ROW 1 1
|--Merge Join(Inner Join, MERGE.[ORDER_TYPE_ID])=([JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]), RESIDUAL[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]=[JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_ID] as .[ORDER_TYPE_ID])) 1 22 21 Merge Join Inner Join MERGE.[ORDER_TYPE_ID])=([JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]), RESIDUAL[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]=[JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_ID] as .[ORDER_TYPE_ID]) NULL 20.5 0 0.001586888 11 9.082257 .[ORDER_TYPE_ID] NULL PLAN_ROW 1 1
|--Parallelism(Repartition Streams, Hash Partitioning, PARTITION COLUMNS.[ORDER_TYPE_ID]), ORDER BY.[ORDER_TYPE_ID] ASC)) 1 23 22 Parallelism Repartition Streams PARTITION COLUMNS.[ORDER_TYPE_ID]), ORDER BY.[ORDER_TYPE_ID] ASC) NULL 328 0 0.03033649 11 0.03529974 .[ORDER_TYPE_ID] NULL PLAN_ROW 1 1
| |--Clustered Index Scan(OBJECT[JDE_DATA].[dbo].[LU_ORDER_TYPE].[PK__LU_ORDER_TYPE__265B8A40] AS ), WHERE[JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'DL' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'S1' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SG' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SI' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SK' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'ST' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SU' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'YU') ORDERED FORWARD) 1 24 23 Clustered Index Scan Clustered Index Scan OBJECT[JDE_DATA].[dbo].[LU_ORDER_TYPE].[PK__LU_ORDER_TYPE__265B8A40] AS ), WHERE[JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'DL' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'S1' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SG' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SI' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SK' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'ST' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'SU' AND [JDE_DATA].[dbo].[LU_ORDER_TYPE].[ORDER_TYPE_SRCCD] as .[ORDER_TYPE_SRCCD]<>N'YU') ORDERED FORWARD .[ORDER_TYPE_ID] 328 0.004606482 0.00013165 18 0.004738132 .[ORDER_TYPE_ID] NULL PLAN_ROW 1 1
|--Stream Aggregate(GROUP BY[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID])) 1 25 22 Stream Aggregate Aggregate GROUP BY[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]) NULL 27 0 1.6875E-05 11 9.045368 [JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] NULL PLAN_ROW 1 1
|--Parallelism(Repartition Streams, Hash Partitioning, PARTITION COLUMNS[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]), ORDER BY[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] ASC)) 1 26 25 Parallelism Repartition Streams PARTITION COLUMNS[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]), ORDER BY[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] ASC) NULL 108 0 0.0291047 11 9.045351 [JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] NULL PLAN_ROW 1 1
|--Stream Aggregate(GROUP BY[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID])) 1 27 26 Stream Aggregate Aggregate GROUP BY[JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID]) NULL 108 0 0.634653 11 9.016247 [JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] NULL PLAN_ROW 1 1
|--Index Scan(OBJECT[JDE_DATA].[dbo].[FACT_SALES_LINE].[IX_FACT_SALES_LINE_01]), ORDERED FORWARD) 1 28 27 Index Scan Index Scan OBJECT[JDE_DATA].[dbo].[FACT_SALES_LINE].[IX_FACT_SALES_LINE_01]), ORDERED FORWARD [JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] 5077116 6.985347 1.396246 11 8.381594 [JDE_DATA].[dbo].[FACT_SALES_LINE].[ORDER_TYPE_ID] NULL PLAN_ROW 1 1





View 4 Replies View Related

Error: Procedure Or Function Has Too Many Arguments Specified

Dec 9, 2005

Hi,

I've found that I'm not the first one to get the error

"Procedure or function x has too many arguments specified"

while working with Stored Procedures (which is no surprise at all). But
all suggested solutions didn't help, maybe this is because I
misunderstood the whole concept. The situation is: On my page there is
a FormView control including the EditItemTemplate. The database
contains a Stored Procedure called UpdatePersonByID which is working
fine as long as executed in Visual Web Developer. Here's the procedure
code:

ALTER PROCEDURE dbo.UpdatePersonByID
    (
        @LastName varchar(50),
        @FirstName varchar(50),
        @Phone varchar(50),
        @PhonePrivate varchar(50),
        @PhoneMobile varchar(50),
        @Email varchar(50)
    )
AS
    UPDATE
        tblPersons
        SET
            PersonLastName = @LastName,
            PersonFirstName = @FirstName,
            PersonPhone = @Phone,
            PersonPhonePrivate = @PhonePrivate,
            PersonPhoneMobile = @PhoneMobile,
            PersonEmail = @Email
        WHERE
            PersonLastName = @LastName
    RETURN

This is not exactly what it will finally have to do, of course the
WHERE-clause later will contain an ID comparison. But since I tried to
break down my code as much as possible I changed it to what you see
right now. Here's the aspx-source (the red stuff is what I think is
important):

<%@ Page
    Language="VB"
    MasterPageFile="fb10.master"
    AutoEventWireup="false"
    CodeFile="codebehind/staff.aspx.vb"
    Inherits="staff"
    meta:ResourceKey="PageResource"
%>
<%@ MasterType VirtualPath ="~/fb10.master"  %>
<asp:Content
    ID="ContentStaff"
    ContentPlaceHolderID="cphContentMain"
    Runat="Server">
   
    <h3 id="hdStaff" runat="server" meta:resourcekey="Staff" />

    <!-- DataSource srcStaff collects all persons from staff table in database. -->
    <asp:SqlDataSource
        ID="srcStaff"
        runat="server"
        ConflictDetection="CompareAllValues"
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommandType="StoredProcedure"
        SelectCommand="SelectPersonNames"
    />
    <asp:DropDownList
        ID="ddlStaff"
        runat="server"
        DataSourceID="srcStaff"
        DataTextField="CompleteName"
        DataValueField="PersonID"
        AutoPostBack="True">
    </asp:DropDownList>

    <!-- DataSource srcPerson gets person selected in DropDownList "ddlStaff". -->
    <asp:SqlDataSource
        ID="srcPerson"
        runat="server"
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="System.Data.SqlClient"
        SelectCommand="SelectPersonByID"
        SelectCommandType="StoredProcedure"
        UpdateCommand="UpdatePersonByID"
        UpdateCommandType="StoredProcedure"
        OldValuesParameterFormatString="{0}" >
        <SelectParameters>
            <asp:ControlParameter
                ControlID="ddlStaff"
                DefaultValue="1"
                Name="ID"
                PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="LastName" Type="String" />
            <asp:Parameter Name="FirstName" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
            <asp:Parameter Name="PhonePrivate" Type="String" />
            <asp:Parameter Name="PhoneMobile" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>

    <!--  DataSource srcBuildings gets all buildings from building table in database. -->
    <asp:SqlDataSource
        ID="srcBuildings"
        runat="server"
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="System.Data.SqlClient"
        SelectCommand="SelectBuildings"
        SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>
   
    <asp:FormView
        ID="fvStaff"
        runat="server"
        DataSourceID="srcPerson">
        <EditItemTemplate>
            <!--
DataSource srcRooms gets all rooms from room table in database. -->
            <asp:SqlDataSource
                ID="srcRooms"
                runat="server"
   
           
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                ProviderName="System.Data.SqlClient"
                SelectCommand="SelectRoomsByBuildingID"
                SelectCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:ControlParameter
           
           
ControlID="ddlBuildings"
           
           
DefaultValue="1"
           
           
Name="ID"
           
           
PropertyName="SelectedValue"
           
           
Type="Int32"
                    />
                </SelectParameters>
            </asp:SqlDataSource>

            <asp:Label
cssClass="lblIdentifier" ID="lblLastName" runat="server"
meta:resourcekey="LastName" />
           
<asp:TextBox cssClass="staff" ID="LastName" runat="server"
Text='<%# Bind("PersonLastName")
%>'></asp:TextBox><br />

            <asp:Label
cssClass="lblIdentifier" ID="lblFirstName" runat="server"
meta:resourcekey="FirstName" />
           
<asp:TextBox cssClass="staff" ID="FirstName" runat="server"
Text='<%# Bind("PersonFirstName")
%>'></asp:TextBox><br />
           
            <asp:Label
CssClass="lblIdentifier" ID="lblBuilding" runat="server"
meta:resourcekey="Building"></asp:Label>
            <asp:DropDownList
                ID="ddlBuildings"
                cssClass="small"
                runat="server"
                DataSourceID="srcBuildings"
                DataTextField="BuildingAbbreviation"
                DataValueField="BuildingID"
                AutoPostBack="True"
                SelectedValue='<%# Bind("RoomBuildingID") %>'
           
   
OnSelectedIndexChanged="ddlBuildings_SelectedIndexChanged">
            </asp:DropDownList><br />
           
            <asp:Label
cssClass="lblIdentifier" ID="lblRoom" runat="server"
meta:resourcekey="Room" />
            <asp:DropDownList
                ID="ddlRooms"
                cssClass="small"
                runat="server"
                DataSourceID="srcRooms"
                DataTextField="RoomName"
                DataValueField="RoomID"
                AutoPostBack="true"
           
    SelectedValue='<%# Bind("PersonRoomID") %>'>
            </asp:DropDownList><br />

            <asp:Label
cssClass="lblIdentifier" ID="lblPhone" runat="server"
meta:resourcekey="Phone" />
           
<asp:TextBox cssClass="staff" ID="Phone" runat="server" Text='<%#
Bind("PersonPhone") %>'></asp:TextBox><br />
           
            <asp:Label
cssClass="lblIdentifier" ID="lblPhonePrivate" runat="server"
meta:resourcekey="Private" />
           
<asp:TextBox cssClass="staff" ID="PhonePrivate" runat="server"
Text='<%# Bind("PersonPhonePrivate")
%>'></asp:TextBox><br />
           
            <asp:Label
cssClass="lblIdentifier" ID="lblPhoneMobile" runat="server"
meta:resourcekey="Mobile" />
           
<asp:TextBox cssClass="staff" ID="PhoneMobile" runat="server"
Text='<%# Bind("PersonPhoneMobile")
%>'></asp:TextBox><br />

            <asp:Label
cssClass="lblIdentifier" ID="lblEmail" runat="server"
meta:resourcekey="Email" />
           
<asp:TextBox cssClass="staff" ID="Email" runat="server" Text='<%#
Bind("PersonEmail") %>'></asp:TextBox><br />

           
<asp:LinkButton cssClass="lnkButton" ID="UpdateCancelButton"
runat="server" CausesValidation="False" CommandName="Cancel"
Text="<%$resources:translations,
Cancel%>"></asp:LinkButton>
           
<asp:LinkButton cssClass="lnkButton" ID="UpdateButton"
runat="server" CausesValidation="True" CommandName="Update"
Text="<%$resources:translations,
Update%>"></asp:LinkButton>
        </EditItemTemplate>
        <InsertItemTemplate>
            <asp:Label
cssClass="lblIdentifier" ID="lblLastName" runat="server"
meta:resourcekey="LastName" />
           
<asp:TextBox ID="PersonLastNameTextBox"
runat="server"></asp:TextBox><br />
           
            <asp:Label
cssClass="lblIdentifier" ID="lblFirstName" runat="server"
meta:resourcekey="FirstName" />
           
<asp:TextBox ID="PersonFirstNameTextBox"
runat="server"></asp:TextBox><br />
           
            <asp:Label
cssClass="lblIdentifier" ID="lblBuilding" runat="server"
meta:resourcekey="Building" />
           
<asp:TextBox ID="BuildingAbbreviationTextBox"
runat="server"></asp:TextBox><br />
           
            <asp:Label
cssClass="lblIdentifier" ID="lblRoom" runat="server"
meta:resourcekey="Room" />
           
<asp:TextBox ID="RoomNameTextBox"
runat="server"></asp:TextBox><br />
           
           
<asp:LinkButton cssClass="lnkButton" ID="InsertCancelButton"
runat="server" CausesValidation="False" CommandName="Cancel"
Text="<%$resources:translations,
Cancel%>"></asp:LinkButton>
           
<asp:LinkButton cssClass="lnkButton" ID="InsertButton"
runat="server" CausesValidation="True" CommandName="Insert"
Text="<%$resources:translations,
Insert%>"></asp:LinkButton>
        </InsertItemTemplate>
        <ItemTemplate>
            <asp:Label
cssClass="lblIdentifier" ID="lblLastName" runat="server"
meta:resourcekey="LastName" />
            <asp:Label
cssClass="lblValue" ID="PersonLastNameLabel" runat="server"
Text='<%# Bind("PersonLastName") %>'></asp:Label><br
/>

            <asp:Label
cssClass="lblIdentifier" ID="lblFirstName" runat="server"
meta:resourcekey="FirstName" />
            <asp:Label
cssClass="lblValue" ID="PersonFirstNameLabel" runat="server"
Text='<%# Bind("PersonFirstName") %>'></asp:Label><br
/>

            <asp:Label
cssClass="lblIdentifier" ID="lblBuilding" runat="server"
meta:resourcekey="Building" />
            <asp:Label
cssClass="lblValue" ID="BuildingAbbreviationLabel" runat="server"
Text='<%# Bind("BuildingAbbreviation")
%>'></asp:Label><br />

            <asp:Label
cssClass="lblIdentifier" ID="lblRoom" runat="server"
meta:resourcekey="Room" />
            <asp:Label
cssClass="lblValue" ID="RoomLabel" runat="server" Text='<%#
Bind("RoomName") %>'></asp:Label><br />

            <asp:Label
cssClass="lblIdentifier" ID="lblPhone" runat="server"
meta:resourcekey="Phone" />
            <asp:Label
cssClass="lblValue" ID="PhoneLabel" runat="server" Text='<%#
Bind("PersonPhone") %>'></asp:Label><br />

            <asp:Label
cssClass="lblIdentifier" ID="lplPhonePrivate" runat="server"
meta:resourcekey="Private" />
            <asp:Label
cssClass="lblValue" ID="PhonePrivateLabel" runat="server" Text='<%#
Bind("PersonPhonePrivate") %>'></asp:Label><br />

            <asp:Label
cssClass="lblIdentifier" ID="lblPhoneMobile" runat="server"
meta:resourcekey="Mobile" />
            <asp:Label
cssClass="lblValue" ID="PhoneMobileLabel" runat="server" Text='<%#
Bind("PersonPhoneMobile") %>'></asp:Label><br />

            <asp:Label
cssClass="lblIdentifier" ID="lblEmail" runat="server"
meta:resourcekey="Email" />
            <asp:Label
cssClass="lblValue" ID="EmailLabel" runat="server" Text='<%#
Bind("PersonEmail") %>'></asp:Label><br />
           
           
<asp:LinkButton cssClass="lnkButton" ID="DeleteButton"
runat="server" CausesValidation="False" CommandName="Delete"
Text="<%$resources:translations,
Delete%>"></asp:LinkButton>
           
<asp:LinkButton cssClass="lnkButton" ID="EditButton" runat="server"
CausesValidation="False" CommandName="Edit"
Text="<%$resources:translations,
Edit%>"></asp:LinkButton>
        </ItemTemplate>
    </asp:FormView>
</asp:Content>


And then once again a totally different question: Is there a way to
post the highlighted aspx or vb code into this forum and keep the
colors? i think I've seen that in some posts but didn't wanna do it
manually.

Thanks once again for trying to help,

Toob

View 1 Replies View Related

ADO Error: An Insufficient Number Of Arguments....

Nov 5, 2007



Im currently using Access 2000 which is connected to a SQL database. I have a query (Or View) that runs every month. The problem i had was i had to manually make some changes every month to get to the data i needed so i changed this View into a Function with a parameter so i can input the detail(s) i need and it will run correctly - this works so far but the original View was also used within other queries that were created. Now the problem i have now is some of the other views that are now connected with the newly created Function comes up with the error:

ADO error: an insufficient number of arguments were supplied for the procedure or function Name_Of_Function.

I called the newly created function the exact name as the original view to ensure i had no problems. Any idea of whats happening here and how to resolve?

Thanks

View 12 Replies View Related

Error Using Linq Response.BinaryWrite For Images Stored In The Database

Mar 1, 2008

 
 hi i have given you the ado.net code to retrive a image from the database.
I have tried using linq and i am getting a error in
Response.BinaryWrite(rs.image) in LINQ.
so i have used the ado.net which i dont want to use.
can you pls help me how to correct the error.it says cannot convert linq.binary data...
thanks
 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyReader As SqlDataReaderDim MySqlConnection As SqlConnection
Dim MySqlCommand As SqlCommandMySqlConnection = New SqlConnection("server=(local)SQLExpress;Integrated Security=SSPI;database=customs")MySqlCommand = New SqlCommand("select * from tbl_temp_importer_owner where TIN=555", MySqlConnection)
 
MySqlConnection.Open()
MyReader = MySqlCommand.ExecuteReader()Do While (MyReader.Read())
Response.ContentType = MyReader.Item("PersonImageType")Response.BinaryWrite(MyReader.Item("PersonImage"))///Error come here in linq
Loop
MySqlConnection.Close()Response.Write("Person info successfully retrieved!")
 
End Sub

View 4 Replies View Related

ERROR: Too Many Arguments Passed To Stored Procedure

Jan 22, 2002

Hi,

We have an application written in ASP that calls a MS-SQL stored procedure and passes several parameters. Once in a while, we get this error, but most of the time it works. We can also run this in SQL query analyzer without ever a problem. We've looked at the obvious and found nothing wrong.

Please help! Any suggestions are appreciated.
(I posted this in ASP discussion board but no one replied)

Colleen

--------------------------------------------------------------------------------


|

View 1 Replies View Related

Procedure Or Function Sp_AddDealer Has Too Many Arguments Specified (error Via SqlDataSource)

Apr 9, 2007

Procedure or function sp_AddDealer has too many arguments specified.
I am experiencing the 'too many arguments specified' error.  I am running on SQL 2005.  The Parameters lists on SQL server (when I view a dropdown under the sp name) shows a 'returns integer'  (but without the @ the signifies a parameter).I have looked around the forums and haven't seen quite this flavor of this error.  My forehead is sore from beating it against the wall... any clue would be appreciated!
The error occurs when I click the 'new' link button, enter some data and then click the update link button after ... BOOM - Procedure or function sp_AddDealer has too many arguments specified.
Thanks!!
Chip Kigar
Here is the stored Procedure:

set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo
ALTER PROCEDURE [dbo].[sp_AddDealer]  @sCarcareSystem varchar(100), @sDealerName varchar(50), @sDealerPhysAddrStreet varchar(200), @sDealerPhysAddrCity varchar(100), @sDealerPhysAddrState varchar(10), @sDealerPhysAddrZip varchar(20), @nReturnCode bigint output, @nReturnId bigint output AS
 SET NOCOUNT ON  DECLARE @m_nCt bigint  SET @nReturnCode = 0 SET @nReturnId = 0
 -- VALIDATE IF (@nReturnCode = 0) BEGIN  SELECT   @m_nCt = COUNT(tblDealers.[_DealerId])   FROM    tblDealers    WHERE   [Dealer Name] = @sDealerName   IF (@m_nCt >0)  BEGIN   SET @nReturnCode = -2000 --'Error for exsiting Dealer'   SET @nReturnId = 0  END END
 -- PROCESS IF (@nReturnCode = 0) BEGIN  SET @nReturnCode = -2 --' Error getting new record id'  DECLARE @m_nNewRecId bigint  SET @m_nNewRecId = 0  EXEC sp_GetNewRecId @m_nNewRecId output  IF (@m_nNewRecId > 0)  BEGIN   SET @nReturnCode = -1 --'Error adding Dealer'   INSERT INTO     tblDealers    (    [_DealerId],    [Carcare System],    [Dealer Name],    [Dealer Phys Addr Street],    [Dealer Phys Addr City],    [Dealer Phys Addr State],    [Dealer Phys Addr Zip]    )    VALUES    (    @m_nNewRecId,    @sCarcareSystem,    @sDealerName,    @sDealerPhysAddrStreet,    @sDealerPhysAddrCity,    @sDealerPhysAddrState,    @sDealerPhysAddrZip    )    SET @nReturnCode = 0 --'Success'   SET @nReturnId = @m_nNewRecId
   END  END
 
Here is the SQLDataSource.  I plugged the ID parameter, so I got a schema back, but no data.


    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"        InsertCommand="sp_AddDealer" InsertCommandType="StoredProcedure"         SelectCommand="sp_GetDealerByDealerId"   SelectCommandType="StoredProcedure">        <SelectParameters>            <asp:Parameter DefaultValue="2" Name="nDealerId" Type="Int64" />            <asp:Parameter DefaultValue="" Direction="Output" Name="nReturnCode" Type="Int64" />            <asp:Parameter Direction="Output" Name="nReturnId" Type="Int64" />        </SelectParameters>        <InsertParameters>            <asp:Parameter Name="sCarcareSystem" Type="String" />            <asp:Parameter Name="sDealerName" Type="String" />            <asp:Parameter Name="sDealerPhysAddrStreet" Type="String" />            <asp:Parameter Name="sDealerPhysAddrCity" Type="String" />            <asp:Parameter Name="sDealerPhysAddrState" Type="String" />            <asp:Parameter Name="sDealerPhysAddrZip" Type="String" />            <asp:Parameter Direction="InputOutput" Name="nReturnCode" Type="Int64" />            <asp:Parameter Direction="InputOutput" Name="nReturnId" Type="Int64" />        </InsertParameters>    </asp:SqlDataSource>
Here is the Formview:

    <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1">        <EditItemTemplate>            _DealerId:            <asp:TextBox ID="_DealerIdTextBox" runat="server" Text='<%# Bind("_DealerId") %>'>            </asp:TextBox><br />            Carcare System:            <asp:TextBox ID="Carcare_SystemTextBox" runat="server" Text='<%# Bind("[Carcare System]") %>'>            </asp:TextBox><br />            Dealer Name:            <asp:TextBox ID="Dealer_NameTextBox" runat="server" Text='<%# Bind("[Dealer Name]") %>'>            </asp:TextBox><br />            Address Street:            <asp:TextBox ID="Address_StreetTextBox" runat="server" Text='<%# Bind("[Address Street]") %>'>            </asp:TextBox><br />            Address City:            <asp:TextBox ID="Address_CityTextBox" runat="server" Text='<%# Bind("[Address City]") %>'>            </asp:TextBox><br />            Address State:            <asp:TextBox ID="Address_StateTextBox" runat="server" Text='<%# Bind("[Address State]") %>'>            </asp:TextBox><br />            Address Zip:            <asp:TextBox ID="Address_ZipTextBox" runat="server" Text='<%# Bind("[Address Zip]") %>'>            </asp:TextBox><br />            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"                Text="Update">            </asp:LinkButton>            <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"                Text="Cancel">            </asp:LinkButton>        </EditItemTemplate>        <InsertItemTemplate>            _DealerId:            <asp:TextBox ID="_DealerIdTextBox" runat="server" Text='<%# Bind("_DealerId") %>'>            </asp:TextBox><br />            Carcare System:            <asp:TextBox ID="Carcare_SystemTextBox" runat="server" Text='<%# Bind("[Carcare System]") %>'>            </asp:TextBox><br />            Dealer Name:            <asp:TextBox ID="Dealer_NameTextBox" runat="server" Text='<%# Bind("[Dealer Name]") %>'>            </asp:TextBox><br />            Address Street:            <asp:TextBox ID="Address_StreetTextBox" runat="server" Text='<%# Bind("[Address Street]") %>'>            </asp:TextBox><br />            Address City:            <asp:TextBox ID="Address_CityTextBox" runat="server" Text='<%# Bind("[Address City]") %>'>            </asp:TextBox><br />            Address State:            <asp:TextBox ID="Address_StateTextBox" runat="server" Text='<%# Bind("[Address State]") %>'>            </asp:TextBox><br />            Address Zip:            <asp:TextBox ID="Address_ZipTextBox" runat="server" Text='<%# Bind("[Address Zip]") %>'>            </asp:TextBox><br />            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"                Text="Insert">            </asp:LinkButton>            <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"                Text="Cancel">            </asp:LinkButton>        </InsertItemTemplate>        <ItemTemplate>            _DealerId:            <asp:Label ID="_DealerIdLabel" runat="server" Text='<%# Bind("_DealerId") %>'>            </asp:Label><br />            Carcare System:            <asp:Label ID="Carcare_SystemLabel" runat="server" Text='<%# Bind("[Carcare System]") %>'>            </asp:Label><br />            Dealer Name:            <asp:Label ID="Dealer_NameLabel" runat="server" Text='<%# Bind("[Dealer Name]") %>'>            </asp:Label><br />            Address Street:            <asp:Label ID="Address_StreetLabel" runat="server" Text='<%# Bind("[Address Street]") %>'>            </asp:Label><br />            Address City:            <asp:Label ID="Address_CityLabel" runat="server" Text='<%# Bind("[Address City]") %>'>            </asp:Label><br />            Address State:            <asp:Label ID="Address_StateLabel" runat="server" Text='<%# Bind("[Address State]") %>'>            </asp:Label><br />            Address Zip:            <asp:Label ID="Address_ZipLabel" runat="server" Text='<%# Bind("[Address Zip]") %>'>            </asp:Label><br />            <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New"                Text="New">            </asp:LinkButton>        </ItemTemplate>    </asp:FormView>

View 4 Replies View Related

EXEC Sp_insertRecord Has Too Many Arguments Specified: Msg 8144, Level 16, State 2-Why I Got This Error?

Oct 16, 2007

Hi all,
In Object Explorer of my ComputerNameSQLEXPRESS, I have a Database "shcDB" with Table "dbo.MyFriends" which has fields "PersonID" (Int), "FirstName", "LastName", "StreetAddress", "City", "State", "ZipCode", "E-MailAddress" set up. When I executed the following query:
/////----shcSP-1.sql---////
USE shcDB
GO
EXEC sp_insertRecord 3, "Mary", "Smith", "789 New St.", "Chicago", "Illinos", "12345", "M_Smith@Yahoo.com"
GO
/////////////////////////////////////////////////////////////
I got the following error message:
Msg 8144, Level 16, State 2, Procure sp_insertRecord, Line 0
Procedure or Function sp_insertRecord has too many arguments specified.
(1) Why did I get this error?
(2) Where can I get the documents for explaining the procedures like 'sp_insertRecord', 'sp_delecteRocord', 'sp_getRecord', 'sp_updateRecord', etc. and error messages?
Please help and give me the answers for the above-mentioned questions.

Thanks in advance,
Scott Chang

P. S.
I used my PC at home to post the above message. I have not been able to post it by using my office PC in our LAN system. In my office LAN system, I have been struggling to figure out and solve the following strange thing: I log in http://forums.microsoft.com and "Sign Out" is on all the time. If I click on "Sign Out", I get "Logout: You have been successfully logged out of the the forums." page all the time. What is the cause to log me out? How can I get it resolved? Our Computer Administrator? Or Microsoft? What Department in Microsoft can help me to solve this problem? Please advise on this strange thing. Thanks.

View 9 Replies View Related

Error 500 Takes It's Toll

Jun 11, 2007

The Error:

An attempt to attach an auto-named database for file C:UsersCodeFreakDocumentsVisual Studio 2005WebSitesPersonalSiteApp_Dataaspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

---------------------------------------------------------------------------------------------------------------

I've tried allowing permissions I'VE EVEN TRIED ALLOWING EVERYONE! I've tried right clicking the datasource under the datasource explorer and clicking 'detatch.' It works Locally but fails when i pusblish with IIS. Whats with these SQL databases that just dont want to work with IIS 7 ?



Published with: IIS 7

I've tried removing the "user instance."



This is User roles and all that which uses SQL Server 2005.



So my question is, How do i publish a website with SQL Server 2005 database?



Please give it to me step by step as im still quite a newbie.



Thanks in advance

View 5 Replies View Related

Overload Function Call

Aug 1, 2006

Hi,

I want to write one function like that

dbo.function( number , 1 , 2 ) ,

but I would like to overload, and send char or number

dbo.function( number, 'abx' , ' xpto' ).

I would like to keep the same name, Can I do this? or Do I need to write to differents functions



thanks,

View 11 Replies View Related

Error: The ProcessInput Method On Component OLE DB Destination (513) Failed With Error Code 0xC0202009

Mar 22, 2007

I'm trying to create a simple Data transfermation. I have a flat file that came of a unix server.. it's 177 bytes wide.. thought it was 175, but when I created the flat file connector, I could see some extra characters on the end.



My output is going to be an excel spreadsheet, I only want two columns from the input. I created an oledb jet 4.0 connection. and followed instructions from here :

http://aspalliance.com/889_Extracting_Data_from_a_Flat_File_with_SQL_Server_2005_Integration_Services

to create my datafow.



On my first attempt to dataflow, I ran into unicode errors and had to do this:



ran into a problem with unicode errors. went to the source for the flat file. for the output column in question changed to Unicode string [DT_WSTR].



When I run , here are the errors I get:

[OLE DB Destination [513]] Error: An OLE DB error has occurred. Error code: 0x80040E09. [DTS.Pipeline]

Error: The ProcessInput method on component "OLE DB Destination" (513) failed with error code 0xC0202009. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.

[DTS.Pipeline] Error: Thread "WorkThread0" has exited with error code 0xC0202009.

[GanchoFileSource [1]] Information: The total number of data rows processed for file "\ammia01dev04D$JCPcpmgancho_venta_20070321.sal" is 19036.

[GanchoFileSource [1]] Error: Setting the end of rowset for the buffer failed with error code 0xC0047020.

[DTS.Pipeline] Error: The PrimeOutput method on component "GanchoFileSource" (1) returned error code 0xC0209017. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.

[DTS.Pipeline] Error: Thread "SourceThread0" has exited with error code 0xC0047038.


View 4 Replies View Related

Error: Value Does Not Fall Within The Expected Range. Error In Buffer.DirectRow Method

Oct 10, 2006

Hi

I am trying to make a custom task. The custom task has one input, which i map to externalmetadata column in the task and one output.

When i run the task it fails with this error ( I am putting the whole SSIS message)

SSIS package "Package.dtsx" starting.
Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning.
Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning.
Information: 0x40043006 at Data Flow Task, DTS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Data Flow Task, DTS.Pipeline: Pre-Execute phase is beginning.
Information: 0x402090DC at Data Flow Task, Flat File Destination [1855]: The processing of file "C:ole db eft data.txt" has started.
Information: 0x4004300C at Data Flow Task, DTS.Pipeline: Execute phase is beginning.
Error: 0xC0047062 at Data Flow Task, Lib [2387]: System.ArgumentException: Value does not fall within the expected range.
at Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSBuffer90.DirectRow(Int32 hRow, Int32 lOutputID)
at Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer.DirectRow(Int32 outputID)
at Lib1.LibPM.ProcessInput(Int32 inputID, PipelineBuffer buffer)
at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper90 wrapper, Int32 inputID, IDTSBuffer90 pDTSBuffer, IntPtr bufferWirePacket)
Error: 0xC0047022 at Data Flow Task, DTS.Pipeline: The ProcessInput method on component "Lib" (2387) failed with error code 0x80070057. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.
Error: 0xC0047021 at Data Flow Task, DTS.Pipeline: Thread "WorkThread0" has exited with error code 0x80070057.
Error: 0xC0047039 at Data Flow Task, DTS.Pipeline: Thread "WorkThread1" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.
Error: 0xC0047021 at Data Flow Task, DTS.Pipeline: Thread "WorkThread1" has exited with error code 0xC0047039.
Information: 0x40043008 at Data Flow Task, DTS.Pipeline: Post Execute phase is beginning.
Information: 0x402090DD at Data Flow Task, Flat File Destination [1855]: The processing of file "C:ole db eft data.txt" has ended.
Information: 0x40043009 at Data Flow Task, DTS.Pipeline: Cleanup phase is beginning.
Information: 0x4004300B at Data Flow Task, DTS.Pipeline: "component "Flat File Destination" (1855)" wrote 0 rows.
Task failed: Data Flow Task
Warning: 0x80019002 at Package: The Execution method succeeded, but the number of errors raised (5) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "Package.dtsx" finished: Failure.
----------------------------



This is my piece of code which is trying to put the data in the output buffer (ProcessInput function).

int GoodOutputId = -1;

IDTSInput90 inp = ComponentMetaData.InputCollection.GetObjectByID(inputID);

//GetErrorOutputInfo(ref errorOutputID, ref errorOutputIndex);

GoodOutputId = ComponentMetaData.OutputCollection[0].ID;
System.Console.Write("Here i am");
System.Console.Write(GoodOutputId);
if (!buffer.EndOfRowset)
{
while (buffer.NextRow())
{
if (_inputColumnInfos.Length == 0)
{
buffer.DirectRow(GoodOutputId);
}
else
{
buffer.DirectRow(GoodOutputId);
}
}
}

I have put any code in the else part as i am just trying to run the task as of now and later put the functionality in it.

Please let me know if i have missed something. Thanks in advance.

Vipul

View 1 Replies View Related

WWW Service Overload When Trying To Print A Rs2005 Report

Mar 23, 2006

Hi

When I try to print a very simple report with rs2005 via the print button on the http://servername/report/pages/... website, it says "printing" but nothing happend. When I look at the server (win2003 SP1 + latest hotfixes) the www and sql2005 (SP1 CTP installed) services eat up 100% cpu for ever.
I get no error messages neither in the rs log's nor in os application or system log. With profiler I found out, that there must be some loop. The following stored procedure exec DeletePersistedStreams @SessionID='24iumm55mp32l2ie2nezs0y0'is called about 650 times per second, which explain the load. The only way to stop this, is shut down and restart the www service.
This behaviour can be found with all reports.
The call, view and export of the same reports to pdf, xls, ... works without problems.

Any ideas?

Thanks for your help
Peter

View 6 Replies View Related

Why Query Takes 0 Seconds And Stored Procedure Takes 16 Seconds Sql Server 2000

Sep 21, 2007



I have a Stored Procedure that has a query in it and it take 0 second and then a stored procedure that takes 16 seconds. From what I can tell they shoul be the same.

It doesn't recompile when i run the stored procedure, I checked that.

View 8 Replies View Related

DTS Designer Error

May 31, 2001

Hello everybody!
I've already posted this question before but this error never been resolved.
My DTS designer is totally screwed.
When trying to create new local package getting error message "Could not create Component Categories Manager".
I can't even use DTS to copy data in using DTS wizard.
Somebody recommended to reinstall SQL Server which I did but it didn't solve my problem.

Any other suggestions?

Thanks for your help

Lena

View 1 Replies View Related

DTS Designer Error

Dec 1, 2000

When using Enterprise Mgr on a workstation connected to a MSSQL Server, if I attempt to start a new DTS Package, I get the following msg:
Title: DTS Designer Error
Text : Could not create Component Categories Manager

I get the same msg when trying to edit an existing package. I tried to re-register Dtspkg.dll,Dtsui.dll, and dtsffile.dll. All were successful but Dtspkg.dll, which failed. Does anyone know what causes this, and what else I can try?

View 2 Replies View Related

DTS Designer Error

Mar 4, 2004

When I open my DTS package at my PC ( Client ) .There is an error message show like below .

DTR Designer Error.
There was a problem retriving the list of OLE DB providers.

No. Provider is selected .TO continue,you must select a valid provider.


Please help

View 7 Replies View Related

DTS Designer Error-URGENT!

Jul 18, 2001

Hello!
Yesterday my DTS designer was fine and today suddenly when I open the package in designer there is nothing there.
I tried to create new package and it gave me an error when I was trying to save it "It is insufficient disk space to complete operation".

What does this mean?

Thanks

Lena

View 1 Replies View Related

DTS Designer Error In SQL 2000

Oct 19, 2001

I am testing SQL Server 2000 and after having installed it on a machine with SQL 7 already on it everything went OK.

However, if I try to create a DTS package (or open and existing one) on either of my SQL Server instances I get a "DTS Designer Error". After which, the DTS package window opens but I can't see any of the tasks in the tool bar. I can't select any tasks from the Task option in the menu bar either.

Has anyone experienced anything similar? Any suggestions would be appreciated.

Thanks.
Barb

View 2 Replies View Related

DTS Designer Error In SQL 2000

Oct 9, 2000

I am testing SQL Server 2000 and after having installed it on a machine with SQL 7 already on it everything went OK.

However, if I try to create a DTS package (or open and existing one) on either of my SQL Server instances I get a "DTS Designer Error". After which, the DTS package window opens but I can't see any of the tasks in the tool bar. I can't select any tasks from the Task option in the menu bar either.

Has anyone experienced anything similar? Any suggestions would be appreciated.

Regards,

Karl

View 1 Replies View Related

Query Designer Error?

Nov 24, 1999

Hello all

I've got SQL Server 7.0 SP1 installed (in a NT4 SP6 environment).

Recently, it came up with error whenever I try to open a table or a view (return all rows) inside the Enterprise Manager. The descriptive (NOT!) error message is like this:

"The query cannot be executed because some files are either missing or not registered", and on pressing "help",
the help files report
"Query Designer cannot locate your query files and cannot run your query"

I have tried re-booting the machine and upgrading mmc.exe to version 1.2 (from 1.1), but both in vain.

Can anyone shed some lights please?

Simon

View 2 Replies View Related

Query Designer Error

Feb 9, 2001

Checked out BOL on this issue, but not enough info received to troubleshoot. Hoping someone out there has some input.

This issue is only happening on the server side not the client. Also, it suddenly appeared on three different machines.

Query Designer:
"An unexpected error happened during this operation" [Query} - Query Designer encountered a Query error: Unspecified error.

The how: In a database, go to tables and select a table known to have data right click on mouse and select Open Table, return all rows. This is when the error appears.

BOL states the the file may be corrupt or from a non-supported version of SQL Server EM. Nothing was installed on these servers and we're still on SP2. This error just all of a sudden appeared and spread to 3 different machines...

Another issue is the Return to Top function is disabled. This function provides the maximum number of rows to fetch.

Any assistance would be appreciated! Thanks.

View 1 Replies View Related

Query Designer Error

Feb 26, 2001

When I try to Return All Records in a table, I receive the error "Query Designer encountered a query error: unspecified error." I can successfully view the design of the table just not the records themselves. This is happening in all of my tables in all dbases.

Thanks for any suggestions.

View 1 Replies View Related

DTS Designer Gives Error When It Starts

Jul 10, 2002

Thanks in advance for any help you may offer.

I have never seen this error before... When I click on DTS to either open an existing package or create a new one I get the following errors: Error in the DLL, DTS Design Error. When I try to create a new DTS it gives me the errors but still opens but I'm missing all of the connection objects except for MS data link and other connection. I had no problems designing and executing the packages from a development box. I'm not even refering to the typical scheduling problems that exist when SQL Agent is configured incorrectly!

View 2 Replies View Related







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