Showing posts with label message. Show all posts
Showing posts with label message. Show all posts

Thursday, March 29, 2012

ECall Methods

When trying to Connect to MS SQL Server 2005 through SQL Server management Studio I get an error message as follows:

ECall methods must be packaged into a system module. (mscorlib)

Visual Studio .NET 2005 is installed on the same system as this is a development workstation.

I have no idea what is causing this and any help would be much appreciated.

If you require any further details as to the nature of this, please let me know.

Thanks

Brendan

Hi Brendan,

I have exactly the same error wen trying to connect SQL Server 2005 in SQL Server management Studio.

Did you find the solution Brendan?

Thanks,

Vlad

|||

Brendan, Vlad,

Ditto for me. I was just upgrading to SP2 and now I have this problem. I'm working with tech support to resolve it. I've already removed the Workstation Components (as they suggested), but that did not help.

I'll post any solution that I find - assume you'll do the same Smile

Coston

|||

Just to let you guys know the solution I used in resolving this problem.

I had to uninstall and reinstall .NET 1.1 and 2.0 frameworks.

Then I applied their service packs and ran the add and remove program to

repair the .NET 2.0 framework.

I can now connect successfully to all the sql server databases using management studio.

ECall Methods

When trying to Connect to MS SQL Server 2005 through SQL Server management Studio I get an error message as follows:

ECall methods must be packaged into a system module. (mscorlib)

Visual Studio .NET 2005 is installed on the same system as this is a development workstation.

I have no idea what is causing this and any help would be much appreciated.

If you require any further details as to the nature of this, please let me know.

Thanks

Brendan

Hi Brendan,

I have exactly the same error wen trying to connect SQL Server 2005 in SQL Server management Studio.

Did you find the solution Brendan?

Thanks,

Vlad

|||

Brendan, Vlad,

Ditto for me. I was just upgrading to SP2 and now I have this problem. I'm working with tech support to resolve it. I've already removed the Workstation Components (as they suggested), but that did not help.

I'll post any solution that I find - assume you'll do the same Smile

Coston

|||

Just to let you guys know the solution I used in resolving this problem.

I had to uninstall and reinstall .NET 1.1 and 2.0 frameworks.

Then I applied their service packs and ran the add and remove program to

repair the .NET 2.0 framework.

I can now connect successfully to all the sql server databases using management studio.

ECall Methods

When trying to Connect to MS SQL Server 2005 through SQL Server management Studio I get an error message as follows:

ECall methods must be packaged into a system module. (mscorlib)

Visual Studio .NET 2005 is installed on the same system as this is a development workstation.

I have no idea what is causing this and any help would be much appreciated.

If you require any further details as to the nature of this, please let me know.

Thanks

Brendan

Hi Brendan,

I have exactly the same error wen trying to connect SQL Server 2005 in SQL Server management Studio.

Did you find the solution Brendan?

Thanks,

Vlad

|||

Brendan, Vlad,

Ditto for me. I was just upgrading to SP2 and now I have this problem. I'm working with tech support to resolve it. I've already removed the Workstation Components (as they suggested), but that did not help.

I'll post any solution that I find - assume you'll do the same Smile

Coston

|||

Just to let you guys know the solution I used in resolving this problem.

I had to uninstall and reinstall .NET 1.1 and 2.0 frameworks.

Then I applied their service packs and ran the add and remove program to

repair the .NET 2.0 framework.

I can now connect successfully to all the sql server databases using management studio.

|||Repair install of .NET framework 2.0 solved this issue for me as well.

ECall Methods

When trying to Connect to MS SQL Server 2005 through SQL Server management Studio I get an error message as follows:

ECall methods must be packaged into a system module. (mscorlib)

Visual Studio .NET 2005 is installed on the same system as this is a development workstation.

I have no idea what is causing this and any help would be much appreciated.

If you require any further details as to the nature of this, please let me know.

Thanks

Brendan

Hi Brendan,

I have exactly the same error wen trying to connect SQL Server 2005 in SQL Server management Studio.

Did you find the solution Brendan?

Thanks,

Vlad

|||

