SQL Server Custom Errors?

Jun 22, 2006

I have a web application with a sql server 2000 backend. I use stored procedures to enter data, and use the sql RAISEERROR function to raise custom errors with the input.

My question is, is there anyway I can assign a number to these error and then catch them in my code?

 

e.g. I have an asset. Someone has authorised an inspection to occur on it. Now, they cannot authorise two inpsections - they must wait for one of the inspections to occur. I catch when someone is trying to authorise two inspections in the database, and raise an error.

But I then want my code to catch this error message and display a user friendly message to the user. Is there a way of attaching a number to the message so that I can catch it in my code and display an appropriate message?

View 1 Replies


ADVERTISEMENT

Custom Errors

Jan 18, 2007

Hi,

I am showing my report in the web application using Report Viewer control.In the report i have start date and End date parameters.While running the report if i give startdate as '45/66/20007' it is displaying a message which is not user friendly.Is there is any way we can handle this type of errors and display our own custom error messages.

Thanks in advance

View 8 Replies View Related

Errors With Custom Task (Could Not Get Value For Property ...)

Jul 5, 2007

I wrote a custom task following the outline on MSDN. I signed it and installed it into the Tasks folder and in the GAC.

When I go to an SSIS project and add my task, the properties window shows "Could not get value for property 'd61935d9-430b-4c93-9f3e-a29f720d8659'. Specified cast is not valid." (where the guid is different obviously) for many of the properties.

What have I done wrong?

Update: I know this isn't my code because I tried a simple task that just returns success and doesn't do anything. I get the exact same errors, so I must be installing it incorrectly.

View 3 Replies View Related

RS Custom Code (Permission Errors)

Feb 1, 2008

I created some custom code that will check to see if a file exists on a Windows Share.



Code Snippet
Public Function FileExists(ByVal FileFullPath As String) As Boolean
Try
Dim f As New System.IO.FileInfo(FileFullPath)
Return f.Exists
Catch e As Exception
Return e.Description
End Try
End Function





An example of what I am passing is this:



Code Snippet
\servernamesharenamefilename.txt





I use this code in a TextBox on my Report:



Code Snippet
=IIF(Code.FileExists(Fields!OutPutFileName.Value) = TRUE,"True","False")





I get this error in my report:



Code SnippetSystem.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.IO.FileInfo..ctor(String fileName)
at ReportExprHostImpl.CustomCodeProxy.FileExists(String FileFullPath)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission
The Zone of the assembly that failed was:
MyComputer




BUT it works on my local machine. Any Ideas?

View 3 Replies View Related

Correct Approach To Catching Execution Time Errors In A Custom Task

Jul 12, 2006

Hi,

I'm building a custom task and just wondering what is the correct way of passing errors back to SSIS. Is there a rcommended approach to doing this. Currently I just wrap everything in a TRY...CATCH and use componentEvents to fire it back! Here's my code:

public override DTSExecResult Execute(Connections connections, VariableDispenser variableDispenser,IDTSComponentEvents componentEvents, IDTSLogging log, object transaction)
{
 bool failed = false;
 try
 {
  /*
  * do stuff in here
  */
 }
 catch (Exception e)
 {
  componentEvents.FireError(-1, "", e.Message, "", 0);
  failed = true;
 }
 if (failed)
 {
  return DTSExecResult.Failure;
 }
 else
 {
  return DTSExecResult.Success;
 }
}

 

Any comments?

 

-Jamie

 

View 5 Replies View Related

SQL Server 2008 :: How To Make Sproc Return Errors For Underlying Table Errors

Jul 1, 2015

I recently updated the datatype of a sproc parameter from bit to tinyint. When I executed the sproc with the updated parameters the sproc appeared to succeed and returned "1 row(s) affected" in the console. However, the update triggered by the sproc did not actually work.

