Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Friday, March 30, 2012

Problem with sql statement

I'm trying to use the following statement:

IF (IDS2_TXT.FIRST_MODIFIER="HQ" THEN
(IDS2_TXT.UNITS/240))

But an error appears whn i try to run it. Basically i want sql to only divide the amount of unit of a record if it finds a value on one of the fields (an leave the rest like they are) can someone please help me on what is wrong with the statement. Thank you.

using the derived column transformation:

FIRST_MODIFIER=="HQ"?(UNITS/240):UNITS

Frank

Wednesday, March 28, 2012

Problem with SQL Server Express database...

ERROR: Cannot open user default database. Login failed. Login failed for user 'ALINE\Doug's Account'.You are here: Skip Navigation LinksHome :Our Menu :Drinks

The database service is running and my connection tests worked out ok. What's next?

TIA,

Doug

This is turning out to be a nightmare...|||You need to give ALINE\Doug's Account logon permission to your database. Check out theCREATE LOGIN topic in Books Online.

problem with SQL server creating new database diagram

when i trying to create a new database diagram
it shows :

An unexpected error happened during this operation
[Ms design tools] - Invalid class string

can any 1 explain for me?
thank youHere are a few things you can try:

1. Try reinstalling the latest service pack (SP3a) on your PC.
2. If still having issues, uninstall the sql client tools, install latest MDAC, reinstall client tools,apply latest service pack.sql

Problem with sql server connection sting

Hi,
I am testing a asp page using sql server as the backend database. However, I
cannot connect to the database from asp. I have the following error coming
and I have also added the connection string that goes with the asp page.
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'sa'.
/aspsqlserver/logonprocess.asp, line 16
cn = "Provider=SQLOLEDB.1;User ID=sa;password=;Initial Catalog=test;Data
Source = TSU_SUPER"
I do not user any password to get into the sql server. I can open it from
my Enterprise Manager without using the userid sa and any password. With thi
s
situation, any help is appreciated. Thanks in advance.Am Mon, 5 Jun 2006 09:24:01 -0700 schrieb Jack:

> Hi,
> I am testing a asp page using sql server as the backend database. However,
I
> cannot connect to the database from asp. I have the following error coming
> and I have also added the connection string that goes with the asp page.
> Error Type:
> Microsoft OLE DB Provider for SQL Server (0x80040E4D)
> Login failed for user 'sa'.
> /aspsqlserver/logonprocess.asp, line 16
>
> cn = "Provider=SQLOLEDB.1;User ID=sa;password=;Initial Catalog=test;Data
> Source = TSU_SUPER"
> I do not user any password to get into the sql server. I can open it from
> my Enterprise Manager without using the userid sa and any password. With t
his
> situation, any help is appreciated. Thanks in advance.
Maybe this helps:
http://support.microsoft.com/kb/307002/EN-US/
bye, Helmut

Problem with SQL Server Agent.

SQL Server 2000 sp3 on Windows 2003. I am getting the
following error in the sql server agent log and I am not
able to run any of my jobs. sql server lightweight pooling
setting is set to 0.
[298] SQLServer Error: 18452, Login failed for
user '(null)'. Reason: Not associated with a trusted SQL
Server connection. [SQLSTATE 28000]
Thanks in Advance.
I have gotten this sometime when I use windows logins as the owner of a job.
I think it has something to do with our domain controller being unavailable
sometimes. When error occurs I have changed the owner to a sql server login
and the problems goes away.
----
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Obaid" <anonymous@.discussions.microsoft.com> wrote in message
news:5fb401c42dff$58db8b70$a601280a@.phx.gbl...
> SQL Server 2000 sp3 on Windows 2003. I am getting the
> following error in the sql server agent log and I am not
> able to run any of my jobs. sql server lightweight pooling
> setting is set to 0.
> [298] SQLServer Error: 18452, Login failed for
> user '(null)'. Reason: Not associated with a trusted SQL
> Server connection. [SQLSTATE 28000]
> Thanks in Advance.
|||If you server is in Mixed Mode set the owner of the job to be SA instead of the creater. Otherwise set the owner to be the same Network ID that SQLServer is running as.
Jeff Duncan
MCDBA, MCSE+I
sql

Problem with SQL Server Agent.

