Showing posts with label resolve. Show all posts
Showing posts with label resolve. Show all posts

Monday, March 26, 2012

error parsing the query

hi all

I try to run the query below it throw me an exception, error parsing , is there anywat to resolve it?

SELECT TYPE2.list_price as 'TYPE2'
FROM TBL_MST_PRICE TYPE2
WHERE
price_grp_code = (SELECT price_grp_code FROM TBL_MST_PRICE_GRP WHERE prd_code = '' AND cust_code = '')

Sub-selects (nested select statements) are not supported by SQL CE. You will have to rephrase your query to use a join or use 2 select statements.

Monday, March 19, 2012

error on building up where clause statement

how can I resolve this error message coming from the line of code used to
build up a whereclause ?
error message
--
syntax error converting the varchar value ' and IDUser >= 1 ' to a column of
data type int
sproc
--
...
IF @.ClientID <> -1 BEGIN SET @.WhereClause = @.WhereClause + ' and IDuser = '
+ @.ClientID END
IF @.ClientID = -1 BEGIN SET @.WhereClause = @.WhereClause + ' and IDuser >= 1
' END
...SQL Server thinks that you want to mathematical add two numbers together
because there is a INT in the addition. To Keep sure to concat the two
strings together you have to cast the INT value to a character type like
varchar(10), so the whole expression should be:

> IF @.ClientID <> -1 BEGIN SET @.WhereClause = @.WhereClause + ' and IDuser =
> ' + CAST(@.ClientID AS VARCHAR(50)) END
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"TJS" <nospam@.here.com> schrieb im Newsbeitrag
news:e9a6rJuaFHA.584@.TK2MSFTNGP15.phx.gbl...
> how can I resolve this error message coming from the line of code used to
> build up a whereclause ?
> error message
> --
> syntax error converting the varchar value ' and IDUser >= 1 ' to a column
> of data type int
> sproc
> --
> ...
> IF @.ClientID <> -1 BEGIN SET @.WhereClause = @.WhereClause + ' and IDuser =
> ' + @.ClientID END
> IF @.ClientID = -1 BEGIN SET @.WhereClause = @.WhereClause + ' and IDuser >=
> 1 ' END
> ...
>|||thanks for replying, I tried your suggestion but I still get the same error
"Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote in
message news:e5hlJguaFHA.3572@.TK2MSFTNGP12.phx.gbl...
> SQL Server thinks that you want to mathematical add two numbers together
> because there is a INT in the addition. To Keep sure to concat the two
> strings together you have to cast the INT value to a character type like
> varchar(10), so the whole expression should be:
>
> --
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "TJS" <nospam@.here.com> schrieb im Newsbeitrag
> news:e9a6rJuaFHA.584@.TK2MSFTNGP15.phx.gbl...
>|||Can you send in he whole statements and the exact error to see where the
Parser throws the error ?
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"TJS" <nospam@.here.com> schrieb im Newsbeitrag
news:OKz0PDvaFHA.2768@.tk2msftngp13.phx.gbl...
> thanks for replying, I tried your suggestion but I still get the same
> error
>
> "Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote
> in message news:e5hlJguaFHA.3572@.TK2MSFTNGP12.phx.gbl...
>|||Could it be that @.WhereClause is declared as integer?
Ral Moloye|||here is current version, the purpose of the sproc is to return a list if
matching record id's
based on filter parameters provided.
========================================
============================
Alter Procedure "ListID"
(
@.admin nvarchar(10),
@.YearID int,
@.ClientID int,
@.ProjectID int
)
As
DECLARE @.List varchar(100)
DECLARE @.WhereClause nvarchar (1000)
DECLARE @.CastString1 varchar (50)
DECLARE @.CastString2 varchar (50)
SET @.WhereClause=''
SET @.CastString1 = ' and IDuser >= ' + CAST(@.ClientID AS VARCHAR(50))
SET @.CastString2 = ' and IDuser = ' + CAST(@.ClientID AS VARCHAR(50))
-- Define the selection criteria for client depending on whether or not
user is an admin
-- ----
---
IF @.admin = 'true' and @.ClientID = -1 BEGIN SET @.WhereClause =
@.WhereClause + @.CastString1 END
IF @.admin = 'true' and @.ClientID <> -1 BEGIN SET @.WhereClause =
@.WhereClause + @.CastString2 END
IF @.admin = 'false' BEGIN SET @.WhereClause = @.WhereClause +
@.CastString2 END
-- Define the selection criteria for selections of project and year
-- ----
---
IF @.ProjectID <> -1 BEGIN SET @.WhereClause = @.WhereClause + ' and IDProject
= ' + @.ProjectID END
IF @.YearID <> -1 BEGIN SET @.WhereClause = @.WhereClause + ' and
year(issueDate) = ' + @.YearID END
-- retrieve selection
-- ----
---
SELECT @.List = COALESCE(@.List + ', ', '') + CAST(InvoiceID AS varchar(5))
FROM invoices, Projects
WHERE Projects.ProjectID = Invoices.IDProject + @.WhereClause
-- return results
-- ----
---
SELECT @.List|||Everywhere where a INt takes place (doesntmatter if you declared it in your
procedure or you get it from the database) and you want to add it to the
string, SQL Server will try to do a methematical addition to the strings
which wont work, so you will have to replace that in your whole code (e.g.
For YearID, projectId ...)
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"TJS" <nospam@.here.com> schrieb im Newsbeitrag
news:uVOaKl4aFHA.3840@.tk2msftngp13.phx.gbl...
> here is current version, the purpose of the sproc is to return a list if
> matching record id's
> based on filter parameters provided.
> ========================================
============================
> Alter Procedure "ListID"
> (
> @.admin nvarchar(10),
> @.YearID int,
> @.ClientID int,
> @.ProjectID int
> )
> As
> DECLARE @.List varchar(100)
> DECLARE @.WhereClause nvarchar (1000)
> DECLARE @.CastString1 varchar (50)
> DECLARE @.CastString2 varchar (50)
> SET @.WhereClause=''
> SET @.CastString1 = ' and IDuser >= ' + CAST(@.ClientID AS VARCHAR(50))
> SET @.CastString2 = ' and IDuser = ' + CAST(@.ClientID AS VARCHAR(50))
> -- Define the selection criteria for client depending on whether or not
> user is an admin
> -- ----
---
> IF @.admin = 'true' and @.ClientID = -1 BEGIN SET @.WhereClause =
> @.WhereClause + @.CastString1 END
> IF @.admin = 'true' and @.ClientID <> -1 BEGIN SET @.WhereClause =
> @.WhereClause + @.CastString2 END
> IF @.admin = 'false' BEGIN SET @.WhereClause = @.WhereClause +
> @.CastString2 END
> -- Define the selection criteria for selections of project and year
> -- ----
---
> IF @.ProjectID <> -1 BEGIN SET @.WhereClause = @.WhereClause + ' and
> IDProject = ' + @.ProjectID END
> IF @.YearID <> -1 BEGIN SET @.WhereClause = @.WhereClause + ' and
> year(issueDate) = ' + @.YearID END
> -- retrieve selection
> -- ----
---
> SELECT @.List = COALESCE(@.List + ', ', '') + CAST(InvoiceID AS varchar(5))
> FROM invoices, Projects
> WHERE Projects.ProjectID = Invoices.IDProject + @.WhereClause
> -- return results
> -- ----
---
> SELECT @.List
>