The table column was a bit which only allows 0 or 1 and the sproc was passing a value of 2 so the table was rejecting this value. However, the sproc did not return an error and appeared to return success. So is there a way to configure the database or sproc to return an error message when this type of error occurs?

View 1 Replies View Related

Displaying Custom Properties For Custom Transformation In Custom UI

Mar 8, 2007

Hi,

I am creating a custom transformation component, and a custom user interface for that component.

In
my custom UI, I want to show the custom properties, and allow users to
edit these properties similar to how the advanced editor shows the
properties.

I know in my UI I need to create a "Property Grid".
In
the properties of this grid, I can select the object I want to display
data for, however, the only objects that appear are the objects that I
have already created within this UI, and not the actual component
object with the custom properties.

How do I go about getting the properties for my transformation component listed in this property grid?

I am writing in C#.

View 5 Replies View Related

Expression Editor On Custom Properties On Custom Data Flow Component

Aug 14, 2007

Hi,

I've created a Custom Data Flow Component and added some Custom Properties.

I want the user to set the contents using an expression. I did some research and come up with the folowing:





Code Snippet
IDTSCustomProperty90 SourceTableProperty = ComponentMetaData.CustomPropertyCollection.New();
SourceTableProperty.ExpressionType = DTSCustomPropertyExpressionType.CPET_NOTIFY;
SourceTableProperty.Name = "SourceTable";






But it doesn't work, if I enter @[System:ackageName] in the field. It comes out "@[System:ackageName]" instead of the actual package name.

I'm also unable to find how I can tell the designer to show the Expression editor. I would like to see the elipses (...) next to my field.

Any help would be greatly appreciated!

Thank you

View 6 Replies View Related

Expression Issue With Custom Data Flow Component And Custom Property

Apr 2, 2007

Hi,



I'm trying to enable Expression for a custom property in my custom data flow component.

Here is the code I wrote to declare the custom property:



public override void ProvideComponentProperties()

{


ComponentMetaData.RuntimeConnectionCollection.RemoveAll();

RemoveAllInputsOutputsAndCustomProperties();



IDTSCustomProperty90 prop = ComponentMetaData.CustomPropertyCollection.New();

prop.Name = "MyProperty";

prop.Description = "My property description";

prop.Value = string.Empty;

prop.ExpressionType = DTSCustomPropertyExpressionType.CPET_NOTIFY;



...

}



In design mode, I can assign an expression to my custom property, but it get evaluated in design mode and not in runtime

Here is my expression (a file name based on a date contained in a user variable):



"DB" + (DT_WSTR, 4)YEAR( @[User::varCurrentDate] ) + RIGHT( "0" + (DT_WSTR, 2)MONTH( @[User::varCurrentDate] ), 2 ) + "\" + (DT_WSTR, 4)YEAR( @[User::varCurrentDate] ) + RIGHT( "0" + (DT_WSTR, 2)MONTH( @[User::varCurrentDate] ), 2 ) + ".VER"



@[User::varCurrentDate] is a DateTime variable and is assign to 0 at design time

So the expression is evaluated as: "DB189912189912.VER".



My package contains 2 data flow.

At runtime,

The first one is responsible to set a valid date in @[User::varCurrentDate] variable. (the date is 2007-01-15)

The second one contains my custom data flow component with my custom property that was set to an expression at design time



When my component get executed, my custom property value is still "DB189912189912.VER" and I expected "DB200701200701.VER"



Any idea ?



View 5 Replies View Related

Parent Package Reports Failure On Errors, But No Errors In Log

Jul 31, 2006

I have a parent package that calls child packages inside a For Each container. When I debug/run the parent package (from VS), I get the following error message: Warning: The Execution method succeeded, but the number of errors raised (3) 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.

It appears to be failing while executing the child package. However, the logs (via the "progress" tab) for both the parent package and the child package show no errors other than the one listed above (and that shows in the parent package log). The child package appears to validate completely without error (all components are green and no error messages in the log). I turned on SSIS logging to a text file and see nothing in there either.

