I'm using this query to find some queries that have been running for a long time:
SELECT sqltext.TEXT,
req.session_id,
req.status,
req.command,
req.cpu_time,
req.total_elapsed_time
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext
order by req.total_elapsed_time des
Currently, we have some xp_cmdsh...
Hi all,
Below is my query which is in Storedprocedure(SQL Server 2008) will return list of items from a table.
Query:
SELECT
( COALESCE(ReviewDescription,'')+ REPLICATE (' ', 20 - LEN(ReviewDescription))
+ '|' +
( CONVERT(VARCHAR(100),ReviewCharge))) AS ReviewTypes
FROM ReviewType
query result(copied to text pad then its looking l...
I've been using SQL Server 2008 R2 for my development. I noticed that service pack 2 for SQL Server 2008 just came out. However, I checked here and Microsoft does not provide a link to any of the service packs for SQL Server 2008 R2. So it is not clear to me whether or not I should apply their service pack to my instance of SQL Server 20...
Hi,
What is the best way to loop over a database table's rows in SQL Server 2008 R2?
I am looking for something which is fairly similar to writing foreach ( ) and quite performant.
Thanks
...
I'm working on a project where we will be interacting with the ReportService2010 reporting web service under SQL Server 2008 R2. In the past, I've worked with the ReportService2005.asmx, and my problem here is, I can't find any reasonable examples on how to render a report with this new (2010) reporting web service.
When using the 2005...
We recently had some trouble with our production SQL 2008 R2 databases and had to failover to log-shipped warm spares for most of our databases. This morning I found some very odd GUID values scattered throughout our set of databases. For background, we have a main clients database, that holds various information about installed clients,...
I'm attempting to populate a DB on my local SQL2008 Server using a Data Generation Plan. However, when I run it I get:
Data generation failed because of the following exception: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.. occurred 1 time(s).
I've tried setting...
I need to add a auto-inc surrogate key to three tables in my data warehouse:
Note: These are not the real table names
JakMaster (JakMasterId, Date) (PK) Note: JakMasterId is varchar(60)
JakToRoad (JakMasterId, Date) (FK)
JakToBig (JakMasterId, Date) (FK)
What steps should I take to add a surrogate key to these three tab...
I am using SQL Server 2008 R2.
I have a table which has several fields including a nvarchar(max) field.
When I try and add a new field of type varbinary(max) I get an error message: "Saving changes is not permitted. The change that you have made requires the following tables to be droped and recreated".
Is it possible to have a nvarch...
Hello all,
I have a backup database file (i.e. test.mdf), however, I don't have the LDF file. I was told that SQL Server 2008 R2 can load MDF without LDF.
Is that true?
Thank you
...
SQL Server 2008, Visual Studio 08 and C#
The task is to create the same database on multiple servers. If it were only two or three tables I would have done it manually but there are more than 50 tables in the database..
So I thought why not create a backup and restore the backup file wherever needed
error
the file is in use! ( altho...
Hi, i have a table with two column {FlatContent, HashedContent}. Now i want to automatically compute hash value of FlatContent when new row was inserted or an existing row was updated. To date, i'm never used from trigger, so i can't do this by trigger or another approach which is exist to solve this issue.
Thanks if anybody can help me...
After upgrading our report server from SQL2008 to SQL2008 R2, one of our complex production reports will no longer work properly. This report has several parameters such as selecting all data or a specific group of data, and selecting summary data only or detail along with the summary. Since going to R2, if we select a small group detail...
Dear all,
I am currently upgrading a database server from SQL Server 2000 to SQL Server 2008 R2. One of my queries used to take under a second to run and now takes in excess of 3 minutes (running on faster a faster machine).
I think I have located where it is going wrong but not why it is going wrong. Could somebody explain what the ...
I want to prevent a specific record from being deleted. This trigger works fine for that specific record. However, other records still remain when they're being deleted. Why?
ALTER TRIGGER [Globalization].[CountriesTracker]
ON [Globalization].[Countries]
INSTEAD OF DELETE
AS
BEGIN
SET NOCOUNT ON;
IF ((Select COUNT(*) from [Delet...
I want to insert/update record with a specific stored-procedure which performs some business-logic on new record values. I can do this by trigger to ignore new record from directly to be inserted and pass new record values to my stored-procedure to perform appropriate action for passed values?
...
I have a WPF Linq-to-SQL project which I have been developing using MS Visual Studio 2008. I was running SQL Server 2008, and recently upgraded it to version R2. Now, whenever I build my SETUP project (not the app itself), the build process causes a window to launch:
SQL Server 2008 R2 Management Studio
Please wait while Windows configu...
I would like to know what's the optimal approach to make a batch insert/update from CLR to SQL Server 2008 R2 database?
Optimal in terms of:
code complexity - I don't want to over complicate my TSQL or CLR code to prove it can be done
implementation simplicity
speed - it should perform better than doing one-by-one processing
We usua...
I want to populate a combo box with a list of dates from a DB. Then based on user input I want to be change the Tablix to filter on only dates later than the selected date.
How can I do so?
Detailed steps will be useful.
...