How To Check SQL Server State Using ASP.net 2.0

Apr 29, 2007

Hi

I want to build a class in ASP.Net 2.0 which will lookup if SQL server is up & running & whther connection is getting establish to the Database. if it fails it will try 3 time to reconnect. if no sucess then it will shoot a mail to Admin. 

Please help me to achive this.

Thanks

Vishal. 

 

 

View 1 Replies


ADVERTISEMENT

How To Check Out Cluster State Remotely?

Jan 10, 2007

Hi everyone,

Primary platform on client is XP Pro sp2 and on server Win2003 Ad.Server 64-bit
We're looking for any snippet or link related with Clustering instantiating.
We need to call our remote cluster from an ASP 3.0 page and check out if one of our Active Resource is up (in this case is a .net service) .

We suppose that it should be done for each node. It's an Active-Passive cluster.

Thanks for your time,

View 2 Replies View Related

SQL Server Session State - Using A 1.1 Database Schema For 2.0 Session State Storage

Aug 3, 2006

The 2.0 version of ASPSTATE is slightly different than the 1.1 version in that one table has one additional column and another table uses a different data type and size for the key. The 2.0 version also has a couple additional stored procedures.

We'd like to manage just one session state database if possible so we're trying to figure out if Microsoft supports using the new schema for 1.1 session state access (it seems to work, but our testing has been very light).

Is there any official support line on this? If not, can anyone comment on whether or not you'd expect it to work and why?

Thanks.

View 1 Replies View Related