Brendan, Vlad,

Ditto for me. I was just upgrading to SP2 and now I have this problem. I'm working with tech support to resolve it. I've already removed the Workstation Components (as they suggested), but that did not help.

I'll post any solution that I find - assume you'll do the same Smile

Coston

|||

Just to let you guys know the solution I used in resolving this problem.

I had to uninstall and reinstall .NET 1.1 and 2.0 frameworks.

Then I applied their service packs and ran the add and remove program to

repair the .NET 2.0 framework.

I can now connect successfully to all the sql server databases using management studio.

sql

Wednesday, March 21, 2012

Dyncamic SQL

Hi
I am trying to populate a Temp table with dynamic SQL but it does not seem
to work and the error message returned is that is it an invalid object,
leading me to believe that it does not get created:
-- ****************************************
********
USE Pubs
GO
SET @.SQLString = ' SELECT * INTO #TempParamFilter FROM Authors '
EXEC (@.SQLString)
SELECT * FROM #TempParamFilter
-- ****************************************
********
Is there something wrong with my syntax?
Kind Regards
RickyThe problem is SCOPE. The # temp table you created goes away after the
dynamic SQL finishes executing. Based on what you posted, you don't even
need dynamic SQL to do this particular job:
USE Pubs
GO
SELECT * INTO #TempParamFilter FROM Authors
SELECT * FROM #TempParamFilter
DROP TABLE #TempParamFilter
"Ricky" <ricky@.msn.com> wrote in message
news:eFBaWbVkGHA.1260@.TK2MSFTNGP05.phx.gbl...
> Hi
> I am trying to populate a Temp table with dynamic SQL but it does not seem
> to work and the error message returned is that is it an invalid object,
> leading me to believe that it does not get created:
> -- ****************************************
********
> USE Pubs
> GO
> SET @.SQLString = ' SELECT * INTO #TempParamFilter FROM Authors '
> EXEC (@.SQLString)
> SELECT * FROM #TempParamFilter
>
> -- ****************************************
********
> Is there something wrong with my syntax?
> Kind Regards
> Ricky
>|||Hi Mike
It was a simple example, I should have posted the real situation. What I am
really trying to achieve is a dynamic WHERE clause, appended to a table and
then populate a temporary table. Is this possible.
I mention Dynamic WHERE clause, since the Column may change, depending on
the parameter supplied.
e.g
@.StockParam = 'Q1HTS'
then WHERE clause would be : WHERE QStock = @.StockParam
or
@.StockParam = 'T1HTS'
then WHERE clause would be : WHERE AlphaStock = @.StockParam
so what I thought about doing, was to have my basic select statement and
then append a dynamic WHERE clause as a variable and then populate a #Table
to SELECT from , later when compiling the final recordset.
Hope this makes sense.
Kind Regards
Ricky
"Mike C#" <xyz@.xyz.com> wrote in message
news:ePpmqeVkGHA.4304@.TK2MSFTNGP03.phx.gbl...
> The problem is SCOPE. The # temp table you created goes away after the
> dynamic SQL finishes executing. Based on what you posted, you don't even
> need dynamic SQL to do this particular job:
> USE Pubs
> GO
> SELECT * INTO #TempParamFilter FROM Authors
> SELECT * FROM #TempParamFilter
> DROP TABLE #TempParamFilter
> "Ricky" <ricky@.msn.com> wrote in message
> news:eFBaWbVkGHA.1260@.TK2MSFTNGP05.phx.gbl...
seem
>|||The problem is that the temp table is available only within the scope of
EXEC. Either use a global temp table or use the SELECT within the scope of
the EXEC like:
SET @.SQLString = ' SELECT * INTO #TempParamFilter FROM Authors;
SELECT * FROM #TempParamFilter '
EXEC (@.SQLString) ;
Anith|||Probably not the most performant, but
WHERE
QStock = CASE @.StockParam
WHEN 'Q1HTS' THEN @.StockParam
ELSE QStock END
AND
AlphaStock = CASE @.StockParam
WHEN 'T1HTS' THEN @.StockParam
ELSE AlphaStock END
What do you need a #temp table for?
"Ricky" <ricky@.msn.com> wrote in message
news:uZZ7NjVkGHA.3816@.TK2MSFTNGP02.phx.gbl...
> Hi Mike
> It was a simple example, I should have posted the real situation. What I
> am
> really trying to achieve is a dynamic WHERE clause, appended to a table
> and
> then populate a temporary table. Is this possible.
> I mention Dynamic WHERE clause, since the Column may change, depending on
> the parameter supplied.
> e.g
>
> @.StockParam = 'Q1HTS'
> then WHERE clause would be : WHERE QStock = @.StockParam
> or
> @.StockParam = 'T1HTS'
> then WHERE clause would be : WHERE AlphaStock = @.StockParam
> so what I thought about doing, was to have my basic select statement and
> then append a dynamic WHERE clause as a variable and then populate a
> #Table
> to SELECT from , later when compiling the final recordset.
> Hope this makes sense.
> Kind Regards
> Ricky
>
>
> "Mike C#" <xyz@.xyz.com> wrote in message
> news:ePpmqeVkGHA.4304@.TK2MSFTNGP03.phx.gbl...
> seem
>|||Hi Anith
How does the second SELECT embedded in the Dynamic SQL overcome the issue?
Kind Regards
Ricky
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:%23BOJrnVkGHA.1640@.TK2MSFTNGP02.phx.gbl...
> The problem is that the temp table is available only within the scope of
> EXEC. Either use a global temp table or use the SELECT within the scope of
> the EXEC like:
> SET @.SQLString = ' SELECT * INTO #TempParamFilter FROM Authors;
> SELECT * FROM #TempParamFilter '
> EXEC (@.SQLString) ;
> --
> Anith
>|||"Ricky" <ricky@.msn.com> wrote in message
news:uZZ7NjVkGHA.3816@.TK2MSFTNGP02.phx.gbl...
> Hi Mike
> It was a simple example, I should have posted the real situation. What I
> am
> really trying to achieve is a dynamic WHERE clause, appended to a table
> and
> then populate a temporary table. Is this possible.
> I mention Dynamic WHERE clause, since the Column may change, depending on
> the parameter supplied.
> e.g
>
> @.StockParam = 'Q1HTS'
> then WHERE clause would be : WHERE QStock = @.StockParam
> or
> @.StockParam = 'T1HTS'
> then WHERE clause would be : WHERE AlphaStock = @.StockParam
> so what I thought about doing, was to have my basic select statement and
> then append a dynamic WHERE clause as a variable and then populate a
> #Table
> to SELECT from , later when compiling the final recordset.
It's possible if you create the temp table before executing the dynamic sql.
Here's an example to get you started. Note that the temp table is created
outside of the dynamic SQL, but the dynamic SQL has access to it. It won't
work the other way around. Also note that this example uses sp_executesql
to parameterize the query. sp_executesql requires NVARCHAR data, and helps
protect against SQL injection:
USE pubs
GO
CREATE TABLE #temp_emp(emp_id VARCHAR(9) NOT NULL PRIMARY KEY,
fname VARCHAR(30) NOT NULL,
minit CHAR(1) NOT NULL,
lname VARCHAR(30) NOT NULL)
DECLARE @.emp_last_name NVARCHAR(30)
SELECT @.emp_last_name = N'Smith'
DECLARE @.dyn_sql NVARCHAR(512)
SELECT @.dyn_sql = N'INSERT INTO #temp_emp (emp_id, fname, minit, lname) ' +
N'SELECT emp_id, fname, minit, lname ' +
N'FROM employee ' +
N'WHERE lname = @.lname'
EXEC dbo.sp_executesql @.dyn_sql, N'@.lname NVARCHAR(30)', @.lname =
@.emp_last_name
SELECT *
FROM #temp_emp
DROP TABLE #temp_emp|||> How does the second SELECT embedded in the Dynamic SQL overcome the issue?
Because a single EXEC() call represents one 'scope' (I'm not sure if that's
a valid noun there, but oh well). The second SELECT is occuring in the same
scope as that which created the #temp table.|||Another way to think about the scope of something like EXEC() is a typical
popup window in a browser (the good kind, not the annoying advertisements).
In most cases, the popup window could jump through several different pages
and do all kinds of things, and the window that opened it couldn't care less
and usually doesn't have any knowledge of what is going on in the popup.
"Ricky" <ricky@.msn.com> wrote in message
news:OPO%23KpVkGHA.1272@.TK2MSFTNGP03.phx.gbl...
> Hi Anith
> How does the second SELECT embedded in the Dynamic SQL overcome the issue?
> Kind Regards
> Ricky
> "Anith Sen" <anith@.bizdatasolutions.com> wrote in message
> news:%23BOJrnVkGHA.1640@.TK2MSFTNGP02.phx.gbl...
>|||"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:u4VydtVkGHA.4368@.TK2MSFTNGP03.phx.gbl...
> Because a single EXEC() call represents one 'scope' (I'm not sure if
> that's a valid noun there, but oh well). The second SELECT is occuring in
> the same scope as that which created the #temp table.
You know, I always hated the phrase "well-defined scope" for table
variables, etc. It implies that everything else has "poorly-defined scope"
:) But from a marketing perspective I guess "well-defined scope" sounds
better than "limited scope" or "extremely tight scope" :)

