Funny SQL Server Error Messages - Anyone Has An Explanation?

Apr 3, 2006

I am getting a new server online at a customer, and our system shows very funny erorrs under full load. No explanations could be found. Anyone has some?

Here we go:

Server failed to resume the transaction, desc: 360000054a. The transaction active in this session has been committed or aborted by another session.,

at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

and

New request is not allowed to start because it should come with valid transaction descriptor.

System.Data.SqlClient.SqlException

I am a little lost on those. Simple fact is that I do not find any description of those. Anyone an idea what causes these?

View 2 Replies


ADVERTISEMENT

Funny Search Error

Oct 28, 2004

I have two fields I am searching on .... address and zipCode

When I have both pieces of data, everything is fine, i get back the expected results, but i am unable able to search on the individual pieces. Here is the SQL I am using. It's placed within a store procedure in Sqlserver that I amreferencing from my VB.net code.... any help??


IF ((NOT @address IS NULL) AND( NOT @zipCode IS NULL))
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_Address1 = @address AND ShpAddr_ZipCode = @zipCode
END

ELSE IF NOT @address IS NULL
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_Address1 = @address
END

ELSE IF NOT @zipCode IS NULL
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_ZipCode = @zipCode
END


any help would be great. thanks

View 3 Replies View Related

Funny Error During Runs

Jan 26, 2007

Can any one please help explain why this error has happened, it is not a normal error of SSIS,

"SSIS Debug host has encountered a problem and needs to close. We are sorry for the inconvenience"

It has 2 buttons Debug and Close, this error happened in the middle of a script task.

View 1 Replies View Related

Urgent : DB-Library Error 10007: General SQL Server Error: Check Messages From The SQL

Jul 20, 2005

DB-Library Error 10007: General SQL Server error: Check messages fromthe SQLServer.CREATE PROCEDURE [dbo].[spu_Import_Export_Image](@srvr varchar(50),@db varchar(50),@usr varchar(15),@pwd varchar(50),@tbl varchar(50),@col varchar(50),@mod varchar(1),@imgpath1 varchar(1000),@pk varchar(50))ASBEGINdeclare @path varchar(50)declare @whr varchar(200)declare @fil varchar(100)declare @cmd varchar(1000)declare @imgpath varchar(800)declare @ext varchar(5)--declare @pk varchar(50)declare @KeyValue varchar(8000)declare @image varchar(50)--declare @imgpath1 varchar(1000)declare @imgpath2 varchar(1000)declare @sellist varchar(2000)set @path = 'c: extCopy.exe'select @sellist = 'DECLARE curKey CURSOR FOR SELECT ' + @pk +' FROM '+ @tbl + ' ORDER BY ' + @pkexec (@sellist)OPEN curKeyFETCH NEXT FROM curKey INTO @KeyValueWHILE (@@fetch_status = 0)BEGINset @whr = '"where '+ @pk +' = "' + @KeyValueset @fil = @imgpath1 + '' + @KeyValue --+ @extset @cmd = @path + ' /S ' + @srvr + ' /D ' + @db + ' /U ' + @usr+ ' /P ' + @pwd+ ' /T ' + @tbl + ' /C ' + @col + ' /W ' + @whr + '/F ' + @fil+ ' /' + @modexec Master..xp_cmdShell @cmdFETCH NEXT FROM curKey INTO @KeyValueENDCLOSE curKeyDEALLOCATE curKeyENDGOAbove srcipt runs fine with image data type in one table but when irun for some other table it gives me Error MessageTEXTCOPY Version 1.0DB-Library version 8.00.194SQL Server 'WSQL01' Message 170: Line 1: Incorrect syntax near '99'.(Concerning line 1)DB-Library Error 10007: General SQL Server error: Check messages fromthe SQLServer.ERROR: Could not use database 'test1'NULL-----------Aslo it only runs on server console if i run it from workstation uingsame files and tables it gives me an error again. Can anybody help meand reply me at Join Bytes! asap.thnx,dharmesh

View 1 Replies View Related

Checksum_agg And Row Size Error. Require Explanation.

Jul 23, 2005