If I bump up the MaximumErrorCount in the parent package and in the Execute Package Task that calls the child package to 4 (to go one above the error count indicated in the message above), the whole thing executes sucessfully. I don't want to leave the Max Error Count set like this. Is there something I am missing? For example are there errors that do not get logged by default? I get some warnings, do a certain number of warnings equal an error?

Thanks,

Lee

View 5 Replies View Related

Adding Custom Property To Custom Component

Aug 17, 2005

What I want to accomplish is that at design time the designer can enter a value for some custom property on my custom task and that this value is accessed at executing time.

View 10 Replies View Related

Custom Task - Custom Property Expression

Aug 16, 2006

I am writing a custom task that has some custom properties. I would like to parameterize these properties i.e. read from a varaible, so I can change these variables from a config file during runtime.

I read the documentation and it says if we set the ExpressionType to CPET_NOTIFY, it should work, but it does not seem to work. Not sure if I am missing anything. Can someone please help me?

This is what I did in the custom task

customProperty.ExpressionType = DTSCustomPropertyExpressionType.CPET_NOTIFY;

In the Editor of my custom task, under custom properties section, I expected a button with 3 dots, to click & pop-up so we can specify the expression or at least so it evaluates the variables if we give @[User::VaraibleName]

Any help on this will be very much appreciated.

Thanks

View 3 Replies View Related

How To Solve 0 Allocation Errors And 1 Consistency Errors In

Apr 20, 2006

Starwin writes "when i execute DBCC CHECKDB, DBCC CHECKCATALOG
I reveived the following error.
how to solve it?



Server: Msg 8909, Level 16, State 1, Line 1 Table error: Object ID -2093955965, index ID 711, page ID (3:2530). The PageId in the page header = (34443:343146507).
. . . .
. . . .


CHECKDB found 0 allocation errors and 1 consistency errors in table '(Object ID -1635188736)' (object ID -1635188736).
CHECKDB found 0 allocation errors and 1 consistency errors in table '(Object ID -1600811521)' (object ID -1600811521).

. . . .
. . . .

Server: Msg 8909, Level 16, State 1, Line 1 Table error: Object ID -8748568, index ID 50307, page ID (3:2497). The PageId in the page header = (26707:762626875).
Server: Msg 8909, Level 16, State 1, Line 1 Table error: Object ID -7615284, index ID 35836, page ID (3:2534). The PageId in the page heade"

View 1 Replies View Related

DTC Errors 7395 And 1206 Between SQL Server 2005 And SQL Server 2000 Sp4 - Part1

Feb 6, 2008



Our software vendors upgraded their software and our environment - and applications do not interface as they ought. The vendors do not appear to have any further ideas (to those listed below) and at this stage neither do I. It is now a week since the *upgrade* went live. Looking for new suggestions....


Full story (epic) below. Object names have been changed to protect the *innocent*.





Our organisation had 2 applications:-

appBank
appHouse

both running on the respective platforms:

Server name svrCAT:
Windows Server 2000 sp 4 / SQL Server 2000

Server name svrDOG:
Windows Server 2000 sp 4 / SQL Server 2000



Transactions were "posted" from svrDOG to svrCAT via a linked SQL Server, using login dbL1nkLogin.

dbL1nkLogin was made a user of (with relevant table permissions) of the respective databases:

dbForBank
dbForHouse



*** At this point all was working ***


Upgrading appBank to appBigBank required SQL Server 2005 (and more diskspace).


A new server was purchased:

Windows Server 2003 R2 sp 2 / SQL Server 2005 (Server name svrHORSE)



A linked server was created from the SQL instance on svrHORSE to svrDOG using login name dbL1nkLogin.
dbL1nkLogin was made a user (with relevant table permissions) on database:

dbForBigBank


Attempts to "post" transactions were "posted" from svrDOG to svrHORSE via the linked SQL Server fail with
the appBank application generating the following errors:

On first attempt:

************* FILE ERROR *************
Error Code...... 3902-
Error Message...The COMMIT TRANSACTION request has no co
.rresponding BEGIN TRANSACTION.
Table Name......** NOT APPLICABLE **
Description.....** NOT APPLICABLE **
Function....... COMMIT
sys991: Program already in use
COBOL error at 000444 in sys500
Called from 00076A in sys990ssv
Called from 000457 in sys991
Called from 01177D in gls489
Called from 000DFA in gls396
Called from 003961 in gls394
Called from 000258 in glp900
Called from 003DC1 in syp250

On subsequent attempts:

************* FILE ERROR *************
Error Code...... 1206-
Error Message...The Microsoft Distributed Transaction Co
.ordinator (MS DTC) has cancell
Table Name......tblHouseFinancials
Description.....DYNAMIC SQL CALL INTERLUDE
Function....... UPDATE
*FAILED* Processing Job 'WIN/'



* Parameters and controls within the appBank application were verified.

* Password on dbL1nkLogin was reset in the SQL instances on svrHORSE and svrDOG

* Compared the link server settings on svrHORSE to svrCAT:

Security tab: Be made using security context - Remote Logging: dbL1nkLogin / password

Server Options: Collation Compatible checked (on svrHORSE only)
Data Access checked
RPC checked
RPC Out checked


* Made dbL1nkLogin dbo on databases dbForBigBank and dbForHouse.
* Changed default database from master to dbForBigBank on svrHORSE
* Rebooted svrHORSE and svrDOG (multiple times)
* Verified that svrHORSE could ping svrDOG, and vice versa
* Using DTCping.exe, Verified that the SQL instance on svrHORSE could ping svrDOG, and vice versa
* On svrHORSE, Administrative Tools -> Component Services -> Computers has the following settings for "My Computer" Network DTC Access:


Network DTC Access - checked
Allow Remote Clients - checked
Allow Remote Administration - checked
Allow Inbound - checked
Allow Outbound - checked
No Authentication required - checked
Enable XA Transactions - checked
DTC Logon Account - NT AuthorityNetworkService

These settings were already set. My understanding of KB329332 suggest they are correct. As I could not establish the configuration date of these settings rebooted the server to ensure they'd taken effect.



* Loaded SQL Server 2000 sp4 on svrDOG (Rebooted afterwards in case services not stopped and started correctly)
srvDOG now has MDAC 2.8 sp1 (2.81.1117.6) while srvHORSE has a later version (2.82.3959)- I assume sp2. While they are not the same version, MDAC 2.8 sp2 KB 231943 advises that 2.8 sp2 is not available via the web - so I think it's the best I can do).


* Stopped and manually started MSDTC and SQL Server (via Administrative Tools - Services) in case MSDTC was not being started first.



* KB873160 suggests opening port 135 and adding msdtc.exe as an exception in the Windows Firewall. At present there is no firewall on svrHORSE - which I would assume negates this necessity (at present). In Administration Tools - Services there was a service for the firewall running. Stopping this service has no effect on this issue.



* ( The svrHORSE machine was not created from an ghosted image ).


** None of these things have resolved the issue. **



.... to be continued...

KD

View 1 Replies View Related

SSIS - SQL Server Integration Services Errors. SQL Server 2005

Nov 8, 2006

I created an SSIS package for a client that does data importing. When I run the pacakge from Visual Studio there is an error window showing all the errors and warnings. A good example of an error is if the import file is in the wrong format.When there is a error or warning can I write the error log to a file OR notify someone of the errors so they can make corrections and rerun the package OR any ideas that the client can find out what went wrong and then make corrections accordingly? Thanks

View 1 Replies View Related

SQL Server 7-Errors

May 29, 2002

It gives following errors
1.time out
2.general network failure


* Are these due to large number of online connnections
*If so what is the maximum number of connections possible
*what is the hardware requirement to avoid this
*what is the impact on stored procedures
*How to tune the server to overcome the problems
*I'm currently using the standard edition what is the impact on enterprise edition

