Calling A .Net Assembly From Script Component Giving Error

Apr 17, 2008

Hi,

I am trying to access a .Net assembly in script component, which internally uses Microsoft Enterpise library dll's.

The problem I am facing is when I copy the config sections needed for the Enterprise library from web.config to dtsdebughost.exe.config file and run the package, It ends in failure with below message
"Error: The script files failed to load."

My dtsdebughost.exe.config looks like below:




Code Snippet
<configuration>
<startup>
<requiredRuntime version="v2.0.50727"/>
</startup>
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</configSections>
<loggingConfiguration name="Logging Application Block" tracingEnabled="true"
defaultCategory="" logWarningsWhenNoCategoriesMatch="true">
<listeners>
<add fileName="LogMedtrack-Error.log" rollSizeKB="5000" timeStampPattern="dd-MMM-yyyy"
rollFileExistsBehavior="Overwrite" rollInterval="Day" formatter="Default Formatter"
header="----------------------------------------" footer="----------------------------------------"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="Rolling Flat File Trace Listener" />
</listeners>
<formatters>
<add template="Timestamp: {timestamp}&#xA;Message: {message}&#xA;Category: {category}&#xA;Priority: {priority}&#xA;EventId: {eventid}&#xA;Severity: {severity}&#xA;Title:{title}&#xA;Machine: {machine}&#xA;Application Domain: {appDomain}&#xA;Process Id: {processId}&#xA;Process Name: {processName}&#xA;Win32 Thread Id: {win32ThreadId}&#xA;Thread Name: {threadName}&#xA;Extended Properties: {dictionary({key} - {value}&#xA;)}"
type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="Default Formatter" />
</formatters>
<logFilters>
<add categoryFilterMode="AllowAllExceptDenied" type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.CategoryFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="Category Filter" />
<add minimumPriority="0" maximumPriority="2147483647" type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.PriorityFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="Priority Filter" />
</logFilters>
<categorySources>
<add switchValue="All" name="Tracing">
<listeners>
<add name="Rolling Flat File Trace Listener" />
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events">
<listeners>
<add name="Rolling Flat File Trace Listener" />
</listeners>
</allEvents>
<notProcessed switchValue="All" name="Unprocessed Category" />
<errors switchValue="All" name="Logging Errors &amp; Warnings" />
</specialSources>
</loggingConfiguration>
<exceptionHandling>
<exceptionPolicies>
<add name="Business Policy">
<exceptionTypes>
<add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
postHandlingAction="NotifyRethrow" name="Exception">
<exceptionHandlers>
<add logCategory="Tracing" eventId="100" severity="Error" title="Agility Application Log."
formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
priority="0" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
name="Logging Handler" />
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
</exceptionPolicies>
</exceptionHandling>
</configuration>






Please let me konw, If there is anything wrong I am doing or is there any other way to handle the situation

Regards,
Kalyan

View 1 Replies


ADVERTISEMENT

ALTER ASSEMBLY Error Msg 6509 An Error Occurred While Gathering Metadata From Assembly ‘&&<Assembly Name&&>’ With HRESULT 0x1.

Feb 22, 2008

I work with February CTP of SqlServer 2008.
I have an Assembly with several UDTs inside. Version of assembly is 1.0.*
I use CREATE ASSEMBLY statement to register this assembly, and it runs without any errors. Then I rebuild CLR solution without doing any changes in source code. In that case the only difference between new and old assemblies is version (difference in fourth part of version).
Then I try to update assembly in SqlServer. I use
ALTER ASSEMBLY <name>
FROM <path>
WITH PERMISSION_SET = UNSAFE, UNCHECKED DATA
statement for this. Statement runs with error:
Msg 6509An error occurred while gathering metadata from assembly €˜<Assembly name>€™ with HRESULT 0x1.
I found the list of condition for ALTER ASSEMBLY in MSDN:
ALTER ASSEMBLY statement cannot be used to change the following:
· The signatures of CLR functions, aggregate functions, stored procedures, and triggers in an instance of SQL Server that reference the assembly. ALTER ASSEMBLY fails when SQL Server cannot rebind .NET Framework database objects in SQL Server with the new version of the assembly.
· The signatures of methods in the assembly that are called from other assemblies.
· The list of assemblies that depend on the assembly, as referenced in the DependentList property of the assembly.
· The indexability of a method, unless there are no indexes or persisted computed columns depending on that method, either directly or indirectly.
· The FillRow method name attribute for CLR table-valued functions.
· The Accumulate and Terminate method signature for user-defined aggregates.
· System assemblies.
· Assembly ownership. Use ALTER AUTHORIZATION (Transact-SQL) instead.
Additionally, for assemblies that implement user-defined types, ALTER ASSEMBLY can be used for making only the following changes:
· Modifying public methods of the user-defined type class, as long as signatures or attributes are not changed.
· Adding new public methods.
· Modifying private methods in any way.