Hi,I can see that by using the object ID rather that the object name, thefollowing SQL query works. Has anybody got any idea what is causing theerror?-- Works OKselect o.id,checksum_agg(binary_checksum(m.text))from sysobjects o,syscomments mwhere o.id = m.idand o.xtype in ('FN','IF','P','TF','TR','V')group by o.id-- Error-- Server: Msg 1540, Level 16, State 1, Line 1-- Cannot sort a row of size 8096, which is greater than the-- allowable maximum of 8094.select object_name(o.id),checksum_agg(binary_checksum(m.text))from sysobjects o,syscomments mwhere o.id = m.idand o.xtype in ('FN','IF','P','TF','TR','V')group by object_name(o.id)-- Error-- Server: Msg 1540, Level 16, State 1, Line 1-- Cannot sort a row of size 8096, which is greater than the-- allowable maximum of 8094.select o.name,checksum_agg(binary_checksum(m.text))from sysobjects o,syscomments mwhere o.id = m.idand o.xtype in ('FN','IF','P','TF','TR','V')group by o.name-- Workaroundselect getdate(),object_name(x.id),check_sumfrom (select m.id,checksum_agg(binary_checksum(m.text)) as check_sumfrom syscomments minner joinsysobjects oon m.id = o.idwhere o.xtype in ('FN','IF','P','TF','TR','V')group by m.id) as xRegardsLiam

View 1 Replies View Related

SQL Server Error Messages

Jul 30, 2007

Hi All,

I was wondering if anybody knows where to get a complete list of SQL Server error messages. I am writing a stored procedure that scans SQL Server Logs for errors and if there are errors in the logs, I get paged.

Thanks.

View 2 Replies View Related

List Of SQL Server Error Messages

Jul 30, 2007

Hi All,

I was wondering if anybody knows where to get a complete list of SQL Server error messages. I am writing a stored procedure that scans SQL Server Logs for errors and if there are errors in the logs, I get paged.

Thanks.

View 4 Replies View Related

Report Server Error Messages

Jun 14, 2007

Hi,

I am using Reporting services through web services using the SOAP API. The problem I am facing is for any errors that occur the messages are getting displayed more than once.

For example : while rendering a report(which takes a parameter) if the parameter is not passed the same error message is displayed thrice.

"This report requires a default or user-defined value for the report parameter 'Num_RP_1'. To run or subscribe to this report, you must provide a parameter value. ---> This report requires a default or user-defined value for the report parameter 'Num_RP_1'. To run or subscribe to this report, you must provide a parameter value. ---> This report requires a default or user-defined value for the report parameter 'Num_RP_1'. To run or subscribe to this report, you must provide a parameter value."



while calling listChildren() method if the folderpath passed is a non existing one then the same error message is displayed twice.

"The path of the item '/SomeNonExistantPath/' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash. ---> The path of the item '/SomeNonExistantPath/' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash."



1. Why some messages are displayed twice and some are displayed thrice ?

2. Is there any way to get the error message only once ?



Thanks in advance,

View 2 Replies View Related

Sql Server Sp1 Error Messages Questions

Jun 27, 2006

Hello,

I have installed Sp1 for Sql Server 2005
I also received "locked files" and "reboot required". These errors I can find on all forums and do not worry me anymore.
However i still would like to know more about the messages in the log files.

- What does this mean: "Failed to read associated hotfix build information for the following file"......
- What does this men: "Failed to read version information for the following file".........

- Why are some products NOT APPLIED, while in the other log file it says "SUCCES" for the same product?
These beneath the 2 log files.

File C:WINDOWSHotfix HotFix.log shows "success"
-------------------------------------------
06/23/2006 13:45:01.131 Product Status Summary:
06/23/2006 13:45:01.162 Product: SQL Server Native Client
06/23/2006 13:45:01.241 SQL Server Native Client (RTM ) - Success
06/23/2006 13:45:01.287
06/23/2006 13:45:01.350 Product: Setup Support Files
06/23/2006 13:45:01.412 Setup Support Files (RTM ) - Success
06/23/2006 13:45:01.491
06/23/2006 13:45:01.584 Product: Database Services
06/23/2006 13:45:01.647 Database Services (SP1 2047 ENU) - Success
06/23/2006 13:45:01.772 Analysis Services (SP1 2047 ENU) - Success
06/23/2006 13:45:01.834 Reporting Services (SP1 2047 ENU) - Success
06/23/2006 13:45:01.866
06/23/2006 13:45:01.928 Product: Notification Services
06/23/2006 13:45:02.069 Notification Services (SP1 2047 ENU) - Success
06/23/2006 13:45:02.147
06/23/2006 13:45:02.194 Product: Integration Services
06/23/2006 13:45:02.225 Integration Services (SP1 2047 ENU) - Success
06/23/2006 13:45:02.256
06/23/2006 13:45:02.319 Product: Client Components
06/23/2006 13:45:02.366 Client Components (SP1 2047 ENU) - Success
06/23/2006 13:45:02.397
06/23/2006 13:45:02.459 Product: MSXML 6.0 Parser
06/23/2006 13:45:02.491 MSXML 6.0 Parser (RTM ) - Success
06/23/2006 13:45:02.553
06/23/2006 13:45:02.616 Product: SQLXML4
06/23/2006 13:45:02.678 SQLXML4 (RTM ) - Success
06/23/2006 13:45:02.725
06/23/2006 13:45:02.772 Product: Backward Compatibility
06/23/2006 13:45:02.788 Backward Compatibility (RTM ) - Success
06/23/2006 13:45:02.803
06/23/2006 13:45:02.850 Product: Microsoft SQL Server VSS Writer
06/23/2006 13:45:02.881 Microsoft SQL Server VSS Writer (RTM ) - Success
06/23/2006 13:45:02.897
06/23/2006 13:45:02.913 Hotfix package completed
06/23/2006 13:59:42.596 Hotfix package closed
-------------------------------------------