View 1 Replies View Related

SQL Server Errors

Oct 11, 2007

I am getting the following errors when I try to connect to certain databases. Thanks for any help. Do I need to use the Surface area configuration tools to allow remote connections?

Error: 0xC0202009 at Populate_DBA_REP, Connection manager "MultiServer": SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Login timeout expired".
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.".
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Named Pipes Provider: Could not open a connection to SQL Server [2]. ".
Error: 0xC020801C at Load Servers, OLE DB Source [1]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "MultiServer" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Error: 0xC0047017 at Load Servers, DTS.Pipeline: component "OLE DB Source" (1) failed validation and returned error code 0xC020801C.
Error: 0xC004700C at Load Servers, DTS.Pipeline: One or more component failed validation.
Error: 0xC0024107 at Load Servers: There were errors during task validation.

View 2 Replies View Related

SQL Server Timeout Errors With MS CSK

Jun 9, 2004

I run a large support site - which was recently rebuilt from the ground up using the CSK - its hosted on a shared SQL server enviroment - and although bandwith and SQL server usage are huge - it was running fine.

But increasingly badly now - to the point where almost no internal pages will work in anything but the quietest times, we are getting sql timeout errors. This basically means most of the site (which is 1850 odd pages of dynamic) is offline. Since this is a support site and responsible for saving a great many lives - this is a serious serious problem.

the SQL DB, which is shared between the CSK, and a dotnetbb forum - is a little over a gig...big I know - but surely SQL is capable of managing tons more than that?

Has anyone heard of a situation like this - and perhaps shed some light? there are a number of connections that are set to sleeping (about 5-10 at a time) - but they tend only to be about 2 minutes old, and I am under the impression that only if they are sleeping for more than 5 minutes should you be concerned?

I really hope someone can help...because this is a complete nightmare.


Many Thanks,


Harley

View 3 Replies View Related

Sql Server Load Errors

Mar 16, 2001

Please help. We have no idea what is wrong.
Error message occurs at the end of the load.
"Error at Destination for Row number 6218607. Errors encountered so far in this task: 1. SqlDumpExecptionHandler: Preocess 11 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process."

Thanks for your help
Adrian.

View 1 Replies View Related

Handling Server Errors

Sep 10, 2001

Hello,
I want the server to check validation rules and not the user application
is this possible???
I want to send my own messages to the user and dont want the user to see the
servers messages.
Thank you in advance
Eran

View 1 Replies View Related

Moving Db To Another Server (Errors)

Apr 21, 2008

I moved an instance of SQL Server 2005 Express to a different server and now receive the following error:

System.Data.SqlClient.SqlException: An error occurred in the Microsoft .NET Framework while trying to load assembly id 65538. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error:
System.IO.FileLoadException: Could not load file or assembly 'xmpdbif, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An error relating to security occurred.

I have read about a resolution that requires you to change the db owner on select databases; I have contacted the software provider to see what users own what databases. I wanted to see if anyone had suggestions on this as well.

View 4 Replies View Related

Report Server Errors

Oct 1, 2007

Hi, im new to SQL server and the report services. I have SQL 2005 express installed on windows xp pro with reporting services and use .net 2.0 framework.

I have recently tried deploying a report i have wrote in VB.net (VS2005 standard) but encountered problems. I have setup the report server to allow remote connections and i am able to connect to it from other computers on my LAN. I have setup anonymous login through IIS to both reports and reportserver instances, this works fine. When i try to deploy a report to my server i am asked for login details. I have tried to login with the execution account set in report server manager but that doesn't work and i have tried the sa SQL account.

When i connect to the report server by http://servername/reportserver it says internat error and there is also the error page displayed when i connect with http://servername/reports. Is this becuase i have not deployed any reports? If i check the server status it says running and initialised, sometimes. I have reinstalled SQL 2005 and report services about three times and still i am getting a problem. I am sure there is something wrong with how i have configured the server but dont know what.