SQL Server 2000 sp3 on Windows 2003. I am getting the
following error in the sql server agent log and I am not
able to run any of my jobs. sql server lightweight pooling
setting is set to 0.
[298] SQLServer Error: 18452, Login failed for
user '(null)'. Reason: Not associated with a trusted SQL
Server connection. [SQLSTATE 28000]
Thanks in Advance.I have gotten this sometime when I use windows logins as the owner of a job.
I think it has something to do with our domain controller being unavailable
sometimes. When error occurs I have changed the owner to a sql server login
and the problems goes away.
--
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Obaid" <anonymous@.discussions.microsoft.com> wrote in message
news:5fb401c42dff$58db8b70$a601280a@.phx.gbl...
> SQL Server 2000 sp3 on Windows 2003. I am getting the
> following error in the sql server agent log and I am not
> able to run any of my jobs. sql server lightweight pooling
> setting is set to 0.
> [298] SQLServer Error: 18452, Login failed for
> user '(null)'. Reason: Not associated with a trusted SQL
> Server connection. [SQLSTATE 28000]
> Thanks in Advance.|||If you server is in Mixed Mode set the owner of the job to be SA instead of the creater. Otherwise set the owner to be the same Network ID that SQLServer is running as
Jeff Dunca
MCDBA, MCSE+I

Problem with SQL Server Agent.

SQL Server 2000 sp3 on Windows 2003. I am getting the
following error in the sql server agent log and I am not
able to run any of my jobs. sql server lightweight pooling
setting is set to 0.
[298] SQLServer Error: 18452, Login failed for
user '(null)'. Reason: Not associated with a trusted SQL
Server connection. [SQLSTATE 28000]
Thanks in Advance.I have gotten this sometime when I use windows logins as the owner of a job.
I think it has something to do with our domain controller being unavailable
sometimes. When error occurs I have changed the owner to a sql server login
and the problems goes away.
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Obaid" <anonymous@.discussions.microsoft.com> wrote in message
news:5fb401c42dff$58db8b70$a601280a@.phx.gbl...
> SQL Server 2000 sp3 on Windows 2003. I am getting the
> following error in the sql server agent log and I am not
> able to run any of my jobs. sql server lightweight pooling
> setting is set to 0.
> [298] SQLServer Error: 18452, Login failed for
> user '(null)'. Reason: Not associated with a trusted SQL
> Server connection. [SQLSTATE 28000]
> Thanks in Advance.|||If you server is in Mixed Mode set the owner of the job to be SA instead of
the creater. Otherwise set the owner to be the same Network ID that SQLSer
ver is running as.
Jeff Duncan
MCDBA, MCSE+I

Problem with Sql Server 2000 error

I am using VWD with Sql Server 2000. My application was running smoothly till I rebooted both my local box and the Machine where sql Server 2000 resides and now I am getting this error:

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. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

like I said before I am using Sql Server 2000 and not 2005. I don't really understand the problem. The application was running smoothly before rebooting it, so I know there is nothing wrong with the code. Maybe I need to start some service within IIS or something.

If anyone has any idea please let me know.

Thanks in advance for your help

Hi,

I do not have an idea why you catch this error while working with a SQL2K database.

But to enable remote connections, open the SQL Server Surface Area Configuration tool. Then drill down the Services and Connections, open the Database Engine. Then enable remote connections from this configuration tool.

eralper

http://www.kodyaz.com

|||

Could be a number of issues.

First, I rarely let SQL Server use named pipes. I hate them, I force SQL Server to TCP/IP always, unless it's a local connection then shared memory.

A firewall blocking the connection could do it.

Putting in the wrong server name could do it.

Configuring SQL Server to deny remote connections could do it (That is what the error message is saying).

There was a problem with SP2 and SQL Server 2000. Check the SP readme.txt to make sure you've configured it correctly for use with XP SP2.

Problem with SQL Server 2000 DTS Package:Column Delimiter not found

I am trying to import data from a text file to SQL database through a DTS package. i am always getting "Column Delmimeter not found" error at record number 8000. i copied the 8000th record into the beginning of the file to test if there is any problem with data but still i got the error at 8000 th record. i know it was a problem before and was fixed with sp1. i installed SP4 and still gettting the same error.

any help on this is appreciated.

Thanks
Venki

Found the actual problem. The error record number that DTS shows is not accurate. Acutal error was at 8790 th record but the DTS shows that the error is at 8000. The data has Quotes in it which was causing the problem.

Thanks
Venki|||

Hi

I'm having the exact same problem, with sp4 installed, and i can't find a solution

did u find a way to solve that problem?

Problem with SQL Server 2000 DTS Package:Column Delimiter not found

I am trying to import data from a text file to SQL database through a DTS package. i am always getting "Column Delmimeter not found" error at record number 8000. i copied the 8000th record into the beginning of the file to test if there is any problem with data but still i got the error at 8000 th record. i know it was a problem before and was fixed with sp1. i installed SP4 and still gettting the same error.

any help on this is appreciated.

Thanks
Venki

