For questions specific to the 2005 version of Microsoft's SQL Server.

learn more… | top users | synonyms (5)

0
votes
1answer
19 views

How to generate a string ready for a update of a query that is on a table column?

I'm storing some queries in a table column so I can execute them later passing some parameters. But it has been really annoying to format the query into an Update sentence, because of the special ...
0
votes
0answers
7 views

Persisting variables across :Connect Batches

I would like to write a single script in SSMS to run against SQL Server 2000, 2005 and 2008R2 servers. It would use SQLCMD :Connect statements, do some work, store some results, then issue a GO. After ...
1
vote
2answers
7 views

Why does my shared data source become a custom data source when deployed?

So I have a lot of SSRS reports that I am attempting to deploy with shared data sources. When I open up the data source in visual studio, "Use shared data source reference" is checked, but when I ...
0
votes
1answer
17 views

Datetime colum to float type conversion is getting issue in sql server

I'd like alter a column type from Datetime to float. Hence, I executed the below query but it was getting a issue alter table dbo.purchasedate alter column supp_dt float null Error :: Implicit ...
1
vote
3answers
39 views

Removing a column of data (string) by using LIKE query, there must be a better way

I have a problem with trying to remove a row of data based on a LIKE match in sql. I'm working with SQL Server 2005. I have a table (@Containers) which holds information like below:- PMBID DEPT ...
0
votes
3answers
23 views

TSQL Error: A RETURN statement with a return value cannot be used in this context

I am just trying to create a function that returns a select statement, but it gives the error: A RETURN statement with a return value cannot be used in this context. This is my code: CREATE ...
0
votes
1answer
13 views

Create new database from backup changing mdf and ldf path

I have a series of manual job: create new database specifying alternative .mdf and .ldf file locations. restore a previous backup in the new database using alternative path defined above and ...
-1
votes
1answer
25 views

Using UNPIVOT with Dynamic SQL

I have a table with this schema: tblResults Question1 | Question2 | Question3 | etc | etc | Question240 | In these columns values can be of the following: 1, 2, 3, 4, N, M I need to present the ...
0
votes
1answer
11 views

Trigger on delete or update that captures the sender and the command

I need to find out who is deleting / updating the data on table THETABLE, the time, using what program, and the command that is sent to the database that caused the modification. From googling and ...
0
votes
0answers
20 views

SQL Server 2005 says #temp table already exists, drop table #temp says invalid, object_id = null

In VS2005 and/or SQL Server Management Studio, I'm trying to create a stored procedure that populates a temp table: --Step 1 - Store uihs.dbo.ahc_data to #ahc_data: --Drop #ahc_data if exist: if ...
0
votes
2answers
21 views

Format string in SQL Server 2005 from numeric value

How I can format string with D in start and leading zeros for digits with length of less than four. E.g: D1000 for 1000 D0100 for 100 I have tried to work with casting and stuff function, but it ...
2
votes
3answers
54 views

Pull Columns based on row value

I have a table X ID A B C D 1 T T F T 2 F T F T 3 T F T F So if my input is 1 for ID, then I want ...
0
votes
1answer
30 views

Creating Autoincrement on AlphaNumeric in Stored Procedure

My Table: CREATE TABLE USER_DATA ([ID] NVARCHAR(10),[NAME] NVARCHAR(50)) My Stored Procedure: CREATE PROC SP_INSERT_USER @NAME VARCHAR(50) AS BEGIN DECLARE @ID NVARCHAR(50) DECLARE @IDTEMP INT ...
0
votes
1answer
26 views

Retrieve different values from same table with different conditions

I need to retrieve the date from a table with different conditions and put each different data with a sum in different columns. After a lot of testing I have this query, but its too slow and too big, ...
-3
votes
1answer
33 views

What is the main difference between incremental and transaction log backup in SQL Server? [closed]

Can any one tell me the main difference between incremental and transaction log backup in SQL Server 2008?

1 2 3 4 5 1038
15 30 50 per page