But I haven€™t done any changes in source code, so new version of assembly satisfies all this conditions.
What could be the reason for such behavior?
P.S. I€™ve got the same error, if I add or change any method in assembly before rebuilding.

View 9 Replies View Related

Calling VB Based SQLCLR Function Failed With Error Can't Load System.Web Assembly

Apr 20, 2007

I created a CLR function based on following VB code:



Imports Microsoft.SqlServer.Server

Public Partial Class SqlClrVB

<Microsoft.SqlServer.Server.SqlFunction()> _

Public Shared Function GetTotalPhysicalMemory() As Integer

GetTotalPhysicalMemory = My.Computer.Info.TotalPhysicalMemory

End Function

End Class



The VB code was complied into a DLL called totalmem.dll and call following TSQL to map it into a SQL function:



create assembly totalmem from '!WORKINGDIR! otalmem.dll'

WITH PERMISSION_SET=UNSAFE

go

create function fnGetTotalMem()

returns int

as external name totalmem.SqlClrVB.GetTotalPhysicalMemory

go



When I call this function, it returned following error:

select dbo.fnGetTotalMem()



Msg 6522, Level 16, State 2, Line 0

A .NET Framework error occurred during execution of user defined routine or aggregate 'fnGetTotalMem':

System.IO.FileNotFoundException: Could not load file or assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

System.IO.FileNotFoundException:

at Microsoft.VisualBasic.MyServices.Internal.ContextValue`1.get_Value()

at My.MyProject.ThreadSafeObjectProvider`1.get_GetInstance()

at SqlClrVB.GetTotalPhysicalMemory()

.



Anyone knows why I'm hitting this error? I didn't reference any System.Web interface why it needs to load System.Web assembly? The same code runs OK if I compile it as a separate VB application out side of SQL Server 2005.



Thanks much,



Zhiqiang

View 2 Replies View Related

Calling CLR Stored Procedure From Within A CLR Table-valued Function Giving Errors

Apr 6, 2007

We are trying to create a TVF that executes a CLR Stored Procedure we wrote to use the results from the SP and transform them for the purposes of returning to the user as a table.






Code Snippet

[SqlFunction ( FillRowMethodName = "FillRow",

TableDefinition = "CustomerID nvarchar(MAX)",

SystemDataAccess = SystemDataAccessKind.Read,

DataAccess = DataAccessKind.Read,

IsDeterministic=false)]

public static IEnumerable GetWishlist () {

using (SqlConnection conn = new SqlConnection ( "Context Connection=true" )) {

List<string> myList = new List<string> ();

conn.Open ();

SqlCommand command = conn.CreateCommand ();

command.CommandText = "GetObject";

command.Parameters.AddWithValue ( "@map", "Item" );

command.CommandType = System.Data.CommandType.StoredProcedure;

using ( SqlDataReader reader = command.ExecuteReader ( System.Data.CommandBehavior.SingleRow )) {

if (reader.Read ()) {

myList.Add ( reader[0] as string );

}

}



return (IEnumerable)myList;

}

}



When command.ExecuteReader is called, I am getting an "Object not defined" error. However, the stored procedure can be used in SQL Management Studio just fine.






Code SnippetEXEC GetObject 'Item'



Is there some sorf of trick I am missing?



Thank you!

View 3 Replies View Related

Calling .net Assembly In DTS Package

Sep 26, 2006

Hi everyone,   I want to call the .net assembly(DLL) in a DTS package. Can anyone help me as to how to achieve this. I read numerous articles on internet, but couldn't find the one that can help me with this problem.Any help or directing me to an article will be greatly appreciated.Thanks.Vinki

View 9 Replies View Related

Calling A C# Assembly From SQL Server 2005

Dec 14, 2007

Hi,
 I have got a simple C# assembly which call a ASP.net web service and executes a webmethod, now i want to call this assembly from sql server 2005 within the sql server function. can any body let me know how to do it.
Thanks

View 1 Replies View Related

Registering A Assembly And Calling It From Managemnet Studio

May 15, 2008



Hi everyone,


