sql-server-2005

Local ASP.NET MVC Suddenly Very Slow; Load times > 1 minute

Over the last few weeks I've been subject to a sudden and significant performance deterioration when browsing locally hosted ASP.NET 3.5 MVC web applications (C#). Load times for a given page are on average 20 seconds (regardless of content); start up is usually over a minute. These applications run fast on production and even test sys...

Export SQL Server 2005 query result to SQL INSERT statement?

Is there an easy way in SQL Server 2005 to export query results to a SQL INSERT statement? I'm thinking something along the lines of how you can use Database Explorer to script an existing stored procedure to a new query window. We're looking to move some data from a dev DB to a production one; I know about linked servers but there's no...

How do/can I run a select SQL statement inside an if?

I'm having trouble finding the syntax for a statement (or whether or not it's even possible). We're running SQL Server 2005, and I'd like to do something like: IF ((SELECT count(*) FROM mytable WHERE userid = 'myid' AND value = 3) < 1) then INSERT INTO mytable VALUES ('myid', 3) Any suggestions? Thanks ...

sql server drop default syntax error

Hi, I am trying to drop the default value on a bit column, I have set it wrong and I want to do it again correctly. However, when I write: ALTER TABLE Person ALTER COLUMN tsHomePref DROP DEFAULT; I get a 'incorrect syntax near keyword default error' and I don't know why I want to drop the column and then build it again ALTER TABLE...

Mirroring , Log shipping SQL Server 2005

Hello, I am tasked with setting up a disaster recovery for one of our system. The primary server is in FL and the secondary is in Germany. The application is a global application within my company. I am not sure if I should use Log shipping or Mirroring. What I have read is that mirroring will have an adverse effect on the performance ...

Using SQL Server Management Studio Express to Backup DB

Hi, I am wanting to backup a SQl Server 2005 db at a remote site (ie. to ultimately have a backup file of the db here locally on my machine). Can this be done using SQL Server Management Studio Express ? I have this installed and running.. but cannot seem to find a way of backing up using it. If this isn't possible, how do I create a ...

SQL Server Login

What is the SQL query to check whether particular SQL Login is Enable or Disable? ...

Guest User in SQL Server

When i Execute the Below Query it doesn't show me whether the guest account is enabled or disabled. SELECT name, type_desc, is_disabled FROM sys.server_principals ...

Transacation Log Backup

Dear Friend How can i check with SQL query whether transction log backup every 15 minutes JOB is created or not ? Thanx in advance. ...

How to sum between dates using SQL?

Look at the following UPDATED scenario (sorry that I fooled you with the un updated version - hope it will be clearer now) - it may seem simple to some people, and hopefully it is! Explanation: Every row is a Request. Allocated is the number of people requested to an activity, total is the total amount of people for this country availab...

Can't disable Vardecimal Storage Format

I recently moved a database from a 'SQL Server 2005 SP1' instance to 'SQL Server 2008 SP1' (using detach - attach). I now need to move it back but it fails with the error: The database 'MyDB' cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported. After a bit of resea...

the setup failed to read IIsMimeMap table. The error code is -2147023550

I'm trying to uninstall SQL Server from my machine so that I can install SQL Server 2005 Developer Edition. I'm getting the following error message. the setup failed to read IIsMimeMap table. The error code is -2147023550 Thank in advance. ...

Log file size is huge

Hi, We have one database and we do lot many transactios per day, so the log file size growing too much, and i have tried shrinking it but its not reducing.. What shall i do to reduce the log file size. (We do too many inserts) Thanks Srinivas ...

Writing a simple SQL Server 2005 dynamic sql

I am writing a fairly simple SQL query in SQL 2005, but am running into an issue and can't figure out what is wrong. For documentation purposes, the query has to be a dynamic sql A snippet of my query is: @RecCreatorID int .... .... IF (@RRecCreatorID IS NOT NULL) Begin Set @strSQL = @strSQL + ' AND RecCreatorID = @RecCrea...

How to output only one max value from this query in SQL?

Yesterday Thomas helped me a lot by providing exactly the query I wanted. And now I need a variant of it, and hopes someone can help me out. I want it to output only one row, namely a max value - but it has to build on the algorithm in the following query: WITH Calendar AS (SELECT CAST(@StartDate AS datetime) AS Date ...

Limiting Number of Rows Inserted into a SQL Server Database

I have a program in c# in VS that runs a mainform. That mainform exports data to an SQL Database with stored procedures into tables. The data exported is a lot of data (600,000 + rows). I have a problem tho. On my mainform I need to have a "database write out interval". This is a number of how many "rows" will be imported into the da...

Any hidden pitfalls changing a column from varchar(8000) to varchar(max)?

I have a lot (over a thousand places) of legacy t-sql code that only makes INSERTs into a varchar(8000) column in a utility table. Our needs have changed and now that column needs to be able to handle larger values. As a result I need to make that column varchar(max). This is just a plain data column where there are no searches prefor...

Writing a dreaded SQL search query.

I am working on a search query that does not seem to work. The complete query is: set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go ALTER PROCEDURE [dbo].[usp_Item_Search] @Item_Num varchar(30) = NULL ,@Search_Type int = NULL ,@Vendor_Num varchar(10) = NULL ,@Search_User_ID int = NULL ,@StartDate smalldatetime = NULL ...

SQL ERROR: Verify that the instance name is correct and that SQL Server is configured to allow remote connections?

I am getting following error while connecting to my local Sql Express: An error has occurred. Details of the exception: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is ...

Configuring SQL profiler

Is there a quickstart guide on how to configure SQL profiler for SQL 2005? I am using a shared database, so I want to only view queries that are executed by my application. ...