Found the actual problem. The error record number that DTS shows is not accurate. Acutal error was at 8790 th record but the DTS shows that the error is at 8000. The data has Quotes in it which was causing the problem.

Thanks
Venki|||

Hi

I'm having the exact same problem, with sp4 installed, and i can't find a solution

did u find a way to solve that problem?

Problem With SQL Server

Hello,
Do any body knows about following errors
2006-05-09 11:51:51.77 spid99 Error: 4014, Severity: 20, State: 2.
2006-05-09 11:51:51.77 spid99 A fatal error occurred while reading the
input stream from the network. The session will be terminated.
2006-05-09 11:51:52.44 Server Error: 4014, Severity: 20, State: 2.
2006-05-09 11:51:52.44 Server A fatal error occurred while reading the
input stream from the network. The session will be terminated.
I am getting this error frequently, especially under mediam load. Pls help"input stream from the network" suggests you have networking issue. start
with network monitor to see if there is any problem.
http://support.microsoft.com/kb/812953/
-oj
"kailux4" <kailux4@.discussions.microsoft.com> wrote in message
news:CFDE6666-841F-4FFE-AC07-E4D60AB6D464@.microsoft.com...
> Hello,
> Do any body knows about following errors
> 2006-05-09 11:51:51.77 spid99 Error: 4014, Severity: 20, State: 2.
> 2006-05-09 11:51:51.77 spid99 A fatal error occurred while reading
> the
> input stream from the network. The session will be terminated.
> 2006-05-09 11:51:52.44 Server Error: 4014, Severity: 20, State: 2.
> 2006-05-09 11:51:52.44 Server A fatal error occurred while reading
> the
> input stream from the network. The session will be terminated.
> I am getting this error frequently, especially under mediam load. Pls help
>

Problem With SQL Server

Hello,
Do any body knows about following errors
2006-05-09 11:51:51.77 spid99 Error: 4014, Severity: 20, State: 2.
2006-05-09 11:51:51.77 spid99 A fatal error occurred while reading the
input stream from the network. The session will be terminated.
2006-05-09 11:51:52.44 Server Error: 4014, Severity: 20, State: 2.
2006-05-09 11:51:52.44 Server A fatal error occurred while reading the
input stream from the network. The session will be terminated.
I am getting this error frequently, especially under mediam load. Pls help"input stream from the network" suggests you have networking issue. start
with network monitor to see if there is any problem.
http://support.microsoft.com/kb/812953/
-oj
"kailux4" <kailux4@.discussions.microsoft.com> wrote in message
news:CFDE6666-841F-4FFE-AC07-E4D60AB6D464@.microsoft.com...
> Hello,
> Do any body knows about following errors
> 2006-05-09 11:51:51.77 spid99 Error: 4014, Severity: 20, State: 2.
> 2006-05-09 11:51:51.77 spid99 A fatal error occurred while reading
> the
> input stream from the network. The session will be terminated.
> 2006-05-09 11:51:52.44 Server Error: 4014, Severity: 20, State: 2.
> 2006-05-09 11:51:52.44 Server A fatal error occurred while reading
> the
> input stream from the network. The session will be terminated.
> I am getting this error frequently, especially under mediam load. Pls help
>

Monday, March 26, 2012

Problem with SQL Notification - cannot find a non-existant user

I am having the following error trying to get a SQL Notification to work. I have followed the "Creating a Query for Notification" at http://msdn2.microsoft.com/en-us/library/ms181122.aspx, but so far without success in resolving this.

Source:
.Net SqlClient Data Provider
Data:
System.Collections.ListDictionaryInternal
Message:
Cannot find the user 'owner', because it does not exist or you do not have permission.
Cannot find the queue 'SqlQueryNotificationService--guid deleted--',
because it does not exist or you do not have permission.
Invalid object name 'SqlQueryNotificationService--guid deleted--'.
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at SqlDependencyProcessDispatcher.SqlConnectionContainer.CreateQueueAndService(Boolean restart)
at SqlDependencyProcessDispatcher.SqlConnectionContainer..ctor(SqlConnectionContainerHashHelper hashHelper, String appDomainKey, Boolean useDefaults)
at SqlDependencyProcessDispatcher.Start(String connectionString, String& server, DbConnectionPoolIdentity& identity, String& user, String& database, String& queueService, String appDomainKey, SqlDependencyPerAppDomainDispatcher dispatcher, Boolean& errorOccurred, Boolean& appDomainStart, Boolean useDefaults)By changing the service logon account from a local one to a domain account I have stopped the above error.

problem with SQL Agent