i am trying to register a assembly in SSAS which i actually did fine as per BOL by right clicking on assembly folder and pointing to the dll file. And then i tried to call the function from management studio using Call command and Select statement...both outputs a error which looks like



Executing the query ...

Query (1, 6) The '[TestKPIMeasures].[KPIMeasures].[getKPIData]' function does not exist.

Execution complete


Let me explain my scenario so that you ll get a better picture. I have a cube named 'FourH KPI values' and i have registerd the below as dll file.



using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using Microsoft.AnalysisServices.AdomdClient;

using System.Reflection;

using System.Reflection.Emit;

namespace TestKPIMeasures

{

public class KPIMeasures

{

public static System.Data.DataTable getKPIData(String Connstring, String ExecCommand, String kpimeasures)

{

CellSet cellset;

//DataSet ds = new DataSet("KpiDataSet");

DataTable dt = new DataTable("KpiMeasures");

// ds.Tables.Add("KpiMeasures");

try

{

//Create AdomdConnection object

AdomdConnection asConnection = new AdomdConnection(Connstring);

asConnection.Open();

String[] keyindicators = kpimeasures.Split(',');

string commandText = ExecCommand;

AdomdCommand command = new AdomdCommand(commandText, asConnection);

DataColumn column = new DataColumn();

column = new DataColumn("KPI Name");

column.DataType = typeof(string);

dt.Columns.Add(column);

column = new DataColumn("KPI value");

column.DataType = typeof(string);

dt.Columns.Add(column);

column = new DataColumn("KPI goal");

column.DataType = typeof(string);

dt.Columns.Add(column);

column = new DataColumn("KPI status"); column.DataType = typeof(string);

dt.Columns.Add(column);



foreach (string item in keyindicators)

{

command.Parameters.Clear();

command.Parameters.Add(new AdomdParameter("Value", item));

command.Parameters.Add(new AdomdParameter("Goal", item));

command.Parameters.Add(new AdomdParameter("Status", item));

command.Parameters.Add(new AdomdParameter("Trend", item));

cellset = command.ExecuteCellSet();

DataRow row = dt.NewRow();

row["KPI NamE"] = item;

row["KPI value"] = cellset.Cells[0].FormattedValue;

row["KPI goal"] = cellset.Cells[1].FormattedValue;

row["KPI status"] = cellset.Cells[2].FormattedValue;

dt.Rows.Add(row);

}

}

catch (Exception ex)

{

throw ex;

}

return dt;

}

}

}


Now i am trying to call the assembly from management studio,


CALL TestKPIMeasures.KPIMeasures.getKPIData("Provider=MSOLAP.3;DataSource=D64ETL01;Initial Catalog=FourH KPI values", "SELECT{KPIValue(@Value), KPIGoal(@Goal), KPIStatus(@Status)} ON COLUMNS FROM [Key Performance Indicators]", "Test measure,Test measure 2,KPI 3")

also tried Select statment...still no luck

Can anyone tell me what i am missing out.......Thanks in advance

View 8 Replies View Related

Calling .Net Assembly Or Dll From SQL Server 2005 At Config Level 80

Jul 26, 2006

Hi,
I create a dll assembly with the strong name in VB.Net environment.
Created assembly is registered also.
SQL Server 2005 configuraton level is set at "80"
I want to call that assembly from stored procedure with the database config level at "80"
But when i execute the stored proecure i get the following error
Error Source: "ODSOLE Extended Procedure"
Description: "Invalid Class String"

My Code in VB.Net is given below:
Imports System
Imports System.Reflection
Imports System.Globalization
Imports System.IO
Imports System.data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports Microsoft.SqlServer.Server
Imports Microsoft.VisualBasic
Imports System.Diagnostics
Imports GreatDataAccess

Namespace Test
Public Class clsTest