But file C:WINDOWSHotfixSQLTools9Logs shows "not applied"
-------------------------------------------
06/23/2006 13:44:33.565 Product Status Summary:
06/23/2006 13:44:33.596 Product: SQL Server Native Client
06/23/2006 13:44:33.627 SQL Server Native Client (RTM ) - Success
06/23/2006 13:44:33.643
06/23/2006 13:44:33.659 Product: Setup Support Files
06/23/2006 13:44:33.674 Setup Support Files (RTM ) - Success
06/23/2006 13:44:33.721
06/23/2006 13:44:33.737 Product: Database Services
06/23/2006 13:44:33.768 Database Services (SP1 2047 ENU) - Success
06/23/2006 13:44:33.799 Analysis Services (SP1 2047 ENU) - Success
06/23/2006 13:44:33.846 Reporting Services (SP1 2047 ENU) - Success
06/23/2006 13:44:33.877
06/23/2006 13:44:33.893 Product: Notification Services
06/23/2006 13:44:33.924 Notification Services (SP1 2047 ENU) - Success
06/23/2006 13:44:33.940
06/23/2006 13:44:33.955 Product: Integration Services
06/23/2006 13:44:33.971 Integration Services (SP1 2047 ENU) - Success
06/23/2006 13:44:34.002
06/23/2006 13:44:34.018 Product: Client Components
06/23/2006 13:44:34.034 Client Components (SP1 2047 ENU) - Success
06/23/2006 13:44:34.065
06/23/2006 13:44:34.096 Product: MSXML 6.0 Parser
06/23/2006 13:44:34.127 MSXML 6.0 Parser (RTM ) - Not Applied
06/23/2006 13:44:34.143
06/23/2006 13:44:34.174 Product: SQLXML4
06/23/2006 13:44:34.190 SQLXML4 (RTM ) - Not Applied
06/23/2006 13:44:34.206
06/23/2006 13:44:34.221 Product: Backward Compatibility
06/23/2006 13:44:34.268 Backward Compatibility (RTM ) - Not Applied
06/23/2006 13:44:34.284
06/23/2006 13:44:34.315 Product: Microsoft SQL Server VSS Writer
06/23/2006 13:44:34.331 Microsoft SQL Server VSS Writer (RTM ) - Not Applied
06/23/2006 13:44:34.362
06/23/2006 13:59:42.424 Hotfix package closed

Any anwers are appreciated

Harry

View 3 Replies View Related

Query Notification / Server Log Error Messages

Oct 11, 2007

Two days ago I discovered that the drive on our test SqlServer2005 was full. The current Error_log had 54+ Gb (yes Gb) of records. Not only did I delete the file I restarted SS and the server.

That afternoon, I discovered that the current log had 33,678 records! I believe 33,616 of the records came from a single run of my app and set of program events. Obviously I'm doing something wrong in my Query Notification implementation and testing. And yet, when I try to to deliberately trigger the phenomenon, I can not.


Here is the head of the exported log file; the two msgs (query dialog closed and cannot drop queue) alternate thousands and thousands of times form a single test run. What is going on?! Pls help!