OK this is a new error on me.
I have a SQL server 2000 on Windows Server 2003.
I have setup a Maint plan that backs up the user and system databases
and the transaction Logs on my user databases.
Does optimises and integrity checks on those databases as well.
I am not attempting to repair any minor problems.
I am not performing integrity checks before backing up the database
and transaction logs.
All of the databases that I am doing a transaction log backup on have
recovery mode of full.
When the jobs run they fail instantly with error code 22029.
Sqlmaint.exe failed to run. This was working up until the end of the
day on the Thursday before Good Friday. (last week) The transaction
log backup ran fine at 4:00 PM the same job failed at 8:00 PM. No
changes were made to the server during that time.
Another issue that started at the same time. I have a web page used to
grab data from a text file export and pull it into an AS400. I use
this server to house the DTS packages and stored procedures that the
process needs. I suddenly quit working when the jobs quit running.
We are in a mixed enviroment with most clients on AD and this server
and most others still in a NT 4 domain. We have been like this for at
least 3 months and everything has worked fine. I setup the various
users and systems the way the need to be to work.
Originally the SQL Agent was running as a generic NT 4 Domain user with
local administrator rights to the local box and server role of system
administrator. The MSSQLSERVER and DTC services were running as the
built in system account.
Everything was happy then it broke.
When I reboot the server the jobs and the website work fine. Then
after a period of time that I have not figured out yet, but more than
15 minutes and less than 2 hours. Everything quits working.
I have changed all the services to run as a domain admin with SQL
system adminsitrator server role. Still same thing.
I have changed all the services to run as the built in system account.
Still same thing.
I run the sqlmaint from command line with the switches that I am using
in the maint jobs and it runs fine.
I have run dbcc checkdb on all the databases and they are fine.
The DTS packages and the stored procedures used by the website run fine
from with in Query analyzer.
Any help you can provide would be greatly appreciated.A guess: Try disabling the IPSec service. I've seen some similar behavior
when this service was misconfigured.
Also I would make sure the system is configure to log all security failures
and take a good look at the Security event log for any additional clues.|||Kevin,
Thanks for the reply. I already had the security set to log failure
and it is showing nothing but success audits.
I stopped the IPSec service and I still couldn't run the job. Do i
need to restart the server after making that change?
Kevin Joyner
Kevin English wrote:
> A guess: Try disabling the IPSec service. I've seen some similar behavio
r
> when this service was misconfigured.
> Also I would make sure the system is configure to log all security failure
s
> and take a good look at the Security event log for any additional clues.

problem with SQL Agent

OK this is a new error on me.
I have a SQL server 2000 on Windows Server 2003.
I have setup a Maint plan that backs up the user and system databases
and the transaction Logs on my user databases.
Does optimises and integrity checks on those databases as well.
I am not attempting to repair any minor problems.
I am not performing integrity checks before backing up the database
and transaction logs.
All of the databases that I am doing a transaction log backup on have
recovery mode of full.
When the jobs run they fail instantly with error code 22029.
Sqlmaint.exe failed to run. This was working up until the end of the
day on the Thursday before Good Friday. (last week) The transaction
log backup ran fine at 4:00 PM the same job failed at 8:00 PM. No
changes were made to the server during that time.
Another issue that started at the same time. I have a web page used to
grab data from a text file export and pull it into an AS400. I use
this server to house the DTS packages and stored procedures that the
process needs. I suddenly quit working when the jobs quit running.
We are in a mixed enviroment with most clients on AD and this server
and most others still in a NT 4 domain. We have been like this for at
least 3 months and everything has worked fine. I setup the various
users and systems the way the need to be to work.
Originally the SQL Agent was running as a generic NT 4 Domain user with
local administrator rights to the local box and server role of system
administrator. The MSSQLSERVER and DTC services were running as the
built in system account.
Everything was happy then it broke.
When I reboot the server the jobs and the website work fine. Then
after a period of time that I have not figured out yet, but more than
15 minutes and less than 2 hours. Everything quits working.
I have changed all the services to run as a domain admin with SQL
system adminsitrator server role. Still same thing.
I have changed all the services to run as the built in system account.
Still same thing.
I run the sqlmaint from command line with the switches that I am using
in the maint jobs and it runs fine.
I have run dbcc checkdb on all the databases and they are fine.
The DTS packages and the stored procedures used by the website run fine
from with in Query analyzer.
Any help you can provide would be greatly appreciated.A guess: Try disabling the IPSec service. I've seen some similar behavior
when this service was misconfigured.
Also I would make sure the system is configure to log all security failures
and take a good look at the Security event log for any additional clues.|||Kevin,
Thanks for the reply. I already had the security set to log failure
and it is showing nothing but success audits.
I stopped the IPSec service and I still couldn't run the job. Do i
need to restart the server after making that change?
Kevin Joyner
Kevin English wrote:
> A guess: Try disabling the IPSec service. I've seen some similar behavior
> when this service was misconfigured.
> Also I would make sure the system is configure to log all security failures
> and take a good look at the Security event log for any additional clues.