Also when deploying reports should i put the URL as http://servername/reports or ../reportserver?

I can provide error logs if someone could point me in the direction of them if required to. (reportserver just says refer to error log)

I am sure this is an old problem and down to my config of the server. Need help though!!

Thanks in advance for any replies
Regards,
Matt

View 4 Replies View Related

Need Help Writing A Custom View In Sql Server

Jan 23, 2007

Does anyone know
if the following sql view is possible to write and execute as a view script?

 



**********
find employee matching the given UserID*************     SELECT  * FROM Employees WHERE EmployeeID=@UserID

 

***********
find client matching the given ClientID**********     SELECT *
FROM Clients WHERE ClientID=@ClientID 





**********find
all contacts and events associated with ClientID*********      SELECT *
FROM Contacts WHERE Contact.ClientID=@ClientIDSELECT *
FROM Events WHERE Event.ClientID=@ClientID

 

*********select
all audits with Key values matching the primary keys of each client, contact or
event*********SELECT *
FROM Audit Where Key In (Client.ClientID, Contact.ContactID, Event.EventID)

 I basically
need to find a employee based on its ID.  Then I need to find any records from the table Audit
with Key values matching the given fields in the results of any clients, contacts events that were returned from the previous select statements.  Is this possible?

View 5 Replies View Related

Authenticating To Report Server From A Custom Asp.net App

Feb 18, 2008



I have tried to search on the topic, but there's a variety of answers that has left me a bit confused, so let me try asking a-new...

I have RS 2005 installed (Report Server on one server with IIS and everything else, Integrated Security set; the Report Catalog on a separate server with SQL Server 2005, etc.). So far so good.

I can easily access a few of my test reports using URL Access, and I can also access Report Mgr just fine; all that to indicate I'm pretty sure I have RS installed and setup and working correctly.

Now I have a custom ASP.NET 2.0 based web app that, of course, uses Forms based authentication, not Windows. I can create a hyperlink on one my web pages that uses URL Access to get to some of my test reports. But, of course, it's prompts me for (and seems to remember) domain credentials.

That's the piece I want to avoid. I have created a specific Windows domain account that would be used for this purpose. Now, I just need to figure out code to put in my ASP.NET page to pass that along. I am not using the ReportViewer control.

So, I am trying to find a decent reference/example code on how to set the credentials. I have seen much example code that is like:

//assumes a web reference has been setup...
ReportingService rs = new ReportingService();

// establish credentials
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

But I don't think I want "DefaultCredentials"... I want to use my custom domain account. Any help?

My other wild idea was creating this custom page in a directory where I could drop in a custom web.config that set the <authentication> element to "Windows" then set the <identity> element to my custom account... any thoughts on that would be appreciated.

View 3 Replies View Related

UDT - SQL Server 2005 - How To Add Custom Properties In C# ?

Oct 20, 2006

Hello to everyone, I've a question about UDTs and the way I can use them to access tables and columns where they are applied in a SQL Server 2005 DB.
I've already spent 2 days googling and MSDN reading but nothing helped me to solve my problem, thats why I'm posting it here (this is the second post, maybe the last one was in the wrong Forum).

The scenario follows:

I've created a UDT called MyUDT that exposes 2 properties MyTable, MyColumn, here its the code:


[Serializable]
[SqlUserDefinedType(Format.UserDefined, IsByteOrdered = true, MaxByteSize = 8000, Name = "MyUDT")]
public class MyUDT : INullable, IBinarySerialize
{

    private string _myTable;
    private string _myColumn;
....    

    /// <summary>
    /// Set or Get the Table Name where the UDT is applied.
    /// </summary>
    public string MyTable {
        get { return this._myTable; }
        set { this._myTable = value; }
    }