Date,Source,Severity,Message
10/11/2007 11:42:52,spid5s,Unknown,SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
10/11/2007 11:42:52,spid5s,Unknown,SQL Server is terminating in response to a 'stop' request from Service Control Manager. This is an informational message only. No user action is required.
10/11/2007 11:42:49,spid14s,Unknown,Service Broker manager has shut down.
10/11/2007 11:42:47,spid51,Unknown,Configuration option 'show advanced options' changed from 1 to 0. Run the RECONFIGURE statement to install.
10/11/2007 11:42:47,spid51,Unknown,Configuration option 'Agent XPs' changed from 1 to 0. Run the RECONFIGURE statement to install.
10/11/2007 11:42:47,spid51,Unknown,Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.
10/11/2007 11:42:04,spid51,Unknown,The query notification dialog on conversation handle '{72FF98A6-1478-DC11-B117-003048772A14}.' closed due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8470</Code><Description>Remote service has been dropped.</Description></Error>'.
10/11/2007 11:42:03,spid54s,Unknown,The activated proc [ovs].[SqlQueryNotificationStoredProcedure-ed59bba2-19b1-42a3-9aaa-f8a76b844561] running on queue OVS_GOM_Protected.ovs.SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561 output the following: 'Cannot drop the queue 'SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561'<c/> because it does not exist or you do not have permission.'
10/11/2007 11:42:03,spid54s,Unknown,The query notification dialog on conversation handle '{72FF98A6-1478-DC11-B117-003048772A14}.' closed due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8470</Code><Description>Remote service has been dropped.</Description></Error>'.
10/11/2007 11:42:03,spid52s,Unknown,The activated proc [ovs].[SqlQueryNotificationStoredProcedure-ed59bba2-19b1-42a3-9aaa-f8a76b844561] running on queue OVS_GOM_Protected.ovs.SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561 output the following: 'Cannot drop the queue 'SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561'<c/> because it does not exist or you do not have permission.'
10/11/2007 11:42:03,spid52s,Unknown,The query notification dialog on conversation handle '{72FF98A6-1478-DC11-B117-003048772A14}.' closed due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8470</Code><Description>Remote service has been dropped.</Description></Error>'.
10/11/2007 11:42:03,spid52s,Unknown,The activated proc [ovs].[SqlQueryNotificationStoredProcedure-ed59bba2-19b1-42a3-9aaa-f8a76b844561] running on queue OVS_GOM_Protected.ovs.SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561 output the following: 'Cannot drop the queue 'SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561'<c/> because it does not exist or you do not have permission.'
10/11/2007 11:42:03,spid52s,Unknown,The query notification dialog on conversation handle '{72FF98A6-1478-DC11-B117-003048772A14}.' closed due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8470</Code><Description>Remote service has been dropped.</Description></Error>'.
10/11/2007 11:42:03,spid54s,Unknown,The activated proc [ovs].[SqlQueryNotificationStoredProcedure-ed59bba2-19b1-42a3-9aaa-f8a76b844561] running on queue OVS_GOM_Protected.ovs.SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561 output the following: 'Cannot drop the queue 'SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561'<c/> because it does not exist or you do not have permission.'
10/11/2007 11:42:03,spid54s,Unknown,The query notification dialog on conversation handle '{72FF98A6-1478-DC11-B117-003048772A14}.' closed due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8470</Code><Description>Remote service has been dropped.</Description></Error>'.
10/11/2007 11:42:03,spid52s,Unknown,The activated proc [ovs].[SqlQueryNotificationStoredProcedure-ed59bba2-19b1-42a3-9aaa-f8a76b844561] running on queue OVS_GOM_Protected.ovs.SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561 output the following: 'Cannot drop the queue 'SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561'<c/> because it does not exist or you do not have permission.'
10/11/2007 11:42:03,spid52s,Unknown,The query notification dialog on conversation handle '{72FF98A6-1478-DC11-B117-003048772A14}.' closed due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8470</Code><Description>Remote service has been dropped.</Description></Error>'.
10/11/2007 11:42:03,spid54s,Unknown,The activated proc [ovs].[SqlQueryNotificationStoredProcedure-ed59bba2-19b1-42a3-9aaa-f8a76b844561] running on queue OVS_GOM_Protected.ovs.SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561 output the following: 'Cannot drop the queue 'SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561'<c/> because it does not exist or you do not have permission.'
10/11/2007 11:42:03,spid54s,Unknown,The query notification dialog on conversation handle '{72FF98A6-1478-DC11-B117-003048772A14}.' closed due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8470</Code><Description>Remote service has been dropped.</Description></Error>'.
10/11/2007 11:42:03,spid52s,Unknown,The activated proc [ovs].[SqlQueryNotificationStoredProcedure-ed59bba2-19b1-42a3-9aaa-f8a76b844561] running on queue OVS_GOM_Protected.ovs.SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561 output the following: 'Cannot drop the queue 'SqlQueryNotificationService-ed59bba2-19b1-42a3-9aaa-f8a76b844561'<c/> because it does not exist or you do not have permission.'

