Friday, March 9, 2012
negative spid number
Am I hallucinating or has anyone seen that before ?
I have seen processes being blocked by a negative spid. Its usually a
sign of an orphaned DTC transaction.
|||That's right. See KILL in the SQL 2000 Books online.
Hope this helps.
Dan Guzman
SQL Server MVP
<bkrish1@.gmail.com> wrote in message
news:1139376225.767527.251290@.o13g2000cwo.googlegr oups.com...
>I have seen processes being blocked by a negative spid. Its usually a
> sign of an orphaned DTC transaction.
>
negative spid number
Am I hallucinating or has anyone seen that before ?I have seen processes being blocked by a negative spid. Its usually a
sign of an orphaned DTC transaction.|||That's right. See KILL in the SQL 2000 Books online.
Hope this helps.
Dan Guzman
SQL Server MVP
<bkrish1@.gmail.com> wrote in message
news:1139376225.767527.251290@.o13g2000cwo.googlegroups.com...
>I have seen processes being blocked by a negative spid. Its usually a
> sign of an orphaned DTC transaction.
>
negative spid number
Am I hallucinating or has anyone seen that before ?I have seen processes being blocked by a negative spid. Its usually a
sign of an orphaned DTC transaction.|||That's right. See KILL in the SQL 2000 Books online.
--
Hope this helps.
Dan Guzman
SQL Server MVP
<bkrish1@.gmail.com> wrote in message
news:1139376225.767527.251290@.o13g2000cwo.googlegroups.com...
>I have seen processes being blocked by a negative spid. Its usually a
> sign of an orphaned DTC transaction.
>
Negative Numbers from Calculation
I am trying to get this calculation to work, but it keeps coming back with a negative number.
I think its something to do with making the
Column 1 & 2 are numeric figures then i calcating the datediff with another numeric figure. but i keep getting a negative answer? Any ideas?
Sum((isnull([Column1],0)) * ((isnull([Column2],0)) - cast(DATEDIFF(d,(isnull([date1],0)),(isnull([date2],0)))as float)/365.00)) as New Column
Here You can try this ...
Isnull(Sum([Column1]),0) * isnull([Column2],0)
- Isnull(ABS(DATEDIFF(d,[Date1],[Date2])),0)/365.00)) as New Column
You need not to apply Isnull inside the SUM function, by default the null values will be eliminated on aggergation.. But you can apply the ISNULL on the result of the SUM function..
Try to execute the following statement to get the 3 part of your expression which may help you where you missed your expression..
select
A = Isnull(Sum([Column1]),0) ,
B = isnull([Column2],0)),
C= Isnull(ABS(DATEDIFF(d,[Date1],[Date2])),0)/365.00))
as per your earlier expression the result = A * B - C => (A*B) - C is it correct?
or you want to achive A * (B-C) ... not clear buddy... try to find the result of the 3 expression and debug it..
|||Can't seem to get this to work. Keep getting syntax error. Incorrect syntax near ')'.
|||
Try the following expressions...
Sum(isnull([Column1],0) * (isnull([Column2],0)
- Isnull(DATEDIFF(d,date1,date2),0)/365.00))
A= isnull([Column1],0) ,
B=isnull([Column2],0),
C=Isnull(DATEDIFF(d,date1,date2),0)/365.00
A= isnull([Column1],0) ,
isnull([Column2],0) - Isnull(DATEDIFF(d,date1,date2),0)/365.00
Wednesday, March 7, 2012
Needed: User, Login, Connection advice.
I'm still on the steep side of the learning curve with ASP.NET. I've looked through a number of threads on this forum, and have gotten pieces of the answer, but need help getting past a roadblock.
I haven't been able to get a simple test application to connect to the Pubs database loaded on my system running MSDE. The only control in the application is a WebDataForm created by the Wizard. Everything works well (even the Preview Data form the Data menu loads and displays the correct data), except when the form is viewed in a browser. Click the load button and an error:Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Similar stories are common on this forum, and I tried to address the problem. I'm quite sure it's a autherization or authentication problem. I have Windows Server 2003 (with IIS 6.0), VS.NET 03 and MSDE as the SQL server on the same box. The MSDE server is using Windows Security mode. I Created a new user called ASPNET on the Windows Server. I added a login to the SQL Server 'WinServerName\ASPNET' using windows auth. Still get the same login failed message.
Is there something I'm missing? Do I have to add a new user to IIS?
For the record, what users/settings do I need to have in Windows, SQL-Server and IIS, get past this login problem.
Thanks for answering this basic question - one more time.Hi,
An Addendum to my message:
I found out that WINDOWS SERVER 2003 in native mode (default), running IIS 6.0 Uses "NETWORK SERVICE" rather than "ASPNET" as the default login user name for ASP.NET applications. I had not seen this in the messages I looked through in this forum.
When I, after a number of dead ends, created a new Login for my SQL Server - (as I'm using MSDE, I used The Web Data Administrator rather than Enterprise Manager or OSQL to create the new login) - with the name 'NT AUTHORITY\NETWORK SERVICE', the application was able to access the database through the VS and IE browswers.
As this test application is only used locally, I'm not concerned with the security ramifications of this method of access. However, I can see that it will be a big concern, and a lot of work to establish the appropriate methods when I have a production application to deploy.
I still would welcome advice on what strategies you have used to provide appropriate access privilages to ASP.NET applications and users that will need to access data from SQL Server databases in production environments.
I know that this is asking a lot - as there are so many permutations to consider. What I would hope you could provide, is a base line of "must" and "must never" stepsfor establishing data connections to data sources using ASP.NET.
If this is too open ended a question - let me know your thoughts on that as well. In looking through the messages of the past 3 months on this forum, I know that many have been frustrated by the complxity of getting a database connection established. Yes, the information to get it done is out there, but the sheer volume can be daunting.
Thanks for all you help with my questions.