Friday, March 23, 2012

Problem with SP3

Hi,
Couple of users got this error after installing (MSDE) SP3.
Does anybody know what this means and what to do?
Invalid column name 'published_in_tran_pub'.
(Source: xxxxxxxxxxxxx (Data source); Error number: 207)
-----The
process could not deliver the snapshot to the Subscriber.
(Source: Merge Replication Provider (Agent); Error number: -2147201001)
-----
In use: Merge replication and static filtered publications.
-Katja
This column is related to a new merge agent parameter added with sp3. Can
you check that sp3 has been fully (successfully) installed on distributor,
publisher and subscriber.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Problem with sp_OACreate

The sp_OACreate fails at nights it works fine at daytime, I checked the
Event Log, and saw below error message for every databases I have.
18278 :
Database log truncated: Database: DBNAME.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:523AA016-9F7B-4CDA-A3DA-809E79084527@.microsoft.com...
> Hi
> You may want to try turning it off for a period and see if the problem
> persists. You need to asses the risk of doing this, such as
> http://support.microsoft.com/defaul...kb;en-us;309422
> John
> "Erdal Akbulut" wrote:
>
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_oa-oz_3enj.asp[/ur
l]
any
ActiveX
Windows
ActiveXHi
I don't think that has anything to do with the error! You may want to check
if there are any scheduled virus scans at the time your error occurs.
John
"Erdal Akbulut" wrote:

> The sp_OACreate fails at nights it works fine at daytime, I checked the
> Event Log, and saw below error message for every databases I have.
> 18278 :
> Database log truncated: Database: DBNAME.
>
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:523AA016-9F7B-4CDA-A3DA-809E79084527@.microsoft.com...
> http://msdn.microsoft.com/library/d...
a-oz_3enj.asp
> any
> ActiveX
> Windows
> ActiveX
>
>|||Hi,
We have a wly scheduled Virus Scan on that machine.sp_OACreate fails more
than once in a w
Thanks,
Erdal
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:24CDDF90-D6DF-4BA7-A02D-84B6F5A5308A@.microsoft.com...
> Hi
> I don't think that has anything to do with the error! You may want to
check
> if there are any scheduled virus scans at the time your error occurs.
> John
> "Erdal Akbulut" wrote:
>
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_oa-oz_3enj.asp[/ur
l]
there
using|||Hi
You may be better migrating to CDO.
John
"Erdal Akbulut" wrote:

> Hi,
> We have a wly scheduled Virus Scan on that machine.sp_OACreate fails mo
re
> than once in a w
> Thanks,
> Erdal
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:24CDDF90-D6DF-4BA7-A02D-84B6F5A5308A@.microsoft.com...
> check
> http://msdn.microsoft.com/library/d...
a-oz_3enj.asp
> there
> using
>
>|||John,
I am not sure if I can use CDOSYS.dll instead of CDONOTS.dll in my VB6
application. Actualy The Server is Win2003 and there was no CDONTS.dll I
copied and registered that dll.
Thanks.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:0FBF1B85-A949-45A5-B2FE-B9FB780A4C25@.microsoft.com...
> Hi
> You may be better migrating to CDO.
> John
> "Erdal Akbulut" wrote:
>
more
the
problem
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_oa-oz_3enj.asp[/ur
l]
VB
moved to
create|||Hi
I am still not sure why it runs during the day and not at night using the
same process, therefore to eliminate any incorrect configuration of
cdonts.dll it would be safer to use the native cdo. If that fails then the
issue is probably external to CDO.
John
"Erdal Akbulut" wrote:

> John,
> I am not sure if I can use CDOSYS.dll instead of CDONOTS.dll in my VB6
> application. Actualy The Server is Win2003 and there was no CDONTS.dll I
> copied and registered that dll.
> Thanks.
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:0FBF1B85-A949-45A5-B2FE-B9FB780A4C25@.microsoft.com...
> more
> the
> problem
> http://msdn.microsoft.com/library/d...
a-oz_3enj.asp
> VB
> moved to
> create
>
>

Problem with sp_grantdbaccess