View 2 Replies View Related

How To Localize Sql Server 2005 Error Messages

May 27, 2008

I make web application that use sql server 2005 dtatabase.
In application i receive exception messages only on english.
I use formview control to edit data in tables. On event item updated,
item deleted and item updated I process e.messages to show
users some error manipulating with data.


Phrase as is

The DELETE statement conflicted with the REFERENCE constraint "FK_preduzeca_zsistem". The conflict occurred in database "zaoka", table "dbo.preduzeca", column 'brsist'. The statement has been terminated.

my users do'nt understand.

How to localize exception messageg that receive sql server 2005.

View 5 Replies View Related

SQL Server 2014 :: Retrieving All Error Messages Generated By A Command

Jul 17, 2014

Some T-SQL commands can fail with multiple errors. For example, if you try to disable a primary key constraint using ALTER TABLE t1 NOCHECK CONSTRAINT PK, you will get messages like:

Msg 11415, Level 16, State 1, Line 341
Object 'PK' cannot be disabled or enabled. This action applies only to foreign key and check constraints.
Msg 4916, Level 16, State 0, Line 341
Could not enable or disable the constraint. See previous errors.

However, in the code below, only the last message is printed. How can I print all the error messages?

USE tempdb;
CREATE TABLE #t1(c1 INT CONSTRAINT PK PRIMARY KEY);
BEGIN TRY
ALTER TABLE #t1 NOCHECK CONSTRAINT PK;
PRINT 'Primary key disabled'
END TRY
BEGIN CATCH
PRINT ERROR_MESSAGE();
END CATCH

View 4 Replies View Related

SQL Server 2008 :: Unknown Error Messages During Generate Script From Database

Mar 23, 2009

I have a SQL2008 database, running Standard Edition 64-bit, database owns by sa, connected to Management Studio using Windows Authentication mode. When I tried to generate scripts from a database, I got the following error messages:-

[Operation is not valid due to the current state of the object. (SqlManagerUI)]

which happened at one particular table. I have reviewed this table definitions are normal, and I could select data from it.

I couldn't find any information anywhere relating to this error messages, except that someone got it when they were trying to change the authentication mode or sa password.

View 5 Replies View Related

How To Show SQL Server Data Validation Error Messages In The VB 2005 Designed Interface ???

Apr 27, 2008

I'm developing a database-driven program using SQL server 2000 and Visual Basic 2005.

Most of the guys say professional programming is doing the validation stuff (such as the constraints and data integrity stuff like" [0-9][1] " and the use of LIKE IN keywords etc.) in the databse itself.

say i did the data validation contraints in SQL server itself. and now i connect the database with the interface made in 2005. and say a person enters some invalid data through the interface. but the error messages are generated by SQL server. how am i to display the SQL server generated error messages in the VB made interface??

PLS HELP ME .. if the question is not clear pls tell so that i can explain it further.

PLS PLS PLS HELP ME

View 1 Replies View Related

How To Show SQL Server Data Validation Error Messages In The VB 2005 Designed Interface ???

Apr 27, 2008

I'm developing a database-driven program using SQL server 2000 and Visual Basic 2005.

Most of the guys say professional programming is doing the validation stuff (such as the constraints and data integrity stuff like" [0-9][1] " and the use of LIKE IN keywords etc.) in the databse itself.

say i did the data validation contraints in SQL server itself. and now i connect the database with the interface made in 2005. and say a person enters some invalid data through the interface. but the error messages are generated by SQL server. how am i to display the SQL server generated error messages in the VB made interface??

PLS HELP ME .. if the question is not clear pls tell so that i can explain it further.

PLS PLS PLS HELP ME

View 4 Replies View Related

Explanation Of SQL Server Database Files

Feb 22, 2000

When a database is created in SQL Server, 4 files are made:

(example)
DB_Data.DAT
DB_data.mdf
DB_Log.DAT
DB_log.ldf


What do each of these files contain? I can figure out that the main database is the DB_Data.DAT, but why is the transaction log a .DAT and why is there four files instead of two? etceterea.

Llyal

View 3 Replies View Related

Tech's Are So Funny

Aug 16, 2004