DynamicValuesUnavailable state using wsRS.GetReportParameters

This is a repost of a message from sqlserver.server of 9/1/2004 which is MSDN
managed, but there is no answer yet. So here goes in "reportingsvcs"
I am using the webservice ReportingService from the Reporting Services Web
Service Library.
I'm having a problem when retrieving Parameters for a RS report, valid
values are not returned when they are QueryBased.
It works fine when accessing the report through the RSServerName/reports
virtual dir. Then a dropdown with valid values for the parameter is perfectly
populated. As far as I know the "Reports" website uses the ReportingServices
WebService methods?!
When parameters are return from the GetReportParameters method, the
ReportParameters array is correct populated at first glance. The parameters
prm.ValidValuesQueryBased is True, but further investigation reveals that the
prm.ValidValues is nothing (VB) and the prm.State of the parameter is
DynamicValuesUnavailable. The prm.ValidValues is supposed to be an array of
the ValidValue class.....
I cannot seem to find any documentation why the prm.State is
DynamicValuesUnavailable. Has anyone tried this, and does anyone know a
solution?
Thanks GlennThanks Glenn! I had the same problem, and your workaround worked for me.
Ron
"SoGMo" wrote:
> I have now found the answer to my question. So for your information if anyone
> should need it:
> When invoking the method GetReportParameters on the ReportingServices
> service be sure to pass True as value for the ForRendering parameter. When
> this is done ValidValues are returned!
> /Glenn
> "SoGMo" wrote:
> > This is a repost of a message from sqlserver.server of 9/1/2004 which is MSDN
> > managed, but there is no answer yet. So here goes in "reportingsvcs"
> >
> > I am using the webservice ReportingService from the Reporting Services Web
> > Service Library.
> > I'm having a problem when retrieving Parameters for a RS report, valid
> > values are not returned when they are QueryBased.
> > It works fine when accessing the report through the RSServerName/reports
> > virtual dir. Then a dropdown with valid values for the parameter is perfectly
> > populated. As far as I know the "Reports" website uses the ReportingServices
> > WebService methods?!
> >
> > When parameters are return from the GetReportParameters method, the
> > ReportParameters array is correct populated at first glance. The parameters
> > prm.ValidValuesQueryBased is True, but further investigation reveals that the
> > prm.ValidValues is nothing (VB) and the prm.State of the parameter is
> > DynamicValuesUnavailable. The prm.ValidValues is supposed to be an array of
> > the ValidValue class.....
> >
> > I cannot seem to find any documentation why the prm.State is
> > DynamicValuesUnavailable. Has anyone tried this, and does anyone know a
> > solution?
> >
> > Thanks Glenn