Server: MSg 17, Level 16, State 1 [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server Does Not Exist Or Access Denied

Jun 6, 2007

Hi,

When I am trying to access SQL Server 2000 database from another machine i got this error

Server: MSg 17, Level 16, State 1 [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied

but I could access the database on same server and in that server i could access other databases in different server.



View 6 Replies View Related

Query Analyzer Error Unable To Connect Server Local Msg17, Level 16,state 1/ODBC SQL Server Driver [DBNETLIB]SQL Server Does Not

Oct 20, 2007

I am getteing
need help
Query analyzer error Unable to connect server local Msg17, level 16,state 1
ODBC SQL server driver [DBNETLIB]SQL server does not exist

View 6 Replies View Related

Principal Db In Principal, Synchronizing State, The Mirror In Restoring State

Sep 26, 2007

We have mirroring setup for 5 dbs, 4 of which are synchronized and 1 which is in "synchronizing" state on the principal and "restoring" state on the mirror. Mirroring for all dbs has been working fine for the past several months and we have a witness that has allowed automatic failover in the past without problems.

This database has several bulk inserts performed throughout the day and am sure there is some latency due to the size of these transactions.

Not sure as to why this is happening all of a sudden, but the db in question has been in this state for the past 12 hrs. I checked the mirroring status on the principal and it states that it is "synchronizing: data is being transferred from principal to mirror", but the mirror server states that db is in "restoring" state. Can anyone suggest as to how I can get the database on the mirroring server to get back to "mirror, synchronizing/restoring..." state? Or suggest on how I can troubleshoot this?

Thanks in advance.

View 3 Replies View Related

SQL Server 2000 Server: Msg 18456, Level 14, State 1, Line 1 Login Failed For User 'sa'.

Feb 28, 2007

As an 'SA' I thought that you have permission to do anything on the server. Running an update command from Query Analyzer is throwing this error:

SQL Server 2000 SP3

Server: Msg 18456, Level 14, State 1, Line 1
Login failed for user 'sa'.


The table is in the dbo schema.

Has anyone seen this error before?

View 12 Replies View Related

SQL Licensing For State Server

Mar 10, 2006

Hello all,
I have a question concerning the ridiculous quagmire of SQL Server licensing…
How is SQL Server licensed when used to store session state information?  Is MS claiming that this is an end user use of SQL Server functionality?  Or, can we be realistic and say that I need a server license plus a device license for each web server?
 
Personally, I like everything about SQL Server except the licensing.  Management at my company has already said that we’ll most likely be moving to either Firebird or Postgres after they found out how much it would cost to move from SQL 2k to SQL 2005.  If MS wants us to buy processor licenses for SQL state servers, I guarantee we’ll be doing something else there as well.  I wonder if Microsoft has any clue how much business they’re losing.  Not just in SQL Server, but in their OS business as well.

View 1 Replies View Related

Server: Msg 229, Level 14, State 5???

Jun 23, 2000

Server: Msg 229, Level 14, State 5, Procedure sp_monitor, Line 167
EXECUTE permission denied on object 'sp_monitor', database 'master', owner 'dbo'.


How do I fix this? which roles, or permission is that? Is there a
easier way to find out solutions for these problems, as books online
does not seem to provide much help.

Thanks,

Vijay

View 2 Replies View Related

Server: Msg 11, Level 16, State 1

May 13, 2008

IN THE SQL SERVER 2000 AND IN ALSO IN 2005 WHEN GOING FOR THE LOGGING IN TO THE SQL SERVER USING A PUBLIC IP, AND GIVING THE SQL SERVER AUTENTICATION IT IS GIVING THE FOLLOWING ERROR

Server: Msg 11, Level 16, State 1[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]General network error. Check your network documentation.

THE SAME ISSUE HAPPENING WITH THE ODBC CONNECTION. CAN ANYONE EXPLAIN ME WITH THE FOLLOWING ERROR

DO NOT GIVE A SUGGESTION OF REINSTALLATION, BECAUSE TRIED THAT ONE TOO

REGARDS

CHAITANYA BABU YANAMADALA

View 2 Replies View Related

SQL Server 2000 - Server: Msg 9002, Level 17, State 6, Line 1

Jul 20, 2005

I have a stored procedure that takes 18 hours to complete. SometimesI get the below error message when I run the stored procedure.'Server : Msg 9002, Level 17, State 6, Line 1 The log file fordatabase 'Customer' is full. Back up the transaction log for thedatabase to free up some log space.'.I checked my log file and it is not full. And I don't know why I amgetting this message. Any help is appreciated.Thanks,Anjula

View 2 Replies View Related

Server: Msg 209, Level 16, State 1, Line 6 HELP

Jun 7, 2005

Simple SQL Error Can anyone help for a new starter. Error MessageServer: Msg 209, Level 16, State 1, Line 6 Ambiguous column name 'CustomerID'.Codeselect CustomerID, ContactName, OrderId from CustomersInner Join Orders OnCustomers.CustomerID = Orders.CustomerIDDBMS = SQL Server 2000 SP 3aDatabase = NorthwindI have no idea why i receive this error

View 1 Replies View Related

SQL Server 6.0 Help - Service State Indeterminate

Aug 28, 2002

I don't know too much about 6.0 so I need your help. I can't get to this database with a 6.5 enterprise manager either. The SQLOLE65.SQL script hasn't been run against the master database.

Well, here's the problem the Service Manager shows the services in a SERVICE STATE INDETERMINATE. No green, yellow red showing. I can't get into the database using enterprise manager because it says it's unavailable. However, on the enterprise manager it shows the database in a green (running state). So I'm uncertain whether to stop and start the database.

Has anyone every ran this SQLOLE65.SQL script so they can manage a 6.0 db thru a 6.5 enterprise manager? If so, please provide step by step instructions or warnings to look out for....

thanks

View 1 Replies View Related

Server: Msg 536, Level 16, State 3, Line 1

Mar 16, 2001

Hi, I would appreciate your help. I donot know why I am getting this error when I run this query :
if (select SUBSTRING(de_ftpdownload,1,CHARINDEX('.',de_ftpdow nload,0)-1)as de_ftpdownload from vendor_invoice)
<> (select stamp_number from vendor_invoice)
select 'no'
else
select 'yes'

I get this Error
Server: Msg 536, Level 16, State 3, Line 1
Invalid length parameter passed to the substring function.
----
yes
(1 row(s) affected)
I would appreciate your hlep

Al

View 1 Replies View Related

Server: Msg 107, Level 16, State 2, Line 1

Jun 23, 2004

Can anybody help me with this syntax?
select
PHN.N_PHN_ID 'ID',
PHN.N_PHN_AREACD 'AREAD1',
PHN.N_PHN_PREFIX 'PREFIXD1',
PHN.N_PHN_NUMBER 'NBRD1',
PHN.N_PHN_EXTENTN 'EXTD1',
PHN2.N_PHN_AREACD 'AREAD2',
PHN2.N_PHN_PREFIX 'PREFIXD2',
PHN2.N_PHN_NUMBER 'NBRD2',
PHN2.N_PHN_EXTENTN 'EXTD2'
from Donor_Visit2 DV2 RIGHT OUTER JOIN NAT_PHN_DB_REC PHN
ON DV2.COUNT_INSTID = PHN.N_PHN_INSTID
RIGHT OUTER JOIN NAT_PHN_DB_REC PHN2
ON DV2.COUNT_ID = PHN2.PHN.N_PHN_ID
order by PHN.N_PHN_ID

here is the error message:
Server: Msg 107, Level 16, State 2, Line 1
The column prefix 'PHN2.PHN' does not match with a table name or alias name used in the query.

View 1 Replies View Related

Server: Msg 208, Level 16, State 1, Line 1

Nov 22, 2004

Hello All,

This table was created by coldfusion and has been given all priviliges to public and I am in the public group but I still cant select from it. It gives me this error message: Server: Msg 208, Level 16, State 1, Line 1. Help!

Thanks in Advance.

View 5 Replies View Related

The Mirrored Server Is Always In The State Of Restoring Only

Jun 6, 2006

The database in Mirrored server is always in the state of restoring only.

the database in mirrored server is restored with norecovery

then we started mirroring.

the status of mirroring is successfull and is synchronized.

but the Mirrored server is always in the state of restoting

not allowing use to open the database.



could any one know why this problem is comming and give some solution for this problem so that the mirrored database can be accessible opened and queryed to really verfiy that the changes made in principal database is mirrored to Mirrored database.

View 3 Replies View Related

Grant View Server State

Aug 29, 2006

New SQL User...v2005. I have been directed to Grant "View Server State" permissions to a user. However, I don't see it in the list of choices I can grant access to in Permissions, nor is there a visible hyperlink in an area that it is expected to be. I have also tried setting that permission in a query window to no avail as well. I can provide additional info if someone would like to work with me on this issue. Thanks!

View 1 Replies View Related

Server: Msg 18452, Level 14, State 1

Jul 18, 2007

Hi All,

I am facing a very strange problem in one of my SQL2000 instance.

Actually, In one of my 2000 instance 'A', I have linked another 2000 instance 'B' (server 'B' is running under windows authentication) and I am a member of a group (SQL_Group) and that group is listed in sysadmin of both 'A' and 'B' Instances. When I am trying to run a simple select query from server 'A' to linked server 'B'

i.e. select top 2 * from [<Server_Name> <Instance_ Name>].master. dbo.sysobjects

It is giving me an error.

Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.

But rest of the members of same group (SQL_Group) are able to execute this query. Can anyone please let me know why this issue is only for me even I am having the same permissions as others??

Any help will be highly appreciated. thanks a lot to all of you.



Rizwan...........

View 2 Replies View Related

SQL Server 18456 Error State 16

Mar 25, 2008

hello all

Since some days, i have this problem : i changed RTCcomponentService password, and now, when the SQL Server RTC service start (correctly, with network service), i have this log error message :
Login failed for user 'CGAUPARTCComponentService'. [CLIENT: <named pipe>]
ErrorReportingManager: Error raised, major=184, minor=56, severity=14, attempting to create sym

so, the service run with network (nt authority) correctly, but i have this error message.
I think that the sql server database connect with rtccomponentservice old password.
How I can change the password on this connection ? or what is de default password for RTCcomponentService ?

THanks

View 1 Replies View Related

Server: Msg 1101, Level 17, State 10, Line 8

Jan 25, 2002

If we run the query below with the values of 'rml' and 'ra' it runs but if we use 'cca' and 'cc' we get this error:

Server: Msg 1101, Level 17, State 10, Line 8
Could not allocate new page for database 'TEMPDB'. There are no more pages available in filegroup DEFAULT. Space can be created by dropping objects, adding additional files, or allowing file growth.

Here is the query

Declare @Level_1 varchar(3),
@Level_2 varchar(2)

Select @Level_1 = 'cca'
Select @Level_2 = 'cc'

select distinct tblAsset.State, tblAsset.County, tblAsset.Plant, tblAsset.Account,
tblAsset.Acq_Yr, tblAsset.Acq_Pd, tblAsset_Book.Cost_Original,
tblCounty_Names.County_Name, CER..tblLocation.Location,
tblGL_Account.Account_Desc

from tblAsset, tblAsset_Book, tblCounty_Names, CER..tblLocation, tblGL_Account
where tblAsset_Book.Level_1 = @Level_1
and tblAsset.Level_1 = tblAsset_Book.Level_1
and tblAsset_Book.Level_2 = @Level_2
and tblAsset.Level_2 = tblAsset_Book.Level_2
and tblGL_Account.Company = tblAsset.Level_2
and CER..tblLocation.SBU = tblGL_Account.Company
and tblCounty_Names.County = tblAsset.County
and CER..tblLocation.County = tblCounty_Names.County
and CER..tblLocation.Code = tblAsset.Plant
and tblGL_Account.Account = tblAsset.Account
and tblAsset_Book.Book_Number = '1'
order by tblAsset.State

View 1 Replies View Related

Help : Server: Msg 8152, Level 16, State 9, Line 1

Jan 5, 2001

When I try to update one table from another I get the following error
message, Does anyone know what may be the cause of the error :

Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.

Thanks

KUL

View 2 Replies View Related

Server:Msg 1105,Level 17,State 2,Line9

Oct 24, 2005

Server:Msg 1105,Level 17,State 2,Line9
Coule not allocate space to the object 'Tutorial' on 'Mytest1db'
in database because the 'PRIMARY' file group is full.

When I run a query to insert records into a table....i'm getting this error.Please Help....

View 2 Replies View Related

Server: Msg 2511, Level 16, State 1, Line 1

Feb 9, 2006

Dear All participants.

My distribution log file size is reached upto 33GB, What I should do?

Any clue or helps are too appreciable.

Thanks
R.Mall

View 3 Replies View Related

Server: Msg 2537, Level 16, State 43, Line 1

Aug 25, 2007

i have sp4 install. Anyone know how to fix it?

Server: Msg 2537, Level 16, State 43, Line 1
Table error: Object ID 1376776012, index ID 0, page (1:56868), row 2. Record check (Valid SqlVariant) failed. Values are 7 and 0.
Server: Msg 2537, Level 16, State 1, Line 1 ... so on

=============================
http://www.sqlserverstudy.com

View 9 Replies View Related

SQL Server Msg 1105, Level 17, State 2, Line 1

Nov 23, 2005

Dear (and mighty) all:I backed up a database (SQL server 7.0) and tried to restore it onanother system (SQL Server 2000). This is not the first time I'm doingthis and never had a problem before:-- in the source dbBACKUP db_icoaraci TO DISK = 'C:TEMPBACKUP-ICOARACI.DAT'--in the destination dbRESTORE db_icoaraci FROM DISK='E:TEMPBACKUP-ICOARACI.DAT'WITH MOVE='ICOARACI_DAT' TO 'E:DBICOARACI.MDF',MOVE='ICOARACI_LOG' TO 'E:DBICOARACI.LDF'Today, to my surprise, the destination SQL returned the followingerror:Processed 25592 pages for database 'db_icoaraci', file 'ICOARACI_DAT'on file 1.Processed 1 pages for database 'db_icoaraci', file 'ICOARACI_LOG' onfile 1.Server: Msg 1105, Level 17, State 2, Line 1Could not allocate space for object '(SYSTEM table id: 6)' in database'db_icoaraci' because the 'PRIMARY' filegroup is full.Server: Msg 3013, Level 16, State 1, Line 1RESTORE DATABASE is terminating abnormally.I searched the list and a found a few posts refering to the same error,but none in the exactly same scenario.I tried to restore the database with NORECOVERY, and, before restoringthe log, increase its size (ALTER DATABASE ... etc), but SQL Serversays that the DB couldn't be open because it's in the middle of arestore...I'll appreciate any help.Regards,Branco.

View 3 Replies View Related

DB Engine :: Database Server Is In Hang State

Oct 13, 2015

SQL server DB server is in hang state. Is this is due to high memory utilization?

View 9 Replies View Related

Server: Msg 8152, Level 16, State 6, Line 196

Dec 17, 2007

I am experiencing some frustration in regards to parsing an email that I need to work with.
(I don't have control over the format of the email I am receiving)

Any help would be appreciated.
Thank you
Jake

Here is the error I get, when I use the SQL Query Analyzer to process my Stored Procedure. (Not every email gets this error, just some, others process just fine.)

String or binary data would be truncated.
The statement has been terminated.
Stored Procedure: eResponse.dbo.spParser
Return Code = -6

My Code is as follows:

CREATE PROCEDURE spParser
@_id nvarchar(50)
AS
--assumes the email is no longer than 4000 characters. if it might be longer, bump this number up.
-- Common Varriables
DECLARE @body nvarchar(4000)
DECLARE @i int
DECLARE @phone nvarchar(50)
DECLARE @phonestart int
DECLARE @phoneend int
DECLARE @email nvarchar(50)
DECLARE @emailstart int
DECLARE @emailend int
DECLARE @comments nvarchar(3000)
DECLARE @commentsstart int
DECLARE @commentsend int
DECLARE @OrigID varchar(50)
-- Jose Ole Variables
DECLARE @firstname nvarchar(50)
DECLARE @firstnamestart int
DECLARE @firstnameend int
DECLARE @lastname nvarchar(50)
DECLARE @lastnamestart int
DECLARE @lastnameend int
DECLARE @address1 nvarchar(50)
DECLARE @address1start int
DECLARE @address1end int
DECLARE @address2 nvarchar(50)
DECLARE @address2start int
DECLARE @address2end int
DECLARE @city nvarchar(50)
DECLARE @citystart int
DECLARE @cityend int
DECLARE @state nvarchar(5)
DECLARE @statestart int
DECLARE @stateend int
DECLARE @zip nvarchar(15)
DECLARE @zipstart int
DECLARE @zipend int
DECLARE @country nvarchar(50)
DECLARE @countrystart int
DECLARE @countryend int
DECLARE @phone2 nvarchar(50)
DECLARE @phone2start int
DECLARE @phone2end int
DECLARE @productname nvarchar(50)
DECLARE @productnamestart int
DECLARE @productnameend int
DECLARE @upccode nvarchar(50)
DECLARE @upccodestart int
DECLARE @upccodeend int
DECLARE @datecode nvarchar(50)
DECLARE @datecodestart int
DECLARE @datecodeend int
DECLARE @purchaseat nvarchar(50)
DECLARE @purchaseatstart int
DECLARE @purchaseatend int
DECLARE @purchasecity nvarchar(50)
DECLARE @purchasecitystart int
DECLARE @purchasecityend int
DECLARE @datepurchased nvarchar(50)
DECLARE @datepurchasedstart int
DECLARE @datepurchasedend int
DECLARE @dateopened nvarchar(50)
DECLARE @dateopenedstart int
DECLARE @dateopenedend int
DECLARE @subject nvarchar(50)
DECLARE @subjectstart int
DECLARE @subjectend int
-- Windosr Variables
DECLARE @name nvarchar(50)
DECLARE @namestart int
DECLARE @nameend int
DECLARE @company nvarchar(50)
DECLARE @companystart int
DECLARE @companyend int

--First replace all ASCII carriage returns and line feeds and assign the whole chunk of data to a variable.
SET @body = (select replace( REPLACE(convert(varchar(4000), message),CHAR(10),' '),CHAR(13),'') from message where mailid = @_id)
--below is the sample syntax for the individual replacements of line feeds and carriage returns, but it's combined into one statement above.
--SELECT REPLACE(@jb,CHAR(10),'') as firstpass
--SELECT REPLACE(@jb,CHAR(13),'') as secondpass
IF left(@body,47) = 'Fromubject:contact info sent from samplesite.com'
--If this is true.. then it is a sample company.
BEGIN
--The 12 in the start is compensating for the 12 Characters of "First Name: "
--Below is collecting First Name
SET @firstnamestart = (CHARINDEX('First name:',@body) + 11)
SET @firstnameend = (CHARINDEX('Last name:',@body) - 1)
SET @firstname = SUBSTRING(@body,@firstnamestart,@firstnameend-@firstnamestart)
----Below is collecting Last Name
SET @lastnamestart = (CHARINDEX('Last name:',@body) + 10)
SET @lastnameend = (CHARINDEX('Address 1:',@body) - 1)
SET @lastname = SUBSTRING(@body,@lastnamestart,@lastnameend-@lastnamestart)
--Below is collecting Address1
SET @address1start = (CHARINDEX('Address 1:',@body) + 10)
SET @address1end = (CHARINDEX('Address 2:',@body) - 1)
SET @address1 = SUBSTRING(@body,@address1start,@address1end-@address1start)
--Below is collecting Address2
SET @address2start = (CHARINDEX('Address 2:',@body) + 10)
SET @address2end = (CHARINDEX('City:',@body) - 1)
SET @address2 = SUBSTRING(@body,@address2start,@address2end-@address2start)
--Below is collecting city information
SET @citystart = (CHARINDEX('City:',@body) + 5)
SET @cityend = (CHARINDEX('State/Prov',@body) -1)
SET @city = SUBSTRING(@body,@citystart,@cityend-@citystart)
--Below is collecting state information
SET @statestart = (CHARINDEX('State/Province:',@body) + 15)
SET @stateend = (CHARINDEX('Zip/Postal',@body) -1)
SET @state = SUBSTRING(@body,@statestart,@stateend-@statestart)
--Below is collecting zip information
SET @zipstart = (CHARINDEX('Zip/Postal Code:',@body) + 16)
SET @zipend = (CHARINDEX('Country',@body) -1)
SET @zip = SUBSTRING(@body,@zipstart,@zipend-@zipstart)
--Below is collecting country information
SET @countrystart = (CHARINDEX('Country:',@body) + 8)
SET @countryend = (CHARINDEX('E-mail address',@body) -1)
SET @country = SUBSTRING(@body,@countrystart,@countryend-@countrystart)
--Below is collecting email information
SET @emailstart = (CHARINDEX('E-mail address:',@body) + 15)
SET @emailend = (CHARINDEX('Daytime',@body) -1)
SET @email = SUBSTRING(@body,@emailstart,@emailend-@emailstart)
--Below is collecting phone information
SET @phonestart = (CHARINDEX('Daytime Phone:',@body) + 14)
SET @phoneend = (CHARINDEX('Evening Phone:',@body) -1)
SET @phone = SUBSTRING(@body,@phonestart,@phoneend-@phonestart)
--Below is collecting phone2 information
SET @phone2start = (CHARINDEX('Evening Phone:',@body) + 14)
SET @phone2end = (CHARINDEX('Product Name',@body) -1)
SET @phone2 = SUBSTRING(@body,@phone2start,@phone2end-@phone2start)
--Below is collecting Product Name information
SET @productnamestart = (CHARINDEX('Product Name:',@body) + 12)
SET @productnameend = (CHARINDEX('UPC Code:',@body) -1)
SET @productname = SUBSTRING(@body,@productnamestart,@productnameend-@productnamestart)
--Below is collecting UPC Code information
SET @upccodestart = (CHARINDEX('UPC Code:',@body) + 9)
SET @upccodeend = (CHARINDEX('Date Code:',@body) -1)
SET @upccode = SUBSTRING(@body,@upccodestart,@upccodeend-@upccodestart)
--Below is collecting Date Code information
SET @datecodestart = (CHARINDEX('Date Code:',@body) + 10)
SET @datecodeend = (CHARINDEX('Purchased At',@body) -1)
SET @datecode = SUBSTRING(@body,@datecodestart,@datecodeend-@datecodestart)
--Below is collecting Purchase At information
SET @purchaseatstart = (CHARINDEX('Purchased At',@body) + 26)
SET @purchaseatend = (CHARINDEX('Purchase City:',@body) -1)
SET @purchaseat = SUBSTRING(@body,@purchaseatstart,@purchaseatend-@purchaseatstart)
--Below is collecting Purchase City information
SET @purchasecitystart = (CHARINDEX('Purchase City:',@body) + 14)
SET @purchasecityend = (CHARINDEX('Date Purchased',@body) -1)
SET @purchasecity = SUBSTRING(@body,@purchasecitystart,@purchasecityend-@purchasecitystart)
--Below is collecting Date Purchased information
SET @datepurchasedstart = (CHARINDEX('Date Purchased:',@body) + 15)
SET @datepurchasedend = (CHARINDEX('Date Opened',@body) -1)
SET @datepurchased = SUBSTRING(@body,@datepurchasedstart,@datepurchasedend-@datepurchasedstart)
--Below is collecting Date Opened information
SET @dateopenedstart = (CHARINDEX('Date Opened:',@body) + 12)
SET @dateopenedend = (CHARINDEX('E-mail Subject:',@body) -1)
SET @dateopened = SUBSTRING(@body,@dateopenedstart,@dateopenedend-@dateopenedstart)
--Below is collecting Email Subject information
SET @subjectstart = (CHARINDEX('E-mail Subject:',@body) + 15)
SET @subjectend = (CHARINDEX('Comments:',@body) -1)
SET @subject = SUBSTRING(@body,@subjectstart,@subjectend-@subjectstart)
--Below is collecting message information
SET @commentsstart = (CHARINDEX('Comments:',@body) + 10)
SET @commentsend = len(@body)
SET @comments = SUBSTRING(@body,@commentsstart,@commentsend-@commentsstart)
--below is the part that actually writes the data out to the Output table
INSERT INTO OutputEmails
(FirstName, LastName, Address1, Address2, City, State, Zip, Country, eMail, Phone, Phone2, ProductName, UPCCode, DateCode, PurchaseAt, PurchaseCity, DatePurchased, DateOpened, Subject, Comments, OrigID)
SELECT
ltrim(SUBSTRING(@body,@firstnamestart,@firstnameend-@firstnamestart)) as FirstName,
ltrim(SUBSTRING(@body,@lastnamestart,@lastnameend-@lastnamestart)) as LastName,
ltrim(SUBSTRING(@body,@address1start,@address1end-@address1start)) as Address1,
ltrim(SUBSTRING(@body,@address2start,@address2end-@address2start)) as Address2,
ltrim(SUBSTRING(@body,@citystart,@cityend-@citystart)) as City,
ltrim(SUBSTRING(@body,@statestart,@stateend-@statestart)) as State,
ltrim(SUBSTRING(@body,@zipstart,@zipend-@zipstart)) as Zip,
ltrim(SUBSTRING(@body,@countrystart,@countryend-@countrystart)) as Country,
ltrim(SUBSTRING(@body,@emailstart,@emailend-@emailstart)) as eMail,
ltrim(SUBSTRING(@body,@phonestart,@phoneend-@phonestart)) as Phone,
ltrim(SUBSTRING(@body,@phone2start,@phone2end-@phone2start)) as Phone2,
ltrim(SUBSTRING(@body,@productnamestart,@productnameend-@productnamestart)) as ProductName,
ltrim(SUBSTRING(@body,@upccodestart,@upccodeend-@upccodestart)) as UPCCode,
ltrim(SUBSTRING(@body,@datecodestart,@datecodeend-@datecodestart)) as DateCode,
ltrim(SUBSTRING(@body,@purchaseatstart,@purchaseatend-@purchaseatstart)) as PurchaseAt,
ltrim(SUBSTRING(@body,@purchasecitystart,@purchasecityend-@purchasecitystart)) as PurchaseCity,
ltrim(SUBSTRING(@body,@datepurchasedstart,@datepurchasedend-@datepurchasedstart)) as DatePurchased,
ltrim(SUBSTRING(@body,@dateopenedstart,@dateopenedend-@dateopenedstart)) as DateOpened,
ltrim(SUBSTRING(@body,@subjectstart,@subjectend-@subjectstart)) as Subject,
ltrim(SUBSTRING(@body,@commentsstart,@commentsend-@commentsstart)) as Comments,
@_id as OrigID
FROM dbo.message
WHERE (mailId = @_id)
END
ELSE BEGIN
--below prints the whole value in the debugger (SQL Query Analyzer)
--print @body
--below prints the length of the whole value
--print len(@body)
--below prints the location of 'Callers Name:'
--Print CHARINDEX('Name: ',@body)
--Below is collecting the Name information
--The 6 in the start is compensating for the 6 Characters of "Name: "
SET @namestart = (CHARINDEX('Name:',@body) + 5)
SET @nameend = (CHARINDEX('Email:',@body) - 1)
SET @name = SUBSTRING(@body,@namestart,@nameend-@namestart)
--Below is collecting email information
SET @emailstart = (CHARINDEX('Email:',@body) + 6)
SET @emailend = (CHARINDEX('Title:',@body) -1)
SET @email = SUBSTRING(@body,@emailstart,@emailend-@emailstart)
--Below is collecting Company information
SET @companystart = (CHARINDEX('Company:',@body) + 8)
SET @companyend = (CHARINDEX('Phone Number:',@body) -1)
SET @company = SUBSTRING(@body,@companystart,@companyend-@companystart)
--Below is collecting phone information
SET @phonestart = (CHARINDEX('Phone Number:',@body) + 13)
SET @phoneend = (CHARINDEX('Comments:',@body) -1)
SET @phone = SUBSTRING(@body,@phonestart,@phoneend-@phonestart)
--Below is collecting message information
SET @commentsstart = (CHARINDEX('Comments:',@body) + 9)
SET @commentsend = len(@body)
SET @comments = SUBSTRING(@body,@commentsstart,@commentsend-@commentsstart)
--below is the part that actually writes the data out to the Output table
INSERT INTO OutputEmails
(Name, eMail, Company, Phone, Comments, OrigID)
SELECT
ltrim(SUBSTRING(@body,@namestart,@nameend-@namestart)) as Name,
ltrim(SUBSTRING(@body,@emailstart,@emailend-@emailstart)) as eMail,
ltrim(SUBSTRING(@body,@companystart,@companyend-@companystart)) as Company,
ltrim(SUBSTRING(@body,@phonestart,@phoneend-@phonestart)) as Phone,
ltrim(SUBSTRING(@body,@commentsstart,@commentsend-@commentsstart)) as Comments,
@_id as OrigID
FROM dbo.message
WHERE (mailId = @_id)
END
--At the very end when you're satisfied that the data has been processed properly, delete the appropriate message record from the message table
DELETE FROM MESSAGE Where message.mailID = @_ID
GO

Sample Data that has problems

Fromubject:contact info sent from samplesite.comBody:First name: Sample
Last name: Name
Address 1: 123 Testing Road
Address 2: Don't filled
City: Park Forest
State/Province: FL
Zip/Postal Code: 12345-1234
Country: USA
E-mail address: validemail@email.com
Daytime Phone: 123-123-1234
Evening Phone: Don't filled
Product Name: Sample Product with Cheese
UPC Code: 12345-89521
Date Code: 1251237 D PST . 5290
Purchased At (Store Name): StoreName
Purchase City: Store City
Date Purchased: 12/8/2007
Date Opened: 12/14/2007
E-mail Subject: nail in product
Comments: when I purchased your product, there was something in it. Obviously I am not happy about this. Please contact me. Thank you John Q Public

View 6 Replies View Related

MS SQL Server Error 18456 Severity 14 State 8

Oct 19, 2007



This is on SQL Server 2005 for the sa account. I am just looking the in the sql server error log.I know this is a password mismatch. Where is it mismatched? Does there have to be a 'sa' network user account now with 2005?

Any help would be very appreciated.

Joanne Mahoney

View 18 Replies View Related

SQL Server 2005 SP2 -- Error With ASP.Net Session State Using TempDB

Mar 14, 2007

I have an ASP.Net (C# 2.0) application that has been using SQL Server 2005 Standard Edition with Service Pack 1 to hold the session state in a testing environment.  Currently, the session state is being stored in TempDB, rather than the ASPState database.  This has worked very well for us until yesterday.  We installed SQL Server 2005 Service Pack 2, as well as the Critical Update for Service Pack 2 (KB933508).  Once the SQL server was rebooted, I got the following error message when I tried to access the web application.
The SELECT permission was denied on the object 'ASPStateTempApplications', database 'tempdb', schema 'dbo'.The SELECT permission was denied on the object 'ASPStateTempApplications', database 'tempdb', schema 'dbo'.The INSERT permission was denied on the object 'ASPStateTempApplications', database 'tempdb', schema 'dbo'. 
In the web.config file for the application, I have a SQL username and password defined that can access the ASPState database.  To correct this issue, I had to give this user db_datareader and db_datawriter access to tempDB.
 
Has anyone else run across this problem, and is it related to SQL Server 2005 Service Pack 2?

View 1 Replies View Related

Problems Storing Session State In SQL Server Database

Jul 26, 2004

I am contemplating storing session state data in a SQL server database (created by running the installSqlState.sql script included in the .NET framework installation) and have established a functioning connection to the database but I am constantly getting "access denied". I've found that tweeking the permission settings in SQL for the ASP.NET user is resolving each specific error that arises but was wondering if there is a more "global" resolution? I'm finding myself having to manually check off each individual object and every option or is this what is needed to resolve the "access denied" error?

Thank you.

View 1 Replies View Related

Any Documentation On SQL Server State Icons Shown In MMC Console?

Feb 8, 2000

Does anyone know of any place I can find documentation on the meanings of the SQL Server state icons displayed in the MMC console for SQL Server 7.0? My server is showing the green running icon but also a vertical red squiggly line. I do not know what this red squiggly line means, and it concerns me. The databases all seem fine, and everything seems to be working, i just have this feeling like something bad is impending and I cannot find anything that tells me what it might be. Any help or suggestions would be greatly appreciated.

View 2 Replies View Related

SQL Server 2k Agent Service Stuck In Starting State

Mar 10, 2004

I have a Win 2003 server running 3 instances of SQL 2000 Enterprise.
The problem is I can only start 2 of the 3 Job Agents at a time, as the 3rd gets stuck in a starting state.
Has anyone struck this problem before?

Thanks.

View 8 Replies View Related







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