sql-server-2008

Can someone please help me to correct this SQL 08 query?

When I run the below SQL 08 query I get an error that tbrm_Article.ArticleID is invalid because it is not contained in an aggregate function or GROUP BY clause. I know the problem is related to the: AVG(tbrm_Votes.True) AS Truth, AVG(tbrm_Votes.False) AS False, and the subsequent join to the tbrm_Votes table. the tbrm_votes ta...

Can this be done in SQL 2008?

Given this data set: SummaryID Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 25 1 2 3 4 5 6 7 6 5 4 3 2 1 2 3 25 1 2 3 4 5 6 7 6 5 4 3 2 1 2 3 25 ...

Where to see SQL Server start/stop logs?

Hello everyone, I want to know where to see SQL Server start/stop logs for each instances and SQL Server agent/job start/stop logs? I am developing some tools to monitor SQL Server status. I am using SQL Server 2008 Enterprise. thanks in advance, George ...

SQL server database start/stop issue

Hello everyone, I am using SQL Server 2008 Enterprise for development. I find from SQL Server logs, there are items like, 2009-09-20 19:54:33.55 spid53 Starting up database 'DummyOrderDB'. My confusion is, I think we could only start/stop database server instance (the contained database will be started/stopped when the containin...

SQL Server 2008 - Restore Database With RESTART

I am trying to restore a database from a backup file on a SQL Server 2008 instance using the following SQL command: BEGIN RESTORE DATABASE [MyDataBase] FROM DISK=@db_location WITH STATS=5, FILE=1, MOVE @db_OldName TO @db_NewFile, MOVE @db_OldLogName TO @db_NewLogFile, NOREWIND, NOUNLOAD, RESTART, RECOV...

NHibernate mapping for SQL Server 2008 Hierarchy Data Type

Hi, Just wondering what the best mapping pattern is for NHibernate (latest release) with SQL Server 2008 and the hierarchy data type. Thanks ...

Selling Sql Server 2008 to upper management? How?

I know the advantages of upgrading from sql server 2005 to sql server 2008, but upper management could care less about t-sql debugging, intellisense, the merge statment, etc..., so what are some features in sql server 2008 that upper management might actually find worth while. ...

SQL CASE Statement Not Working Correctly

I have a view in SQL Server 2008 with several columns that are expressions of one column divided by another. I have to account for the divisor being 0, so I use a CASE statement. Here is an example of one: CASE SUM(dbo.GameStats.BringBacksAttempted) WHEN 0 THEN 0 ELSE SUM(dbo.GameStats.BringBacks) / SUM(dbo.GameStats.B...

ASP.NET cannot connect to 64-bit Sql Server 2008

We have an ASP.NET application written in Visual Studio 2003 (c#) using SQL Server 2000 as database. It’s an old web application that our clients have been using for 4+ years. Now, we needed to upgrade the application to work on Windows Server 2008 using SQL Server 2008, both 64bit, both on the same machine. So we ported the application...

How can I increment an identity column without inserting a value ?

First, I'm aware of this question which didn't get answered because what the OP was really trying to do was'nt incrementing an identity column I've got an identity column with a current seed value of x, and I would like to reseed it to x+1 (ie I want my identity column to jump directly from x to x+2. I know I can do that using the fo...

PHP - SQL Server 2005 express to 2008 standard problem

I have a PHP app running happily on the following system: web app: PHP version 5.2.3 OS: Windows Server 2003 Standard 32 bit database: SQL Server 2005 (express) web server: IIS 6 I'm trying to get the same thing running on the following: web app: PHP version 5.2.11 OS: Windows Server 2008 Standard 64 bit database: SQL Server 2008...

sql server express - date format

Hi, In a sql server 2005 table I have a date column in dd/mm/yyyy format. But everything on sql server 2008 is yyyy-mm-dd. Where abouts can I change the format the dates that are being stored in 2008 to that of 2005? Thanks, ...

Copying Data from SQL Server 2008 to SQL Express

I would like to copy a database (tables, it’s data, stored procs & views) from SQL Server 2008 database to SQL Server Express. Is it possible? If so, would you please let me know how to do it? When I tried, it is giving some error. Please note that I have only few records in SQL Server 2008 database tables. Thanks and Regards.. Shruth...

Best Practices for storing large amounts of XML type data in SQL Server

Does anyone have any best practices they can share with regards to storing XML field type data in SQL Server 2008? We have lots of small XML structures, yet some larger (>50MB). We're finding that things get a little slow on DELETE. Any advice/war stories would be appreciated. ...

how to configure SQL Server max memory usage

Hello everyone, I am using SQL Server 2008 Enterprise. SQL Server 2008 always tries to eat as much as memory as it could. Any ways to configure per database or per instance or per server level max memory usage of SQL Server 2008? thanks in advance, George ...

My simple sql update query is not working right :(

Hi folks, I've got a simple sql query that is trying to update a single row. The code came from some Linq-to-sql code (i used Profiler to grab it), but please don't worry about the source (L2S) ... that's irrelivant to the question. Now, when i try and do an update with the where clause, I get 0 rows updated. I then try and do a selec...

Analytical approach to optimizing spatial indices in MsSql2008

What would be the best approach to optimizing spatial index on geometry data? Specifically: How to choose values for grid hierarchy? How to choose value for Max cells per object rule? These are very much data related so I'm looking for a sensible approach to analyzing the data and then testing out the values. ...

control SQL Server database stop/start

Hello everyone, I am using SQL Server 2008 Enterprise. I want to know how many different ways or different reasons why database (not instance, not server, but database) is stopped/started. I am analyzing SQL Server logs. Currently as far as I know, two possible ways/reasons are -- taking database offline/online and stop/start instance/...

Conversion failed when converting from a character string to uniqueidentifier.

Created a stored procedure in SQL 9 (2005) and have since upgraded to SQL 10 (2008). Since then, the following stored procedure has stopped working and thrown up the above error: ALTER PROCEDURE [dbo].[GetModifiedPages] @vPortalUID nvarchar(32) = '' AS BEGIN -- Convert GUID to UI DECLARE @nPortalUID AS uniqueidentifier ...

Exception when calling a stored procedure

Hi folks, I have a SQL Server 2008 database and want to access a table from a C#-WCF via a stored procedure. The proc is a simple SELECT query that gets the row of a given id and fills the result into some outputparameters: PROCEDURE [dbo].[get_stammInfo] -- Add the parameters for the stored procedure here @id int, @strassenSc...