    /// <summary>
    /// Set or Get the Table's Column Name where the UDT is applied.
    /// </summary>
    public string MyColumn
    {
        get { return this._myColumn; }
        set { this._myColumn = value; }
    }

....

}


And here it's my question/s:

How can I expose the defined Properties (MyTable, MyColumn) in order to be directly used from
SQL Server Management Studio within the Column Properties Panel?

Pls take a look to the print screen placed below:

[img=http://img81.imageshack.us/img81/7193/untitledip1.th.jpg]

 
If it is not possible, is there a way for any UDT to get back from the sql server execution context
the table and the column where it is applied/used?

I need to solve that in order to later retrieve via SQL the Extended Table Properties where the UDT is used
and make some work on presented MetaData. Thanks in advance, every answer/help will be very much appreciated.


 

View 10 Replies View Related

Sql Server Custom Code Issue

Sep 12, 2007

I created a report in SQL Server 2005 using SQL Server 2005. I added a custom code to the report as:

function getpiececount_parent(byval qb_prodcode as string,byval s_date as string,byval e_date as string)

dim conn as new System.Data.SqlClient.SqlConnection

conn.ConnectionString= "Data Source=xxxx;Initial Catalog=xxxx;User Id=xxxx;Password=xxxxx "

conn.open()

dim sql as string

sql="select query using parameters"

dim cmd as new System.Data.SqlClient.SqlCommand

cmd.connection=conn

cmd.commandtext=sql

cmd.Parameters.AddWithValue("@stDate",s_date)

cmd.Parameters.AddWithValue("@edDate",e_date)

cmd.Parameters.AddWithValue("@qbprodcode",qb_prodcode)



dim retval =cmd.ExecuteScalar()

if retval is system.dbnull.value then

retval=0

end if



cmd.dispose()

conn.close()

return retval

end function



For the above function I added reference to the System.Data . The report works as desired when I execute in the VS 2005 IDE but when I deploy the report on the reporting server and execute it from there the function doesn€™t execute and returns me #Error.

Can any one provide some insight into it to as to how i can resolve this issue.

View 5 Replies View Related

Errors In SQL Server 2005 Profiler

Oct 27, 2006

I notice this running the SQL Server Profiler under the application name Report Server. Every time it runs, it reports an error (in the Error field of Profiler). Does anyone know what this is?declare @p1 nvarchar(64)set @p1=NULLexec GetDBVersion @DBVersion=@p1 outputselect @p1

View 1 Replies View Related

Trap The Sql Errors Raised By Sql Server In Asp.net

Dec 8, 2006

hi i am running a stored procedure and i want to trap the error of that stored procedure and pass it on the user in the asp.net prog.
 
my stored procedure are running thru a class library using C#. i tried various options of creating a new sql connnection with out using the classlibrary, but i dont get any errors. the code s
used is as follows Dim conn As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("dbconnection1"))

Dim cmd As New SqlCommand("usp_ImportPlanDetails", conn)

cmd.CommandType = CommandType.StoredProcedure'cmd.Parameters.AddWithValue("@ClientId", Session("ClientId"))

AddHandler conn.InfoMessage, New SqlInfoMessageEventHandler(AddressOf MessageEventHandler)

conn.Close()





Private Sub MessageEventHandler(ByVal sender As System.Object, ByVal e As SqlInfoMessageEventArgs)

Dim strMessage As String

For Each sqle As SqlError In e.Errors

strMessage = "Message:" + sqle.Message + "Number:" + sqle.Number + "Procedure:" + sqle.Procedure + "Server:" + sqle.Server + "Source:" + sqle.Source + "State:" + sqle.State + "Line Number:" + sqle.LineNumber

' strMessage = String.Format("Message: {1}, Number: {2}, Procedure: {3}, Server: {4}, Source: {5}, State: {6}, Line Number: {7}" , new Object[]{sqle.Message, sqle.Number, sqle.Server, sqle.Source, sqle.State, sqle.LineNumber})