Sunday, February 19, 2012

Dynamic SQL stops responding with no error message

On SQL Server 2000, I have a SP (sp_CloseBusinessAcount) that calls another
SP (sp_BuildPayments) which has among several lines of code one specific lin
e
that cancel the process with no error message. The line is a dynamic SQL tha
t
follows below:
execute ('update [PRM].[dbo].[' + @.TableName + '] ' +
' set ' + @.Account_Field_Name + ' = ' + @.Account_Value +
' from [PRM].[dbo].[' + @.TableName + ']' +
' where datepart(month, Event_Date) = ' + @.Event_Month +
' and datepart(year, Event_Date) = ' + @.Event_Year )
I've tried a lot of things with no sucess to find out the problem. Acctually
the code stop running in this line but @.@.error is 0. Does anyone know how to
solve this?
Thanks in advance.
Cheers.
JorgeJorge Luis Ribeiro wrote:
> On SQL Server 2000, I have a SP (sp_CloseBusinessAcount) that calls
> another SP (sp_BuildPayments) which has among several lines of code
> one specific line that cancel the process with no error message. The
> line is a dynamic SQL that follows below:
> execute ('update [PRM].[dbo].[' + @.TableName + '] ' +
> ' set ' + @.Account_Field_Name + ' = ' +
> @.Account_Value + ' from [PRM].[dbo].[' + @.TableName +
> ']' + ' where datepart(month, Event_Date) = ' +
> @.Event_Month + ' and datepart(year, Event_Date) = ' +
> @.Event_Year )
> I've tried a lot of things with no sucess to find out the problem.
> Acctually the code stop running in this line but @.@.error is 0. Does
> anyone know how to solve this?
> Thanks in advance.
> Cheers.
> Jorge
Do the users have UPDATE rights on the underlying table? The update is
going to require a table scan every time because you do not have and
SARGable clauses in the query. It's possible you are running into a
locking/blocking issue. You should be able to see the error value
outside the EXEC, unless there is a trigger on the table which is
resetting the value. Do you have a trigger on the table?
David Gugick
Imceda Software
www.imceda.com|||Hi
Print ('update [PRM].[dbo].[' + @.TableName + '] ' +
' set ' + @.Account_Field_Name + ' = ' + @.Account_Value +
' from [PRM].[dbo].[' + @.TableName + ']' +
' where datepart(month, Event_Date) = ' + @.Event_Month +
' and datepart(year, Event_Date) = ' + @.Event_Year )
Run the output in QA and see if it does the job.
"Jorge Luis Ribeiro" <Jorge Luis Ribeiro@.discussions.microsoft.com> wrote in
message news:B259EFD8-FECF-4652-844B-1AF42FE3F697@.microsoft.com...
> On SQL Server 2000, I have a SP (sp_CloseBusinessAcount) that calls
another
> SP (sp_BuildPayments) which has among several lines of code one specific
line
> that cancel the process with no error message. The line is a dynamic SQL
that
> follows below:
> execute ('update [PRM].[dbo].[' + @.TableName + '] ' +
> ' set ' + @.Account_Field_Name + ' = ' + @.Account_Value +
> ' from [PRM].[dbo].[' + @.TableName + ']' +
> ' where datepart(month, Event_Date) = ' + @.Event_Month +
> ' and datepart(year, Event_Date) = ' + @.Event_Year )
> I've tried a lot of things with no sucess to find out the problem.
Acctually
> the code stop running in this line but @.@.error is 0. Does anyone know how
to
> solve this?
> Thanks in advance.
> Cheers.
> Jorge|||Actually there is a trigger that calls the sp_CloseBusinessAccount that call
s
the other one.
I've tried to check the @.@.error in both procedures with no sucess.
As you mentioned the lock issue, this table @.TableName is a table that has
been created by the same procedure I intend to update.
"David Gugick" wrote:

> Jorge Luis Ribeiro wrote:
> Do the users have UPDATE rights on the underlying table? The update is
> going to require a table scan every time because you do not have and
> SARGable clauses in the query. It's possible you are running into a
> locking/blocking issue. You should be able to see the error value
> outside the EXEC, unless there is a trigger on the table which is
> resetting the value. Do you have a trigger on the table?
> --
> David Gugick
> Imceda Software
> www.imceda.com
>