Friday, March 9, 2012

Error Msg

How do I resolve the following error message and what does this mean?
c:\srsconv\visual studio
projects\china\china_reports\All_Official_Representatives_China.rdl The value
expression for the textbox â'ADDR_Org_Name_2â' contains an error: [BC30311]
Value of type
'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.Field' cannot
be converted to 'String'.What does the expression in textbox ADDR_Org_Name_2 contain?
"Terry" wrote:
> How do I resolve the following error message and what does this mean?
> c:\srsconv\visual studio
> projects\china\china_reports\All_Official_Representatives_China.rdl The value
> expression for the textbox â'ADDR_Org_Name_2â' contains an error: [BC30311]
> Value of type
> 'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.Field' cannot
> be converted to 'String'.
>|||The error was resolved. The error was due to implemented custom code.
Thank you for your speedy response.
However, do you know how I could setup a mailing list across 3 columns?
"Ben Sullins" wrote:
> What does the expression in textbox ADDR_Org_Name_2 contain?
> "Terry" wrote:
> > How do I resolve the following error message and what does this mean?
> >
> > c:\srsconv\visual studio
> > projects\china\china_reports\All_Official_Representatives_China.rdl The value
> > expression for the textbox â'ADDR_Org_Name_2â' contains an error: [BC30311]
> > Value of type
> > 'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.Field' cannot
> > be converted to 'String'.
> >|||Terry wrote: However, do you know how I could setup a mailing list across 3
columns?
From MSDN Reporting Services BOL:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSCREATE/htm/rcr_creating_layout_v1_4uwj.asp
You will need to render the using Print Preview, PDF, or TIFF to actually
see the multiple columns.
Also pay attention to the relationship between the PageWidth + Left / Right
Margins and the #Columns, ColumnWidth, and the Column Spacing:
PageWidth - Left Margin - Right Marging >= (#Columns * ColumnWidth) +
((#Columns -1) * Column Spacing).
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Terry" <Terry@.discussions.microsoft.com> wrote in message
news:DC8F187E-B492-4DDA-BB91-4BE8BB4658B9@.microsoft.com...
> The error was resolved. The error was due to implemented custom code.
> Thank you for your speedy response.
> However, do you know how I could setup a mailing list across 3 columns?
>
> "Ben Sullins" wrote:
>> What does the expression in textbox ADDR_Org_Name_2 contain?
>> "Terry" wrote:
>> > How do I resolve the following error message and what does this mean?
>> >
>> > c:\srsconv\visual studio
>> > projects\china\china_reports\All_Official_Representatives_China.rdl The
>> > value
>> > expression for the textbox 'ADDR_Org_Name_2' contains an error:
>> > [BC30311]
>> > Value of type
>> > 'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.Field'
>> > cannot
>> > be converted to 'String'.
>> >|||Thank you very much for your assistance.
I will try the solution provided and let you know its results.
Again, thanks!
"Bruce Johnson [MSFT]" wrote:
> Terry wrote: However, do you know how I could setup a mailing list across 3
> columns?
> From MSDN Reporting Services BOL:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSCREATE/htm/rcr_creating_layout_v1_4uwj.asp
> You will need to render the using Print Preview, PDF, or TIFF to actually
> see the multiple columns.
> Also pay attention to the relationship between the PageWidth + Left / Right
> Margins and the #Columns, ColumnWidth, and the Column Spacing:
> PageWidth - Left Margin - Right Marging >= (#Columns * ColumnWidth) +
> ((#Columns -1) * Column Spacing).
>
> --
> Bruce Johnson [MSFT]
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Terry" <Terry@.discussions.microsoft.com> wrote in message
> news:DC8F187E-B492-4DDA-BB91-4BE8BB4658B9@.microsoft.com...
> > The error was resolved. The error was due to implemented custom code.
> >
> > Thank you for your speedy response.
> >
> > However, do you know how I could setup a mailing list across 3 columns?
> >
> >
> > "Ben Sullins" wrote:
> >
> >> What does the expression in textbox ADDR_Org_Name_2 contain?
> >>
> >> "Terry" wrote:
> >>
> >> > How do I resolve the following error message and what does this mean?
> >> >
> >> > c:\srsconv\visual studio
> >> > projects\china\china_reports\All_Official_Representatives_China.rdl The
> >> > value
> >> > expression for the textbox 'ADDR_Org_Name_2' contains an error:
> >> > [BC30311]
> >> > Value of type
> >> > 'Microsoft.ReportingServices.ReportProcessing.ReportObjectModel.Field'
> >> > cannot
> >> > be converted to 'String'.
> >> >
>
>

Friday, February 24, 2012

Error message question..

I am getting the error message
Procedure or function sp_MSaddinitialarticle has too many arguments specified. The step failed.
Please help me resolve this issue (The knowledge base did not have any relevent information).
Thank you for a quick response,
Carl
You are trying to put more arguments to a
procedure or funtion than it needs.
for example: (psuedo code)
sp_myproc @.A, @.B, @.C
and then you
EXEC sp_myproc 1, 2, 3, 4
would get you the error because you
have too many arguments (4) for the
procedure (3)
Bob M.
"Carl" <Carl@.discussions.microsoft.com> wrote in message
news:AB31BB38-3C7A-4772-93C4-6E453ACC3C63@.microsoft.com...
> I am getting the error message
> Procedure or function sp_MSaddinitialarticle has too many arguments
specified. The step failed.
> Please help me resolve this issue (The knowledge base did not have any
relevent information).
> Thank you for a quick response,
> Carl
|||Carl,
Whats the SQLServer edition and service pack?
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"Carl" <Carl@.discussions.microsoft.com> wrote in message
news:AB31BB38-3C7A-4772-93C4-6E453ACC3C63@.microsoft.com...
> I am getting the error message
> Procedure or function sp_MSaddinitialarticle has too many arguments
specified. The step failed.
> Please help me resolve this issue (The knowledge base did not have any
relevent information).
> Thank you for a quick response,
> Carl

Error message question..

I am getting the error message
Procedure or function sp_MSaddinitialarticle has too many arguments specifie
d. The step failed.
Please help me resolve this issue (The knowledge base did not have any relev
ent information).
Thank you for a quick response,
CarlYou are trying to put more arguments to a
procedure or funtion than it needs.
for example: (psuedo code)
sp_myproc @.A, @.B, @.C
and then you
EXEC sp_myproc 1, 2, 3, 4
would get you the error because you
have too many arguments (4) for the
procedure (3)
Bob M.
"Carl" <Carl@.discussions.microsoft.com> wrote in message
news:AB31BB38-3C7A-4772-93C4-6E453ACC3C63@.microsoft.com...
> I am getting the error message
> Procedure or function sp_MSaddinitialarticle has too many arguments
specified. The step failed.
> Please help me resolve this issue (The knowledge base did not have any
relevent information).
> Thank you for a quick response,
> Carl|||Carl,
Whats the SQLServer edition and service pack?
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Carl" <Carl@.discussions.microsoft.com> wrote in message
news:AB31BB38-3C7A-4772-93C4-6E453ACC3C63@.microsoft.com...
> I am getting the error message
> Procedure or function sp_MSaddinitialarticle has too many arguments
specified. The step failed.
> Please help me resolve this issue (The knowledge base did not have any
relevent information).
> Thank you for a quick response,
> Carl

Error message question..

I am getting the error message
Procedure or function sp_MSaddinitialarticle has too many arguments specified. The step failed.
Please help me resolve this issue (The knowledge base did not have any relevent information).
Thank you for a quick response,
CarlYou are trying to put more arguments to a
procedure or funtion than it needs.
for example: (psuedo code)
sp_myproc @.A, @.B, @.C
and then you
EXEC sp_myproc 1, 2, 3, 4
would get you the error because you
have too many arguments (4) for the
procedure (3)
Bob M.
"Carl" <Carl@.discussions.microsoft.com> wrote in message
news:AB31BB38-3C7A-4772-93C4-6E453ACC3C63@.microsoft.com...
> I am getting the error message
> Procedure or function sp_MSaddinitialarticle has too many arguments
specified. The step failed.
> Please help me resolve this issue (The knowledge base did not have any
relevent information).
> Thank you for a quick response,
> Carl|||Carl,
Whats the SQLServer edition and service pack?
--
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Carl" <Carl@.discussions.microsoft.com> wrote in message
news:AB31BB38-3C7A-4772-93C4-6E453ACC3C63@.microsoft.com...
> I am getting the error message
> Procedure or function sp_MSaddinitialarticle has too many arguments
specified. The step failed.
> Please help me resolve this issue (The knowledge base did not have any
relevent information).
> Thank you for a quick response,
> Carl

Wednesday, February 15, 2012

Error message

Hello,

When I try to run a query on a server, I get the following error:

"Cannot resolve collation conflict for equal to operation."

The same query, but on another server works without any problems.

Any idea how I can resolve this?You are joining two different coallations which each other. To solve the collation conflict you will have to either change the collation on the server / database / table / or expression server you are using (whereas the latter is the quickfix for your problem. It has be to implemented whereever you are joining different collations:

select ca.account_status, cs.code from customer as ca
inner join v_customer_status as cs on ca.account_status = cs.description COLLATE SQL_Latin1_General_CP1_CI_AI

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||Thanks Jens.

But the query contains tables of the same database.|||That is not just related to different databases. Also just columns within a table can have a different collation. QUery the INFORMATION_SCHEMA.Columns to see which Collation they have and use the mentioned keyword and syntax to use a common collation.

HTH, Jens.|||txs Jens.

I saw some different entries in the syscolumns under the field collation.
Unfortunately I cannot change the collation name.

What can I do (apart from changing my queries)?|||Is there any specific reason why you have different collation settings for tables in the same database? Unless you're willing to "sweat it out" the easiest way is to change the collation settings of one table to be the same as the other.|||I copied the tables from another server, apparently with a different collation setting.

How can I change this setting per table?|||I think there is no command for changing every column within the table. YOu will have to change this by column with the command:

ALTER TABLE <tablename> ALTER COLUMN colname <datatype> COLLATE <collationname>

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de