'Console.WriteLine(strMessage)

lblErrorMsg.Visible = True

lblErrorMsg.Text = strMessage

and also tried doing this  oImportPlan = New ImportPlan(System.Configuration.ConfigurationManager.AppSettings(APPSETTINGS_CONNECTION))


With oImportPlan
Try
.ClientID = Session("ClientId")
' .FileName = strFilePath1
.save()
Catch sqlex1 As SqlException
LogException(sqlex1)
End Try

End With
Catch sqlex As SqlException
LogException(sqlex)
End Try
Catch ex As Exception
lblErrorMsg.Text = "Error: Import Failed" + ex.Message
lblErrorMsg.Visible = True

End Try  but have no luck in displaying the errors, My stored procedure has raiseerrors, Please help me out 

View 2 Replies View Related

Errors From Msdtc When Sql Server Delay Too Much

Nov 10, 2000

Hi, Folks!


I have a multitier app running 24 x 7...All is running ok until the server delay too much to respond when I'm trying to add the records, so I start to
receive erros from the msdtc and the transaction is aborted...How can I resolved this trouble? I'm not sure if the cause is too long response from the server, but I have noted that in some moments the server is busier than when it's running ok...just for clearing this, my app have a maximum of 5 threads each one create an transactional objects to process the new entry.

Any idea?

TIA!

Armando Marrero
CTI. Miami

View 1 Replies View Related

Returning SQL Server Errors Through Front End

Sep 22, 2000

I have my error routines and raiserrors working fine. I can run my stored procs through query analyzer and I get the error messages I expect. WHen the stored proces are run through Access, VB, C++, what is required to return the
error messages I see in QA. Is it specific to the app front end. All my front ends will be using ODBC as their
connection

View 1 Replies View Related

Sql Server Agent Errors Starting

Mar 24, 2005

Hi guys, I'm trying to figure out why i'm having issues with the SQL server agent trying to start.

the error i get is 14258 cannot perform this operation while sqlserveragent is starting. try again later. sql-dmo(odbc sqlstate:42000)

any ideas how to fix this. I start the service as a domain user that is an admin on the server. but when i run a job it gives me the above error.

thanks.

View 2 Replies View Related

Question About SQL Server Errors/exceptions

Jul 21, 2004

In SQL Profiler, I see Exception records with a TextData entry like:
Error: 2601, Severity: 14, State: 3

There is no other error text for that entry and there are no corresponding log entries. When I look up the help for error 2601, I see:

Message Text:
Cannot insert duplicate key row in object '%.*ls' with unique index '%.*ls'.

That's obviously a C sprintf format string. I would expect to see the resulting formatted text somewhere. Where would I find detail on these errors?

View 6 Replies View Related

SQL 2000 Server Backup Errors

Aug 20, 2004

I am experiencing the following problem when running a backup. This process was working really fine for 3 months.

BACKUP DATABASE [DBLIVE] TO DISK = N'C:BACKUPSdblive' WITH INIT , NOUNLOAD , NAME = N'DBLIVE backup C', NOSKIP , STATS = 10, NOFORMAT

Database size 10G
Recovery Mode : Simple
Daily Backup

Error message:

Executed as user: ACC33Administrator. 10 percent backed up. [SQLSTATE 01000] (Message 3211) 20 percent backed up. [SQLSTATE 01000] (Message 3211) 30 percent backed up. [SQLSTATE 01000] (Message 3211) 40 percent backed up. [SQLSTATE 01000] (Message 3211) 50 percent backed up. [SQLSTATE 01000] (Message 3211) 60 percent backed up. [SQLSTATE 01000] (Message 3211) Nonrecoverable I/O error occurred on file 'D:sqldbDBLIVE_Data.MDF'. [SQLSTATE 42000] (Error 3271) BACKUP DATABASE is terminating abnormally. [SQLSTATE 42000] (Error 3013). The step failed.

Thank You.

View 9 Replies View Related







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