Ok a network tech put an executive assistants database on sql with the upsize wizard in access. Only problem is that she cant input anything into the database, my guess is that its due to no Primary key in the new sql table. I have had this problem before am I correct in my assumptions???

View 6 Replies View Related

No Help From The Error Messages

Dec 4, 2007

I am writing a tracking system. There is a table in the Sql Server 2000 database that contains a column for the user's ntid, the page they visited, the date of the last visit, a column each to track hits for the current year and a previous year column (basically for archiveing and reporting purposes), and 12 columns for hits per month (obviously, one per column). To record a hit, my unit determined we would only track one hit per day, so basically, there are 3 possible outcomes I needed to account for :
1) A user had never hit the page before, so I need to record the user's ID, the page they hit for the first time (since it won't exist yet), increment the year counter for that user on that page, and then determine what month column counter should be incremented as well.
2) A user had hit the page before, but not on this same day, so I need to update the row for that user on that page, changing the last visit field to reflect the current date, and icnrementing the appropriate counters.
3) A user had hit the page already on the same day, so basically, nothing should be changed whatsoever. No action should be taken.
I wrote a stored procedure to attempt to accomplish that logic, and though it's probably not very pretty, I was surprised at how few errors I got on my first Syntax check. Here's the stored procedure :
CREATE PROCEDURE sp_hitMe@ntid varchar(10),@page varchar(50),@thisHit datetimeASSET NOCOUNT ON
DECLARE @tempDate datetimeDECLARE @yearCount intDECLARE @monthCount intDECLARE @inMonth varchar(20)DECLARE @monthColumn varchar(10)SET @inMonth = DATENAME(mm, @thisHit)SET @monthColumn =  CASE   WHEN @inMonth = 'January' THEN 'hitsInJan'  WHEN @inMonth = 'February' THEN 'hitsInFeb'  WHEN @inMonth = 'March' THEN 'hitsInMar'  WHEN @inMonth = 'April' THEN 'hitsInApr'  WHEN @inMonth = 'May' THEN 'hitsInMay'  WHEN @inMonth = 'June' THEN 'hitsInJun'  WHEN @inMonth = 'July' THEN 'hitsInJul'  WHEN @inMonth = 'August' THEN 'hitsInAug'  WHEN @inMonth = 'September' THEN 'hitsInSep'  WHEN @inMonth = 'October' THEN 'hitsInOct'  WHEN @inMonth = 'November' THEN 'hitsInNov'  WHEN @inMonth = 'December' THEN 'hitsInDec'  END DECLARE @insString varchar(500)DECLARE @updString varchar(500)SET @insString = 'INSERT INTO tblTracking (ntid, page, lastVisit, hitsThisYear, ' + @monthColumn + ') VALUES (' + @ntid + ', ' + @page + ', ' + @thisHit + ', 1, 1)'
if exists(select * from tblTracking where ntid = @ntid and @page = page) begin  if exists(select * from tblTracking where lastVisit = @thisHit)   begin    -- DO NOTHING!   end  else   begin    DECLARE @theColumn varchar (100)    SET @theColumn = 'SELECT ' + @monthColumn + ' FROM tblTracking WHERE ntid = @ntid AND @page = page'    SET @yearCount = (SELECT hitsThisYear FROM tblTracking WHERE ntid = @ntid AND @page = page) + 1    SET @monthCount = (Exec @theColumn)    SET @monthCount = @monthCount + 1    SET @updString = 'UPDATE tblTracking SET lastVisit = ' + @thisHit + ', hitsThisYear = ' + @yearCount + ', ' + @monthColumn + ' = ' + @monthCount + ' WHERE ntid = @ntid AND @page = page'    Exec @updString   end endelse begin  Exec @insString endGO
And to my surprise, the only 3 errors I got were :
Server: Msg 156, Level 15, State 1, Procedure sp_hitMe, Line 39Incorrect syntax near the keyword 'end'.Server: Msg 156, Level 15, State 1, Procedure sp_hitMe, Line 45Incorrect syntax near the keyword 'Exec'.Server: Msg 156, Level 15, State 1, Procedure sp_hitMe, Line 50Incorrect syntax near the keyword 'end'.
However, these are of course so vague as to be useless to me. What's wrong with the procedure? What have I missed?

View 9 Replies View Related

SQL Error Messages

Mar 9, 1999

Is there a way to return the SQL Native error to a Visual Basic program?

View 3 Replies View Related

Error Messages

Mar 3, 1999

Hey everyone,

Here is what I'm doing:

exec xp_sendmail @recipients = 'ampx@hotmail.com',
@query = 'select * from information where recid <= 10',
@subject = 'Query test',
@message = 'hello',
@attach_results = 'TRUE',
@width = 250

I get this error:

Msg 2812, Level 16, State 4
Stored procedure 'xp_sendmail' not found.

Anyone know why? isn't xp_sendmail a function of SQL?

Thanks

View 1 Replies View Related

*** DTS Error Messages ***

Jul 20, 2005

Hello,I'd like to know if I use DTS. If I use it immediately, I can see the errorin the dialog box, instead, if I use it with scheduling, where Can I checkthe error ?ThanksSaimon(Florence)

View 2 Replies View Related

Looking Up Error Messages

Mar 10, 2008



Greetings
I'm learning SSIS and BIDS. I have extreme difficulty making sense of the error messages that come out.

First of all, what do the numbers mean? Each column, error, etc. is assigned a number that obviously means something yet I cannot relate them to anything. For example: The output column Name (713) on output Test (15) and Component (15) -- My table doesn't have 713 columns in it...

Then there are the error codes that obviously contain something useful. For example:

DTS Error: Microsoft.SqlServer.Dts.Runtime.TaskHost/QueueFuzzyName [33]SIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "OLE DB Destination Input" (46)" failed because error code 0xC020907D occurred, and the error row disposition on "input "OLE DB Destination Input" (46)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.


Where would I look up: DTS_E_INDUCEDTRANSFORMFAILUREONERROR and 0xC020907D? I understand that it tried to convert a value in something numbered 46 (no idea what that is) and the conversion failed. But that's it. How do I transmogrify 46 to something I can look at. I'm a little fuzzy on what a Destination Input is. Isn't an output a destination?

Or this one:

Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors"
Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E21.

I have absolutely no idea what this means except that many things happened, one of them failed, I have an error of some sort and it's error code is 0x80040E21. It must be important, it's in there twice, but what does it mean?

I'm thinking that in the help somewhere all these error messages are listed and I can look them up, but I can't seem to find it anywhere. Am I supposed to be converting them to decimal first?

Any advice from you experts would be much appreciated.

View 5 Replies View Related

Funny Network Behaviour

Jul 20, 2005

Hi,In order to establish a security enhanced SQL server setup, I triedto switch off network access by disabling all networking protocols,so that the server can only be reached through a pipe. Neverthelessthe server was visible in the network and could be accessed fromall clients. Does anybody know what is going on here?Georg

View 1 Replies View Related

Weird And Funny Question

Sep 22, 2006

I specified configuration like shown below

"select * from table where id<>***" always doesn't work

however i changed that like

"id != ***" working!

Who can tell me why?

View 3 Replies View Related

Funny Problem (bug?) Using MAX() On SQL Mobile

Feb 8, 2006

This sure looks like a bug, but I'm still new...

First I create a simple database:

SqlCeEngine eng = new SqlCeEngine(@"Data Source=My Documents est.sdf");
eng.CreateDatabase();
eng.Dispose();

Then I put something in it:

SqlCeConnection conn = new SqlCeConnection(@"Data Source=My Documents est.sdf");
SqlCeCommand cmd = new SqlCeCommand("CREATE TABLE myTable (ID int, name nchar(10))");
cmd.Connection=conn;
conn.Open();
cmd.ExecuteNonQuery();
cmd.CommandText="INSERT INTO myTable (ID, name) VALUES (1,'bill')";
cmd.ExecuteNonQuery();

Then I try to get the maximum value from the first column.

cmd.CommandText = "SELECT max(ID) FROM myTable";
int index = (int)cmd.ExecuteScalar();

At this point I get an InvalidCastException raised. Using the datareader to extract the value produces the same exception, however I can go through the Query Analyzer on the device and execute the query and it comes out fine...???

This has really got me confused. Any thoughts?

View 8 Replies View Related

SqlBulkCopy Error Messages

Sep 6, 2006

I'm using SqlBulkCopy.  Does anyone know how I can output what row (its column names) are throwing a duplicate primary key message when I bulkCopy.WriteToServer(datatable1)?Thanks 

View 1 Replies View Related

Dynamic SQL Error Messages!

Mar 3, 2008