When the I execute the following back to back in the SQL Query Analyzer,
I get an error:
Line 2: Incorrect syntax near 'sp_grantdbaccess'.
sp_revokedbaccess auser;
sp_grantdbaccess auser;
However, when I execute them individually, they work fine. Where's the
syntax error?
Or is there a better way remove a user as db_owner but still grant them
access to the database?The two commands need to be executed in separate batches. So the syntax
should be:
sp_revokedbaccess auser
go
sp_grantdbaccess auser
However, it appears that you just want to remove a user from the 'db_owner'
role. So following command should do your work:
EXEC sp_droprolemember 'db_owner', 'YourUserName'
"O.B." wrote:
> When the I execute the following back to back in the SQL Query Analyzer,
> I get an error:
> Line 2: Incorrect syntax near 'sp_grantdbaccess'.
> sp_revokedbaccess auser;
> sp_grantdbaccess auser;
> However, when I execute them individually, they work fine. Where's the
> syntax error?
> Or is there a better way remove a user as db_owner but still grant them
> access to the database?|||If a call to a stored procedure is not the first thing in a batch, you must
use the word EXECUTE (or EXEC).
So you can either separate the two calls into separate batches:
sp_revokedbaccess auser;
go
sp_grantdbaccess auser;
go
OR
you can use EXEC:
sp_revokedbaccess auser;
EXEC sp_grantdbaccess auser;
You might want to consider always using EXEC to call a procedure, then you
never need to worry about whether it's the first thing in the batch or not.
--
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"O.B." <funkjunk@.bellsouth.net> wrote in message
news:11om94vm6grltd3@.corp.supernews.com...
> When the I execute the following back to back in the SQL Query Analyzer, I
> get an error:
> Line 2: Incorrect syntax near 'sp_grantdbaccess'.
> sp_revokedbaccess auser;
> sp_grantdbaccess auser;
> However, when I execute them individually, they work fine. Where's the
> syntax error?
> Or is there a better way remove a user as db_owner but still grant them
> access to the database?
>

Problem with sp_attach_db

Hi!
We have a problem with a database asignation. When we try to make an attach
(sp_attach_db) the system display an error:
Server: Msg 3624, Level 20, State 1, Line 1
Location: recovery.c: 2657
Expression: seenCkptEnd
SPID: 10
Process ID: 560
Connection Broken
We work with SQL Server 7.0 SP2
What can we do?
Thank you in advance.Did you detach the database first? Does it come from the same SQL Server version?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Israel" <i.rodriguez@.promis.net> wrote in message news:OYJEL87rEHA.212@.TK2MSFTNGP10.phx.gbl...
> Hi!
> We have a problem with a database asignation. When we try to make an attach
> (sp_attach_db) the system display an error:
> Server: Msg 3624, Level 20, State 1, Line 1
> Location: recovery.c: 2657
> Expression: seenCkptEnd
> SPID: 10
> Process ID: 560
> Connection Broken
> We work with SQL Server 7.0 SP2
> What can we do?
> Thank you in advance.
>|||I do not think that at least half the groups you have included on your To:
line are relevant
It looks as though you may have a problem with the files which you are
trying to attach.
How did you shutdown the database for which these files originally were?
Was it cleanly?
What was your syntax?
The files were not in use by a database were they?
It may be that you need to contact the boys and girls in MS PSS and they may
be able to help you here.
--
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com
"Israel" <i.rodriguez@.promis.net> wrote in message
news:OYJEL87rEHA.212@.TK2MSFTNGP10.phx.gbl...
> Hi!
> We have a problem with a database asignation. When we try to make an
> attach
> (sp_attach_db) the system display an error:
> Server: Msg 3624, Level 20, State 1, Line 1
> Location: recovery.c: 2657
> Expression: seenCkptEnd
> SPID: 10
> Process ID: 560
> Connection Broken
> We work with SQL Server 7.0 SP2
> What can we do?
> Thank you in advance.
>sql

Wednesday, March 21, 2012

Problem with SP and uniqueidentifier

I am trying to use a stored procedure and it seems to be giving me a error - I think it doesn't like the uniqueidentifier. I have included the error, stored procedure, and code behind that calls the stored procedure.
Thanks for any help on this!
This is the error I get:
System.ArgumentException: No mapping exists from object type System.Web.UI.WebControls.TextBox to a known
managed provider native type. at System.Data.SqlClient.MetaType.GetMetaTypeFromValue(Type dataType, Object value,
Boolean inferLen) at System.Data.SqlClient.SqlParameter.GetMetaTypeOnly() at
System.Data.SqlClient.SqlParameter.Validate(Int32 index) at System.Data.SqlClient.SqlCommand.BuildParamList(TdsParser
parser, SqlParameterCollection parameters) at System.Data.SqlClient.SqlCommand.BuildExecuteSql(CommandBehavior
behavior, String commandText, SqlParameterCollection parameters, _SqlRPC& rpc) at
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior,
Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName,
Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at
view_WardSec_PatientLogDetail2.UpdateRecord_buttonClick(Object sender, EventArgs e) in C:\Documents and Settings\
KBuchanan.LMH\Desktop\WebSites\Newest_ER\Views\view_WardSec_PatientLogDetail.aspx.vb:line 358
Here is the stored procedure:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