Public Shared Sub GenTest()
''''............ some code is here
End Sub
End Class
End Namespace

Stored Procedure
CREATE PROCEDURE [dbo].[PPGenerateFile]
AS
BEGIN
Declare @retVal INT
Declare @comHandler INT
declare @errorSource nvarchar(500)
declare @errorDescription nvarchar(500)
declare @retString nvarchar(100)

-- Intialize the COM component

EXEC @retVal = sp_OACreate Test.clsTest, @comHandler OUTPUT
IF(@retVal <> 0)
BEGIN
--Trap errors if any
EXEC sp_OAGetErrorInfo @comHandler,@errorSource OUTPUT, @errorDescription OUTPUT
SELECT [error source] = @errorsource, [Description] = @errordescription
Return
END



-- Call a method into the component

EXEC @retVal = sp_OAMethod @comHandler,'GenTest()',@retString

IF (@retVal <>0 )
BEGIN
EXEC sp_OAGetErrorInfo @comHandler,@errorSource OUTPUT, @errorDescription OUTPUT
SELECT [error source] = @errorsource, [Description] = @errordescription
Return
END
select @retString

END






Please Help me to solve this problem.

View 21 Replies View Related

Could Script Task Component Uses A Framework 1.1 Assembly?

Feb 2, 2007

TIA

View 1 Replies View Related

How To Call A DotNet Assembly In SSIS Script Component

Jan 16, 2006

I tried to access a dot net assembly (.dll) file in ssis script component using following steps.


Create new Script Task in Data Flow Task
Edit Design Script button-> Loads script Project in MS VSA
Locate Object Browser
Select Custom Component Set from the dropdown and hit browse button
Browse and place the custom component dll (This Custom component dll has to be in GAC - Global assembly cache before browsing)
Select the namespace from the Component list of the object browser and click on €œAdd to references to Selected project in the solution explorer€? button
Write Imports <namespace> in the script code to invoke class methods from the .NET custom component
The following steps worked properly with June CTP version of yukon.In september CTP version of Yukon in SSIS  when i browse the dot net assembly with the same above steps i get a error stating " The file could not be browsed ".Can anybody help me in the same.
 
Prashant Utekar

View 1 Replies View Related

Error Registering Assembly Using CREATE ASSEMBLY

May 1, 2008

We have written a test CRL stored procedure to test replacing one of our complex stored procedures but can€™t get it deployed to our SQL server that hosts a mirrored configuration of our production database (very locked down). It works fine on our development instances (not very locked down). It only references the default assemblies that were added when we created the project. All it does is use Context Connection=true to get data, loops though some records and returns the data using SQLContext. CLR is enabled on SQL server, the assembly is strongly signed, and we tried deploy using the binary string with the SAFE setting.


CREATE ASSEMBLY for assembly 'SQLCLRTest2' failed because assembly 'SQLCLRTest2' failed verification. Check if the referenced assemblies are up-to-date and trusted (for external_access or unsafe) to execute in the database. CLR Verifier error messages if any will follow this message
[ : SQLCLRTest2.StoredProcedures::GetLift][mdToken=0x600001e] Type load failed.
[token 0x02000008] Type load failed.

View 8 Replies View Related

Reporting Services :: External Assembly Reference Same DB Data Source As Calling Report?

Aug 25, 2015

I have a SSRS 2012 report which references a custom c# assembly.   This report exists in multiple environments (alpha, beta and  production ) which are each associated with different data sources.

Is there a way for the assembly to determine the datasource used by the calling report so it can also connect to it?

View 2 Replies View Related

System.Windows.Form Assembly Is Needed On Script Component Task?

Jun 7, 2006

That affects only interface design... so that it doesn't exists at all in a SSIS.

What is it for??

Let me know your view on this or any clarification.

View 4 Replies View Related

What Component To Use For Calling View

Mar 16, 2006

In SSIS 2005 what component can I use inside my Data Flow task to call my View and use it as a datasource? I know I've used an Execute T-SQL Task but I don't know what component to use inside an actual task itself. What I'm trying to do is in my Data Flow task, instead of using 3 OLE DB Source components, I want to actually call 3 stored procs and use those 3 components as the data sources to merge on using the merge and sort components later on

View 13 Replies View Related

Error: CREATE ASSEMBLY For Assembly

May 31, 2007

I am trying to deploy a Database Project with Visual Studio 2005 and SQL Server 2005 Standard.
I import €œSystem.IO€? and have therefore set the permission levels to EXTERNAL_ACCESS.

I am receiving the same error message that many folks have received.

CREATE ASSEMBLY for assembly 'Images' failed because assembly 'Images' is not authorized for PERMISSION_SET = EXTERNAL_ACCESS.
The assembly is authorized when either of the following is true: the database owner (DBO) has EXTERNAL ACCESS ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with EXTERNAL ACCESS ASSEMBLY permission. If you have restored or attached this database, make sure the database owner is mapped to the correct login on this server. If not, use sp_changedbowner to fix the problem. Images.

My CLR access is €œon€?

I have tried

1) From master run: GRANT EXTERNAL ACCESS ASSEMBLY to [BuiltinAdministrators].
2) From master run: GRANT EXTERNAL ACCESS ASSEMBLY to €œMy Windows Authentication ID€?.
3) Run ALTER DATABASE MYDATABASE SET TRUSTWORTHY ON
4) In Visual Studio .NET 2005 Set the permission levels to €˜external€™
5) Tried BuiltinAdministrators and my SQL Server Windows Authenticated Login ID for the ASSEMBLY OWNER.

I can compile BUT NOT DEPLOY

Any help would be greatly appreciated.
Regards Steve

View 8 Replies View Related

Sp Giving Error

Sep 13, 2006

i have to get the maximum into a output parameter. its giving error. whats the problem with this code

SET @supplier_code as EXECUTE (SELECT MAX(supplier_code)+1 AS Supp_Id FROM supplier)

suji

View 5 Replies View Related

BCP Giving Error &#34;unexpected Eof&#34;

Mar 19, 1999

Hi ,

I am trying to import a .csv file to SQL server 6.5, I get the db library error "Unexpected EOF encountered in BCP data-file"

What can be the problem with the file ?
Its very important to load this data.

Any help is appreciated.

Thanks
Ajay

View 4 Replies View Related

Check This With It Is Giving An Error.

Feb 29, 2008



WITH ProccessedYesNO AS

(

select ClaimNumber, Surname, FirstName, CASE WHEN New= 0 THEN 'Yes' ELSE 'No' END AS Processed

from EntryTable)
Select * from ProcessedYesNo Where Ignore_dupe='Yes';



why I am getting an syntex error I check the query it is ok atleast the inner query is running but when I apply the with
than I am getting Syntax error near 'WITH'

View 12 Replies View Related

My DTS Package Is Giving An Error When Trying Run From The JOB

Dec 24, 2007

Hi,

I have imported a DTS package to sql 2005. I am trying to run this DTS package from the JOB using DTSRun. and i am getting the following error. I thought it was some issue with the SQL Agent serivice account which this is running, i have created a proxy which has super privilages.. but still the job is failing. When i run the DTS package directly it's running fine.

I am confused !!!!!


Message
Executed as user: AMRsql_seasdv. DTSRun: Loading... DTSRun: Executing... DTSRun OnStart: DTSStep_DTSExecuteSQLTask_1 DTSRun OnError: DTSStep_DTSExecuteSQLTask_1, Error = -2147467259 (80004005) Error string: Login failed for user ''. The user is not associated with a trusted SQL Server connection. Error source: Microsoft OLE DB Provider for SQL Server Help file: Help context: 0 Error Detail Records: Error: -2147467259 (80004005); Provider Error: 18452 (4814) Error string: Login failed for user ''. The user is not associated with a trusted SQL Server connection. Error source: Microsoft OLE DB Provider for SQL Server Help file: Help context: 0 DTSRun OnFinish: DTSStep_DTSExecuteSQLTask_1 DTSRun: Package execution complete. Process Exit Code 1. The step failed.
Dev

View 4 Replies View Related

Union Giving Me Error Msg About Distinct Use

Aug 30, 2007

when i try to run this following query, i get an error message:


Microsoft OLE DB Provider for SQL Server error '80040e14'

The ntext data type cannot be selected as DISTINCT because it is not comparable.

/resultados_termo.asp, line 176


the query:

select * from view_veiculos where ativo='1' and ( nome_marc like
'%fiat%' or nome_mod like '%fiat%' or estado like '%fiat%' or cidade
like '%fiat%' or ano like '%fiat%' ) and ( nome_marc like '%brava%' or
nome_mod like '%brava%' or estado like '%brava%' or cidade like
'%brava%' or ano like '%brava%' ) and ( nome_marc like '%2004%' or
nome_mod like '%2004%' or estado like '%2004%' or cidade like '%2004%'
or ano like '%2004%' ) union
select * from view_veiculos where ativo='1' and ( nome_marc like
'%fiat%' or nome_mod like '%fiat%' or estado like '%fiat%' or cidade
like '%fiat%' or ano like '%fiat%' ) and ( nome_marc like '%brava%' or
nome_mod like '%brava%' or estado like '%brava%' or cidade like
'%brava%' or ano like '%brava%' ) union
select * from view_veiculos where ativo='1' and ( nome_marc like
'%fiat%' or nome_mod like '%fiat%' or estado like '%fiat%' or cidade
like '%fiat%' or ano like '%fiat%' ) union
select * from view_veiculos where ativo='1' and ( nome_marc like
'%brava%' or nome_mod like '%brava%' or estado like '%brava%' or cidade
like '%brava%' or ano like '%brava%' ) and ( nome_marc like '%2004%' or
nome_mod like '%2004%' or estado like '%2004%' or cidade like '%2004%'
or ano like '%2004%' ) union
select * from view_veiculos where ativo='1' and ( nome_marc like
'%brava%' or nome_mod like '%brava%' or estado like '%brava%' or cidade
like '%brava%' or ano like '%brava%' ) union
select * from view_veiculos where ativo='1' and ( nome_marc like
'%2004%' or nome_mod like '%2004%' or estado like '%2004%' or cidade
like '%2004%' or ano like '%2004%' )


when i use UNION ALL, i get repeated rows. i need the select distinct on it.

please, help.

thanks in advance.

View 4 Replies View Related

Select Row_Number() Giving Me An Error

Jun 9, 2008

here it is:
 
SELECT * FROM (    SELECT        ROW_NUMBER() Over (Order By LastActivity ASC) As rn        UserName)    FROM aspnet_usersWhere rn = 1
 
 
it's saying: "Incorrect syntax near UserName"
all column/table names are correct

View 6 Replies View Related

Database Keeps Giving Timeout Error

Apr 24, 2007

Hi All,

since the last upgrade SQL 2000 --> 2005, the biggest database I am working on (1.4 GB, with loads of binary data) keeps freezin at least one time per week. When I say 'freezin' I mean that you cannot query some of the tables as it gives a timeout error when trying.

I am not a DBA and I don't have any idea of what to do, the only thing which comes to my mind is that this database is too big, as if I go to the preperties window it says Space Available: 38 MB (what's that? there's really only 38 MB on this DB?).
I tried re-writing all mainteinment plans (full backup every night, log backup every hour), but I realized that the database keeps freezing (and the backup jobs keep running untill you stop them).

anyone could give any hint?

Thanks in advance,

Giovanni Idili

View 20 Replies View Related

Distinct Count With Over Giving An Error

Nov 30, 2007

We have a table of students with fields for the ID of the school district and their school name. For example:



DistrictID
StudentName
SchoolName

10001
John Smith
Washington Elementary

10001
Jane Smith
Lincoln Middle

10002
David White
Hill High

...
...
...


I want is a listing with the school district ID, the student name, and the number of schools in the district.

I believe the following statement should give me what I want:

SELECT DistrictID, StudentName, COUNT(DISTINCT SchoolName) OVER (PARTITION BY DistrictID)

FROM StudentData


However, I get the error:

Msg 102, Level 15, State 1, Line 1

Incorrect syntax near 'distinct'.

If I take out the DISTINCT it runs fine, however it counts all the rows as expected, which is not what I want.
If I remove the OVER clause it runs fine, however, it counds the schools across all the districts, which is not what I want.
I can remove the OVER clause and use GROUP BY, but not while also retrieving StudentName.


The SQL 2005 Online Books don't seem to indicate that my statement is invalid. Here are the links just for reference:
Count: http://msdn2.microsoft.com/en-us/library/ms175997.aspx
Over: http://msdn2.microsoft.com/en-us/library/ms189461.aspx

Anyone have an idea one what I'm doing wrong or how to go about getting this information?
Thanks!
Matt Penner

View 3 Replies View Related

SQL Sever Not Installing - Giving Error - Plz Help

Mar 10, 2008

Hi,

I'm trying to install Sql Server 2005 Express Edition making it as one of the pre-requisities of an windows app using click once deployment tech and in one system every time i'm getting an error that "An error occured attempting to install myappname". Here its pointing to an log file called install.log which is as follows-

The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [ProcessorArchitecture] = Intel {string}
Property: [VersionNT] = 5.1.2 {version}
Running checks for package 'Microsoft Data Access Components 2.8', phase BuildList
Reading value 'FullInstallVer' of registry key 'HKLMSoftwareMicrosoftDataAccess'
Read string value '2.81.1117.0'
Setting value '2.81.1117.0 {string}' for property 'MDACVersion'
The following properties have been set for package 'Microsoft Data Access Components 2.8':
Property: [MDACVersion] = 2.81.1117.0 {string}
Running checks for command 'MDAC28mdac_typ.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'MDACVersion' and value '2.80': true
Result of checks for command 'MDAC28mdac_typ.exe' is 'Bypass'
'Microsoft Data Access Components 2.8' RunCheck result: No Install Needed
Running checks for package '.NET Framework 2.0', phase BuildList
Running external check with command line "C:DOCUME~1JOEMER~1LOCALS~1TempVSD567.tmpdotnetfxdotnetchk.exe"
Process exited with code 1
Setting value '1 {int}' for property 'DotNetInstalled'
Reading value 'Version' of registry key 'HKLMSoftwareMicrosoftInternet Explorer'
Read string value '7.0.5730.11'
Setting value '7.0.5730.11 {string}' for property 'IEVersion'
The following properties have been set for package '.NET Framework 2.0':
Property: [DotNetInstalled] = 1 {int}
Property: [IEVersion] = 7.0.5730.11 {string}
Running checks for command 'dotnetfxinstmsia.exe'
Result of running operator 'ValueExists' on property 'VersionNT': true
Result of checks for command 'dotnetfxinstmsia.exe' is 'Bypass'
Running checks for command 'dotnetfxWindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'ValueExists' on property 'Version9x': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.0.3': false
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.0': true
Result of checks for command 'dotnetfxWindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
Running checks for command 'dotnetfxdotnetfx.exe'
Result of running operator 'ValueNotEqualTo' on property 'DotNetInstalled' and value '0': true
Result of checks for command 'dotnetfxdotnetfx.exe' is 'Bypass'
'.NET Framework 2.0' RunCheck result: No Install Needed
Running checks for package 'Windows Installer 3.1', phase BuildList
The following properties have been set for package 'Windows Installer 3.1':
Running checks for command 'WindowsInstaller3_1WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
Result of checks for command 'WindowsInstaller3_1WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
'Windows Installer 3.1' RunCheck result: No Install Needed
Running checks for package 'SQL Server 2005 Express Edition', phase BuildList
Running external check with command line "C:DOCUME~1JOEMER~1LOCALS~1TempVSD567.tmpSqlExpressSqlExpressChk.exe"
Process exited with code 0
Setting value '0 {int}' for property 'SQLExpressInstalled'
The following properties have been set for package 'SQL Server 2005 Express Edition':
Property: [SQLExpressInstalled] = 0 {int}
Running checks for command 'SqlExpresssqlexpr32.exe'
Result of running operator 'ValueEqualTo' on property 'SQLExpressInstalled' and value '0': true
Result of checks for command 'SqlExpresssqlexpr32.exe' is 'Bypass'
Running checks for command 'SqlExpresssqlexpr32.exe'
Result of running operator 'ValueEqualTo' on property 'SQLExpressInstalled' and value '0': true
Result of checks for command 'SqlExpresssqlexpr32.exe' is 'Bypass'
'SQL Server 2005 Express Edition' RunCheck result: No Install Needed
Launching Application.
Running command 'http://reporterapp.stats.com/reporter/BasketballDataCollection.application' with arguments ''
ShellExecuteEx failed with error code 1155
Error: The following error occurred attempting to install 'http://reporterapp.stats.com/reporter/BasketballDataCollection.application':
"No application is associated with the specified file for this operation. "

View 1 Replies View Related

Please Help! Sql Server 7.0 Crashes Giving A NT Event Log Error.

Dec 14, 1999

When I try to manually run one of my scheduled job, DR. Watson comes up and SQL Server crashes. the following error message is received in the NT event log. "Unable to read local Event log, reason the data area passed to a system call is too small". I am new to SQL and this is causing me some degree of stress!!!! Also please recommend a good book for a newbie like me.

Thanks in advance.

View 1 Replies View Related

Exit Activex Script Without Giving An Error?

Feb 25, 2005

I am using ActiveX Script tasks to branch out on the different tasks that I have within the DTS. When I want a particular branch of tasks not to be executed, I give a "Main = DTSStepScriptResult_DontExecuteTask"

This seems to be working fine in terms of functionality, but there is an error that is displayed saying "Task reported failure on execution".

How do I get rid of this? I need to exit the task, and still just get one message box at the end of it all that happily reads "Succesfully completed tasks"

View 2 Replies View Related

SQL Agent Jobs Giving General Network Error

Oct 25, 2004

transferred datbases and SQLagentjobs to a new server. Trying to execute sqlagent jobs
gives

ConnectionRead (WrapperRead()). [SQLSTATE 01000] (Message 258) General network error. Check your network documentation. [SQLSTATE 08S01] (Error 11). The step failed.

External Comminications seem OK

Any ideas what to do about this

Thanks

View 4 Replies View Related

T-SQL (SS2K8) :: Proc Giving Error In One Session And Runs In Another

Nov 13, 2014

I have one drop and create procedure script in one sql session and execute the procedure in other session. Now when i am compiling the procedure in first session, it gets completed successfully.

Now when i move to other session and try to execute the procedure, it gives me error saying :

"Invalid column name 'ColumnName'."

Now when I execute the procedure in same session in which procedure was compiled, it runs successfully. Once run, I go back to my other session and it runs again.

View 9 Replies View Related

Alter Table Datatype Giving Error Date To Bit

Nov 20, 2014

IF EXISTS (SELECT * FROM SYS.COLUMNS WHERE NAME =N'Case_Escalated__c' AND OBJECT_ID = OBJECT_ID(N'[Case]'))
begin
alter table [Case] alter column Case_Escalated__c bit null
print 'Case_Escalated__c altered sucessfully for [Case]'
end

Msg 1792, Level 16, State 1, Line 3
Alter table 'Case' failed because the added fixed column might cause existing data to go beyond the maximum allowable table row size of 8060 bytes.

View 4 Replies View Related

Why Is SQL 2005 Giving A Msg 511, Exceeded Max Row Size Of 8060 Error?

Jun 24, 2007

A simple alter statement to populate a column is giving the error below.
UPDATE AM_PROFILE_4101_0 SET _92284 = CONVERT(varchar(1000),fv.varcharValue)
FROM AM_PROFILE_4101_0 pt
INNER JOIN cyfield_value fv ON fv.fieldID = 92284 AND pt.AM_PROFILE_ID = fv.AMid


Cannot create a row of size 8125 which is greater than the allowable maximum of 8060.
The table as many varchar(max) columns such as _92284, and many are populated with around 1000 bytes of data. Everything I'm reading tells me SQL 2005 supports large row sizes. But why is this error still coming up.

Other usage info: These numbered columns (i.e. _92284) are dropped, added, and repopulated with data every night.

Any ideas would be appreciated.

Thank you!

View 5 Replies View Related

SSIS Keeps Giving Me The Visual Studio Is Busy Error, Help!!!

Jun 28, 2007

I am working on a SSIS solution that has 4 packages. All 4 have run before and I have not modified any of them, however I keep getting the error message and it keeps locking up on one of my packages. Does anyone have any advice or a remedy for this?



Any help is appreciated!

View 5 Replies View Related

Stored Procedure Giving Error When Searching On Date Range

Aug 20, 2007

I've  a report whose columns are returned from a stored procedure. Now I want to display the report based on a date range. The date field is Received. It's in dbo.master. I added 2 parameters start date and end date. When I check the condition if dbo.master.Received>StartDate and dbo.master.Received < EndDate directly I'm getting error. Could someone tell me what mistake I'm doing? Thanks for your help!ALTER Procedure [dbo].[USP_Reports_NewTier1]
 
@ClientCode VARCHAR(7) = '',@UserID INT = 0
,@OrderID INT =0
,@StartDate datetime,@EndDate datetime
 
IF @ClientCode <> '' and dbo.master.Received > StartDate and dbo.master.Received<EndDateBEGIN SELECT --Root Select --ClientName @ClientName = (Select Name  FROM dbo.customer c     WHERE   c.Customer = @ClientCode)     ,@TotalDollarValue = (SELECT SUM(m.current1-m.paid1)     FROM dbo.master m     WHERE phase=1     AND m.Customer = @ClientCode    AND M.Status <> 'PIE')
 ,@AverageAge = ISNULL((select avg(age) from    (select datediff(day,Received,CASE WHEN clidlp>clidlc then clidlp else clidlc END)* -1 as age    from dbo. master M    WHERE phase=1 AND customer = @ClientCode AND M.Status <> 'PIE') x),0)END

View 3 Replies View Related

OLEDB Command Giving Error For Decalre And Set Statements At The Top Of The SQL Script

Jul 26, 2007

Hi All,

I have an OLEDB command in my package that has to execute some SQL script.
But when I declare and set a variable at the top of all code, The OLEDB gives an error in column mappings tab.

My DQL script is as shown below
DECLARE @Cost AS money
SET @Cost=?
--Some update statements a table
OLEDB Command works if write the declare and set statements after update statements. Like below. But I don€™t need it.

--Some update statements a table
DECLARE @Cost AS money
SET @Cost=?

I also observer that,Oledb Command gives error for the code given below.
Just paste the following Script in OLEDB command, it gives error in column mapping tab
DECLARE @Cost AS money
SET @Cost=?
Any Idea on this behaviour?

Thanks in advance..

View 3 Replies View Related







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