sql-server-2005

SQL Server - SELECT FROM stored procedure

Say I have a stored procedure that returns rows: CREATE PROCEDURE MyProc AS BEGIN SELECT * FROM MyTable END Of course my actual procedure is a little more complicated, being why a sproc is necessary. Is it possible to select the output from calling this procedure? Something like: SELECT * FROM (EXEC MyProc) AS TEMP The reason...

Is SQL Server 2008 compatible with 2005?

I have a problem with my website. When I publish my site on server, I got an error message: The database '----------------------------.MDF' cannot be opened because it is version 655. This server supports version 611 and earlier. A downgrade path is not supported. What can I do about this? ...

Interactive Sorting on Top Group's aggregate data in SQL Reporting 2005

I have a report that has a group row that shows a group name and sum details in certain columns. Then a details row within the group. I show the detail rows hidden to begin with and an expansion button. That part works. I also want to be able to sort on the group's aggregate data, not detail data. So when the detail rows are hidden, some...

How to find out size of the individual databases in the sql server 2005?

Please tell the query to find out size of the individual databases in the sql server 2005? ...

how to find out log size of each of the database in sql server 2005?

Duplicate of: http://stackoverflow.com/questions/1496136/how-to-find-out-size-of-the-individual-databases-in-the-sql-server-2005 how to find out log size of each of the database in sql server 2005? ...

Delete duplicated rows and Update references

How do I Delete duplicated rows in one Table and update References in another table to the remaining row? The duplication only occurs in the name. The Id Columns are Identity columns. Example: Assume we have two tables Doubles and Data. Doubles table ( Id int, Name varchar(50) ) Data Table ( Id int, DoublesId int ) No...

SSIS Packages are not listed in integration services

Guys, We have multiple SSIS packages deployed on a production box. All the scheduled jobs that call these packages run fine. Whenever I create a new package and try to deploy, I can see the folder structure and deploy fine. Here is the problem I am facing: When I log into integration services from SSMS, none of the deployed packages ...

Finding Total Log Size of each DataBase in the SQL Server 2005?

Possible Duplicate: How to find out size of the individual databases in the sql server 2005? How can I get the log size of a database in SQL Server 2005 Due to permission problem ,I am unable to use the command DBCC SQLPERF(logspace),I am unable to view the properties of the database. Please provide me the query or Advise. ...

DATENAME(MONTH,GETADATE()) is returning numeric value of the month as '09'

Hi, When I run the following query [SELECT DATENAME(MONTH,GETDATE())], ideally speaking it should return value as 'September' but its returning value as '09'. I am running this query on MS SQL Server 2005. Is there anything I need to configure with MS SQL Server 2005? Please find the details of the SQL Server 2005 Component Name ...

Another simple SQL question

Hello everyone, i have this query and count(artikel.artikelid) returns 2 instead of 3. i know why, because i have the artikelid twice (8135) in the 'where in...' part but i would like it to return 3 here is my problem query: SELECT cg.CategorieGroepID, cg.GroepsNaam, cg.BenodigdAantal, cg.ActieCatI...

Script all objects in a database into a table

I need to populate a table in SQL server 2005 with some objects in a particular database (stored procedures, tables, views and functions, etc) In the table I would like one line per object and the table columns will be the name of the object , the script of the object, schema and object type. I have tried to use the script below but ...

SQL Server Service Broker Error Handling

I've got a stored procedure that puts a message on a SQL Server Service Broker message queue. I need to return an error message from the stored procedure if something goes wrong and the message doesn't get placed on the message queue. The problem I am seeing is that even if the SQL Server Service Broker is disabled (which is how I'm tr...

Visual Studio 2008 connection to Sql Server 2005

I have a Sql Server 2005 DB on Godaddy. I have Visual studio 2008 not express on my PC. I have tried to set the connection between VS2008 and SQLS2005 to start a project building the formns but it will not connect. I have entered the Hostname, Database name, initial file, username, and password but when I test the connect it fails. I...

Improve Sql Query with select max() function in where clause

The purpose of this query is to bring back products and their prices for products on sale and the price should be from the date closest but not equal to the date passed in, essentially the most recent price available. There are not price records for every day. Something feels a little wrong about having the aggregate select statement i...

Hierarchical query in SQL Server 2005

I have a data structure inside a table in SQL Server 2005 representing a chain of related objects. Each object can have replacements in many steps. I want to perform a query that returns all objects and each object's leaf in the replacement chain. The data: id replacement 1 null 2 3 3 null 4 5 5 6 6 null The result shoul...

SQL statement to select all rows from previous day

I am looking for a good SQL Statement to select all rows from the previous day from one table. The table holds one datetime column. I am using SQL Server 2005. ...

Converting DateTime to nvarchar, just month and year

How to convert the datetime value to nvarchar and want to format it "Month, Year" e-g October 1st 2009 value should get converted to "October, 2009" ...

Output SQL messages to a Log File

Hi, I have an SQL script than runs a couple of DBBC commands. Is there a way to send the messages generated from executing these commands to a simple log file e.g "C:\log.txt"? The messages I mean are the ones that appear in the messages box at the bottom of SQL Server 2005 Management Studio after a query has executed. The reason for ...

sql turn dates of adding and removing into date ranges

I am using a timetabling application called CELCAT and trying to pull out some data about when students should have been marked for reporting... This seems to be extremely difficult because of the way the adding and removing of students on registers is structured see below: studentid  eventid     fromdatetime                 additio...

How to Return Additional Columns With Values Generated in Stored Procedures On the 'Fly'?

This is one of those questions where I'm having a hard time figuring out how to ask it so bare with me. I have a stored procedure in SQL 2005 that calculates distance using the Haversine formula. Everything works quite nicely but I'd like to return the calculated distance with my result set. How do I go about adding that column/value p...