ALTER PROCEDURE [dbo].[UpdateTblVisit_WardSecPatientLog]
(
@.VID decimal,
@.lbl_ChiefComplaint nvarchar(50),
@.TriageDtTmTextBox datetime,
@.PtInRmDtTmTextBox datetime,
@.RnInRmDtTmTextBox datetime,
@.PhyInRmDtTmTextBox datetime,
@.EDHoldDisposDtTmTextBox datetime,
@.DispDschDtTmTextBox datetime,
@.ddlTriageNurse uniqueidentifier,
@.ddlPriNurse uniqueidentifier,
@.ddlEDPhy uniqueidentifier,
@.ddlPriRefPhy decimal,
@.ddlSecRefPhy decimal,
@.ddlDschRN uniqueidentifier,
@.ddlDschPhy uniqueidentifier,
@.ddl_MnsArriv decimal,
@.lblDschDiag nvarchar(50),
@.chkbox_LogComplete bit
)
AS

SET NOCOUNT ON

Update
tblVisit
SET
vChiefComplaint = @.lbl_ChiefComplaint,
vTriageDtTm = @.TriageDtTmTextBox,
vPtInRmDtTm = @.PtInRmDtTmTextBox,
vRnInRmDtTm = @.RnInRmDtTmTextBox,
vPhyInRmDtTm = @.PhyInRmDtTmTextBox,
vEDHoldDisposDtTm = @.EDHoldDisposDtTmTextBox,
vDispDschDtTm = @.DispDschDtTmTextBox,
vTriageRnID = @.ddlTriageNurse,
vRnID = @.ddlPriNurse,
vEdPhyProvID = @.ddlEDPhy,
vPriRefPhyProvID = @.ddlPriRefPhy,
vSecRefPhyProvID = @.ddlSecRefPhy,
vDschRnID = @.ddlDschRN,
vDschPhyID = @.ddlDschPhy,
vMnsArrvID = @.ddl_MnsArriv,
vDschDiag = @.lblDschDiag,
vLogCompletedInd = @.chkbox_LogComplete,
vLogLastEdit = getDate()
WHERE
VID = @.VID

SET NOCOUNT OFF
RETURN

------------------------
Following is the codebehind for a button oncommand event. This code
should execute the stored procedure.
------------------------

Public Sub UpdateRecord_buttonClick(ByVal sender As Object, ByVal e As System.EventArgs)
'Use this to update the CareGiverID into the tbl_Visit table.
Dim sbSql As New System.Text.StringBuilder
sbSql.Append("EXEC UpdateTblVisit_WardSecPatientLog ")
sbSql.Append("@.VID, ")
sbSql.Append("@.lbl_ChiefComplaint, ")
sbSql.Append("@.TriageDtTmTextBox, ")
sbSql.Append("@.PtInRmDtTmTextBox, ")
sbSql.Append("@.RnInRmDtTmTextBox, ")
sbSql.Append("@.PhyInRmDtTmTextBox, ")
sbSql.Append("@.EDHoldDisposDtTmTextBox, ")
sbSql.Append("@.DispDschDtTmTextBox, ")
sbSql.Append("@.ddlTriageNurse, ")
sbSql.Append("@.ddlPriNurse, ")
sbSql.Append("@.ddlEDPhy, ")
sbSql.Append("@.ddlPriRefPhy, ")
sbSql.Append("@.ddlSecRefPhy, ")
sbSql.Append("@.ddlDschRN, ")
sbSql.Append("@.ddlDschPhy, ")
sbSql.Append("@.ddl_MnsArriv, ")
sbSql.Append("@.lblDschDiag, ")
sbSql.Append("@.chkbox_LogComplete, ")
sbSql.Append("@.UserID ")

'Response.Write(sbSql.ToString)
'Response.End()


'Create variables for each of the edited values
Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("ERTrekker_ProdConnectionString1").ConnectionString)
Dim cmd As New SqlCommand(sbSql.ToString(), con)

