|
You could check that it's not a locking issue using sp_lock or sp_lock2
|
|
|
|
|
Good Morining All
I have Cleints that uses my Application. My Application is Built in Tiers and i dont do database work in my pages, i just call fuctions of my DAL. now when Deploying my Database or Fixing bugs, i end up adding more Stored procedure. To some client i just give them the SP to create or Alter some i do it myself. Now i ask your advice. if is there a way to create a Script that will recreate my SP's on the destination Databases when i deploy my application or when a Client deploys the Application.
Thank you ,
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
|
sp_lock2 is a good tool for resolving lock blocks. If you find a locking issue, you can use KILL statement to kill the session
|
|
|
|
|
if yes then tell me the procedure to change it??
Thanks in advance.
|
|
|
|
|
First collect the current SQL Server instance name
select @@servername
Execute the below queries to change the SQL Server instance name
sp_dropserver ‘old_name’
go
sp_addserver ‘new_name’,‘local’
go
Restart the SQL Server service, to run the below commands:
net stop mssqlserver
net start mssqlserver
|
|
|
|
|
i want retrive value in featch three textboxs use stored procedur with asp.net code what fire Query
modified on Friday, February 13, 2009 1:09 AM
|
|
|
|
|
If I understand your question correctly, what you need to look at is ado.net - this is what is used to connect to a database and execute queries, stored procs etc. Just searchfor ado.net, there are loads of examples here at CP and even more on google.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Yeah - me too.
You would think that someone with 1/2 a brain would realise after several stupid posts like yours that you aren't going to get help unless you put some effort into it yourself.
Granted that English is not your first language (I hope!) s it may be hard for you to explain exactly what you are after - but the site really expects you to do something for yourself.
What have you tried? Is there some specific thin you can't get to work? Have you managed to call a SP from your application? Are you having trouble with the SQL, calling a SP, getting the value out of the text boxes?
Put in some effort, and you may find the posters here extremely helpful. Fail to do so and you will find them scathingly sarcastic, at best.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Hi,
Quick question, I run an update statement to update a huge table then I click the Stop/Cancel button.
What happens? Does it roll back all previous transactions or does it leave the updated rows as is?
Thanks.
Rafferty
|
|
|
|
|
Its leave the updated rows. If you want to rollback all previous transactions, use the following before query:
Begin Tran
|
|
|
|
|
First, I would say that it should be easy for you to test that yourself.
Second, I just performed that test, and if the update is done by a single statement and that statement is canceled, it appears to be rolled back.
Scott
|
|
|
|
|
Hi Scott,
I did test it, and like you said it appears to be rolled back. Part of me just couldn't believe it so I asked here for more "documentation"-like answers
But it does appear that if it's a single statement, the query analyzer will treat all the changes as part of one transaction.
Thanks.
Rafferty
|
|
|
|
|
Sorry, I didn't realize you had already tested it. At least our test results seem consistent.
I did finally find this in the Books Online:
Errors During Transaction Processing
If a severe error prevents the successful completion of a transaction, SQL Server automatically rolls back the transaction and frees all resources held by the transaction. If the client's network connection to SQL Server is broken, any outstanding transactions for the connection are rolled back when the network notifies SQL Server of the break. If the client application fails or if the client computer goes down or is restarted, this also breaks the connection, and SQL Server rolls back any outstanding connections when the network notifies it of the break. If the client logs off the application, any outstanding transactions are rolled back.
Scott
|
|
|
|
|
Wow, there's the answer I'm looking for! Thanks Scott!
Rafferty
|
|
|
|
|
Kindly let me know how to make updateble views on a table and how to apply Indexes on them??? i will be very thankful if anyone can give me the exact syntax for whole..
Thanks in Advance..
|
|
|
|
|
Creating an index on a view uses the normal CREATE INDEX syntax. For considerations, you should look at: Creating an Indexed View[^]
Also note that this feature is in Enterprise Edition only.
|
|
|
|
|
advantage and disadvantage of it??
thanks in advance.
|
|
|
|
|
In short, worker thread is the actual thread serving a call to the database.
Aman786Singh wrote: advantage and disadvantage of it
There's no choice in this. This is how SQL Server works.
|
|
|
|
|
How to get which process is deadlocking the system??
how to know current connections establish??
Thanks in Advance.
|
|
|
|
|
What is it and benefits of it???
Thanks in Advance.
|
|
|
|
|
It's designed to decrease context switches in multi CPU environment, thus giving a little bit better performance in certain, very specific situations. Normally there's no need to use it (or at least lots of optimizations should be done before this is considered).
For more info: The Perils of Fiber Mode[^]
|
|
|
|
|
Goodness, am I just thick or why can't I seem to get my head around GROUP BY!?
Let's use the Northwind DB as an example and let's say I want to join the Orders and Customers tables and return the first row for each customer. In other words, what I want is the first order that every customer placed, but inner joined to the customer table so that the customer's details is also returned.
This sounds simple enough but I just can't seem to make it work. The fact that I want the first order for each customer suggested to me that I should use something like SELECT TOP 1 * and have the GROUP BY CustomerID clause in there somewhere but then the result set would be rife with columns that are not contained in aggregate functions or the GROUP BY clause.
Would anyone care to offer advice here? I'm just using the Northwind DB as an example because I'm hoping that most people would be familiar with it but what I'm actually trying to achieve is to extract the first observation plus some details about the bird from a birdwatching database in which, roughly speaking, the Observations table would be equivalent to the Orders table and BirdList table would be equivalent to the Customers table.
|
|
|
|
|
GROUP BY isn't necessarily the easiest way to do this (although it's possible). Since you want to join two tables and when joining retrieve only the first row from the other table, I would use something else than GROUP BY (basically because I'm not calclulating anything, sums , averages, counts etc, but just restricting rows)
First version could be something like:
SELECT ...
FROM BirdList bl,
INNER JOIN
Observations o
ON bl.BirdId = o.BirdId
WHERE NOT EXISTS (SELECT 1
FROM Observations o2
WHERE o2.ObservationDate < o.ObservationDate
AND 02.BirdId = o.BirdId)
So fetch rows using normal join but then use correlated subquery test to check that there are no earlier records.
Didn't know the actual names of your columns so they are propably nonsense.
|
|
|
|
|
Excellent suggestions, thanks! I really should have thought of this before I even started to think along the lines of GROUP BY.
|
|
|
|