Have this dynamic sql statement that I'm working on.  It works fine outside the execute (running the query by iteself) and prints fine but when I execute it, I get errors.  Spacing is good.  Here is the SQL statement.
 set @sql = 'insert into #participantInfo (strfirstname,strlastname,strindividualfk,strusername,dtelastlogin,blninactive,fk_intrightid,imgPhoto, stre_mail,strmiddleinitial,straddress1,straddress2,strcity,fk_intlocationid,strpostalcode,strhomephone,strbusinessphone,strmiscinfo1, strmiscinfo2,strsecretquestion,dteDateOfBirth,intgender,strsecretanswer)  select p.strfirstname,p.strlastname,p.strindividualfk,l.strusername,l.dtelastlogin,p.blninactive,r.fk_intrightid,p.imgPhoto, p.stre_mail,p.strmiddleinitial,p.straddress1,p.straddress2,p.strcity,p.fk_intlocationid,p.strpostalcode,p.strhomephone,p.strbusinessphone, p.strmiscinfo1,p.strmiscinfo2,l.strsecretquestion,p.dteDateOfBirth,p.intgender,l.strsecretanswer  from tblparticipants p inner join  tblparticipantrights r on p.strindividualfk = r.strindividualfk inner join  tblparticipantlogin l on p.strindividualfk = l.strindividualfk  where p.fk_strsubgroupid = ''' +  @strsubgroupid + ''''
exec (@sql)
Error messages are:
Server: Msg 208, Level 16, State 1, Line 1Invalid object name 'tblparticipants'.Server: Msg 208, Level 16, State 1, Line 1Invalid object name 'tblparticipantrights'.Server: Msg 208, Level 16, State 1, Line 1Invalid object name 'tblparticipantlogin'. 
Anyone see what may be the cause?
 thanks ^_^

View 6 Replies View Related

Error Messages To A File?

Aug 23, 2001

How to write the error messages generated in a job to a file?Thanks.

View 1 Replies View Related

How To Get More Info For Error Messages

Jul 10, 2000

So far I have not been able to figure out how to get more info
regarding the sql server errors. For example, I get this error
from sql server query analyzer (this just an example):

-----------
Server: Msg 128, Level 15, State 1, Line 5
The name 'does' is not permitted in this context.
Only constants, expressions, or variables allowed here.
Column names are not permitted.
-----------


Is there a way to find more information regarding this error, or
like Oracle has MeataLink, where you can search, if someone else
already got this error and how it got resolved?

Or how you folks go about resolving errors you get? Is it based
on trail and error, or experience (like already encountered this
type before) etc.?

View 1 Replies View Related

Dbcc Error Messages

Sep 23, 1999

If you find error messages in the dbcc results, how do you find out which table it is according to the ID number 875696?

ie:

Checking 875696
The number of data pages in this table is .....

View 3 Replies View Related

Logging Error Messages

May 7, 2002

Hi,

How can I avoid certain messages from SQL Server being recorded into the Event viewer ?
For example, every time I truncate the transaction log with 'Backup log with truncate_only', It is being recorded into the Event viewer as an Error. But, I know that it is not an error.
How can I avoid this ?

Thanks

View 1 Replies View Related

PLEASE HELP!!! Multiple Error Messages

Jan 3, 2008

I have a SS2K5 stored procedure that executes 2 others stored procedures
sp_zero1 and sp_zero2
sp_zero1 and sp_zero2 do the same thing ... raises an Divide by zero error
I need to (print / select into a database) both error messages using just one
try catch block instead of 2 blocks like in the next example:


-- THIS IS THE WORKING CODE THAT I DONT WANT
BEGIN TRY
exec sp_zero1
END TRY
BEGIN CATCH
PRINT ERROR_MESSAGE()
PRINT ERROR_PROCEDURE()
END CATCH
BEGIN TRY
exec sp_zero2
END TRY
BEGIN CATCH
print ERROR_MESSAGE()
print ERROR_PROCEDURE()
END CATCH



if I try the next code

--THIS IS THE NON WORKING CODE
BEGIN TRY
exec sp_zero1
exec sp_zero2
END TRY
BEGIN CATCH
print ERROR_MESSAGE()
print ERROR_PROCEDURE()
END CATCH

only the first error message is printed and the execution is stopped

This is a generic example ... in reality I have a stored procedure that executes tens and hundreds of other stored procedures ... so thats the reason I need just one block of try catch instead of hundreds of blocks

thank you

View 6 Replies View Related

Reading The Error Messages

May 22, 2006

when a statement fails and it tell me for example

Server: Msg 137, Level 15, State 2, Procedure spinsertnew, Line 266
Must declare the variable '@'.

How can I find which line it is using query manager?

View 13 Replies View Related







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