FindControls(DetailsView, "lbl_ChiefComplaint")
Dim ilbl_ChiefComplaint As TextBox = CType(MyControl, TextBox)
FindControls(DetailsView, "TriageDtTmTextBox")
Dim iTriageDtTmTextBox As TextBox = CType(MyControl, TextBox)
FindControls(DetailsView, "PtInRmDtTmTextBox")
Dim iPtInRmDtTmTextBox As TextBox = CType(MyControl, TextBox)
FindControls(DetailsView, "RnInRmDtTmTextBox")
Dim iRnInRmDtTmTextBox As TextBox = CType(MyControl, TextBox)
FindControls(DetailsView, "PhyInRmDtTmTextBox")
Dim iPhyInRmDtTmTextBox As TextBox = CType(MyControl, TextBox)
FindControls(DetailsView, "EDHoldDisposDtTmTextBox")
Dim iEDHoldDisposDtTmTextBox As TextBox = CType(MyControl, TextBox)
FindControls(DetailsView, "DispDschDtTmTextBox")
Dim iDispDschDtTmTextBox As TextBox = CType(MyControl, TextBox)
FindControls(DetailsView, "ddlTriageNurse")
Dim iddlTriageNurse As DropDownList = CType(MyControl, DropDownList)
FindControls(DetailsView, "ddlPriNurse")
Dim iddlPriNurse As DropDownList = CType(MyControl, DropDownList)
FindControls(DetailsView, "ddlEDPhy")
Dim iddlEDPhy As DropDownList = CType(MyControl, DropDownList)
FindControls(DetailsView, "ddlPriRefPhy")
Dim iddlPriRefPhy As DropDownList = CType(MyControl, DropDownList)
FindControls(DetailsView, "ddlDschRN")
Dim iddlDschRN As DropDownList = CType(MyControl, DropDownList)
FindControls(DetailsView, "ddlDschPhy")
Dim iddlDschPhy As DropDownList = CType(MyControl, DropDownList)
FindControls(DetailsView, "ddl_MnsArriv")
Dim iddl_MnsArriv As DropDownList = CType(MyControl, DropDownList)
FindControls(DetailsView, "lblDschDiag")
Dim ilblDschDiag As TextBox = CType(MyControl, TextBox)
FindControls(DetailsView, "chkbox_LogComplete")
Dim ichkbox_LogComplete As CheckBox = CType(MyControl, CheckBox)


'Add all of the parameters to the command
With cmd.Parameters
.AddWithValue("@.VID", Request("vID"))
.AddWithValue("@.lbl_ChiefComplaint", ilbl_ChiefComplaint.Text.ToString)
.AddWithValue("@.TriageDtTmTextBox", iTriageDtTmTextBox.Text.ToString)
.AddWithValue("@.PtInRmDtTmTextBox", iPtInRmDtTmTextBox)
.AddWithValue("@.RnInRmDtTmTextBox", iRnInRmDtTmTextBox.Text.ToString)
.AddWithValue("@.PhyInRmDtTmTextBox", iPhyInRmDtTmTextBox.Text.ToString)
.AddWithValue("@.EDHoldDisposDtTmTextBox", iEDHoldDisposDtTmTextBox.Text.ToString)
.AddWithValue("@.DispDschDtTmTextBox", iDispDschDtTmTextBox.Text.ToString)
.AddWithValue("@.ddlTriageNurse", iddlTriageNurse.SelectedValue.ToString)
.AddWithValue("@.ddlPriNurse", iddlPriNurse.SelectedValue.ToString)
.AddWithValue("@.ddlEDPhy", iddlEDPhy.SelectedValue.ToString)
.AddWithValue("@.ddlPriRefPhy", iddlPriRefPhy.SelectedValue.ToString)
.AddWithValue("@.ddlDschRN", iddlDschRN.SelectedValue.ToString)
.AddWithValue("@.ddlDschPhy", iddlDschPhy.SelectedValue.ToString)
.AddWithValue("@.ddl_MnsArriv", iddl_MnsArriv.SelectedValue.ToString)
.AddWithValue("@.lblDschDiag", ilblDschDiag.Text.ToString)
.AddWithValue("@.chkbox_LogComplete", ichkbox_LogComplete.Checked.ToString)
.AddWithValue("@.UserID", System.Web.HttpContext.Current.Session("UserID"))

End With

' Open the connection and execute the command
Try
con.Open()
If cmd.ExecuteNonQuery() < 1 Then
Throw New System.Exception("The record was not updated")
End If
Catch ex As Exception
System.Web.HttpContext.Current.Response.Write(ex.ToString())
Finally
If Not con Is Nothing AndAlso con.State = System.Data.ConnectionState.Open Then
con.Close()
End If
End Try
End Sub

(1) You have an additional parameter @.userID that you are trying to force into the stored proc which was not defined.
(2) Your @.VID is a decimal? Doesnt seem like a good idea to put in a where condition. Sometimes 10 may not be equal to 10.0. So make sure you include the precision too in the parameter.
ALTER PROCEDURE [dbo].[UpdateTblVisit_WardSecPatientLog]
(
@.VID decimal(8,2),
also make sure about similar change in the vb code.