This tag is for SQL Server 2008, major build version 10.00.xxxx.

learn more… | top users | synonyms (2)

2
votes
1answer
28 views

Pivots giving too many results

I'm trying to learn how this pivot thing works. I don't think I'm understanding it quite right. I just want to do a simple count for a bunch of item types that have some statuses. The table I'm ...
1
vote
1answer
53 views

Upgrade to SQL Server 2012 [closed]

We are currently running SQL Server 2008 Standard edition, 4 processors / 16-core and 32 GB RAM. In the last 3 months number of requests per week raised from 11.1 millions to 72.1 million and the ...
2
votes
1answer
22 views

How to do housekeep the database in sql server 2008 by specific date range?

I have database with around 160 GB size. The database contains the data is from 2013 to until today, there are 180 tables, I want to remove the records in specific date range like 2013 to 2014 in all ...
1
vote
0answers
28 views

Moved tempdb, now File 'tempdev2' does not exist

I moved the tempdb first locating the files: use master select name, physical_name from sys.master_files where database_id = DB_ID('tempdb'); GO then I moved each file: use master go alter ...
1
vote
1answer
29 views

SQL Server Failover cluster installation fails `RequireKerberos` to value '1'

Hi I am trying to create a SQL Server Failover cluster. Windows Cluster is configured and working as expected but now when I try to install SQL Server it throws the following error: OS: ...
2
votes
1answer
41 views

SQL Server 2008 Edition Upgrade Enterprise Evaluation to Standard problem

On my Windows Server 2012 machine SQL Server 2008 evaluation time has expired. After Edition Upgrade nothing happens, SQL Service doesn't start. In service log still is information about expired ...
3
votes
1answer
25 views

Information about a column and the data it holds?

I'm working with a table that has 3 different dates associated with each item in the table. I don't understand what each time is so I want to know if there's a standard place that the person who made ...
1
vote
0answers
19 views

How Columns_update() Function Works in Trigger To Find Updated Columns Name

I am in confuse about trigger function Columns_Update(). i Have Basic Idea about this function that it returns a varbinary and it is use to get updated Columns in Trigger even i have Find The code ...
2
votes
1answer
26 views

SELECT all rows when a variable is null [closed]

How do you select all values when @Troop is NULL. And if there's a better way to do this all together then what would that be? WHERE DateModified BETWEEN @BeginDate AND @EndDate AND ...
0
votes
0answers
11 views

Cannot create 64bit ODBC DSN entry to local SQL2008R2

Environment: SQL Server 2008 R2 server (Express Edition) running under Windows 7 64bit Professional. I want to access the server locally via 32bit VB-application and 64bit Web application. SQL ...
1
vote
2answers
45 views

Rollback Committed transaction in SQL Server

Is it possible to rollback a committed transaction? I have deleted all the data in a table. The delete statement is inside Begin Transaction and I have committed the transaction with a commit ...
-2
votes
1answer
42 views

Recursive cte addition in SQL

I need to add the total value to the parent nodes.(totaling the total value to base to top levels). 118 records are there and 1-8 levels. Root ACCCODE='00001' Root ACCPARENTCODE='0' Eg: adding ...
2
votes
1answer
37 views

Searching SSIS packages for the use of specific tables

I have a number of SSIS packages, how can I search them to find the use of specific tables? I need to make tables changes and I am trying to assess the impact of these.
3
votes
3answers
193 views

Make a column for each count(*) in a day of the week

I have a table of people who are doing piece work. Every entry in the table has a user-ID, name, and a Date for each report they enter. I need to make a weekly report of what these people have done ...
1
vote
0answers
48 views

SQL Server 2008: DoMiniDump () encountered error (0x80004005) - Unspecified error

We're running a SQL Server 2008 database and are getting the following output(error?) in our logs: 06/23/2015 21:56:41,Server,Unknown,Process 214:0:42 (0x73b0) Worker 0x0000000BB2CC61A0 appears to be ...
1
vote
0answers
44 views

Export using BCP as ASCII text

I have a script that stores data in a temporary table to be exported by running BCP using xp_cmdshell. The trouble is that BCP insists on exporting the data in Unicode and I need it to be in ASCII. ...
1
vote
1answer
45 views

Dropping old and creating a new clustered index

I am wondering what is the best approach for dropping and creating a new clustered index on a table within SQL Server 2008. My primary concern is the length of time it will take to perform this ...
2
votes
4answers
79 views

SQL Server 2008 backup script

I have a lot of SharePoint 2013 databases to backup and if update fail to restore, so I want to automate this operations. ALTER DATABASE [TEST_1] SET OFFLINE WITH ROLLBACK IMMEDIATE GO BACKUP ...
0
votes
1answer
41 views

How to make sum of minutes into (Hours : Minutes) format

How to add (sum) two fields (Data Type=Money) into hours:Minutes format Query: SELECT ( SELECT ISNULL(SUM(action.service_time), 0) AS Expr1 FROM dbo.act_reg AS action INNER JOIN dbo.act_type ...
7
votes
3answers
460 views

Accidentally change database name (SQL Server 2008)

It didn't happen to me YET. But I was thinking about this. I was messing around with my training environment, and by mistake I clicked in the database name, and then I touched the letter A. Let's ...
1
vote
1answer
20 views

Import .bak into SQL Server 2008 Management Studio

I have a custom program that uses a database. I have little knowledge of servers but the way it works is by using a "local" server in the same computer as the one where the program is installed. I am ...
0
votes
0answers
15 views

Better diagnose information in sqlcmd

I'm tired of running SQLCMD scripts that include a large number of files: :On Error exit :r ".\tables\table01.sql" :r ".\tables\table02.sql" ... :r ".\tables\table99.sql" ... and getting ...
3
votes
0answers
88 views

Bad Plan after a couple of days

I have this query that runs fine for a couple of days (from the application) and then slows down to where it can't even finish. If I rebuild the plan, it flies. There is a signifigant amount of data ...
2
votes
2answers
82 views

SQL Server 2008 - combined index + other separate index on one column

Lately I've been refactoring the SQL Server indexes of the products that I have developed for my employer. One of these products is an online dashboard containing multiple user levels. Each user (on ...
1
vote
1answer
41 views

How to get the sum of filtered fields in SQL

How can I filtered values in SQL? When I execute this query, I'm getting the result below. SELECT Stock_TBL.StockID, Stock_TBL.ItemCode, Stock_TBL.ItemDescription, InvoiceItems_TBL.StoreName, ...
4
votes
1answer
65 views

Get the would-be row count without running twice

So I have a stored proc that utilizes a paging function to only return a subset of the query along with the actual total row count. In other words, it takes parameters for the start and end rows to ...
0
votes
0answers
25 views

Query Performance BIT column vs New Table

Would it be more efficient to flag 50 rows with BIT 1 / 0 in a table with 2000 rows OR create a new table to hold only 50 PK values from the previous table The query on this would just be a WHERE ...
1
vote
0answers
33 views

Schedule data from instance to instance have I maxed out tableDiff

We have a process which uses tableDiff. From one SQL Server 2008 R2 instance to another identical instance. It has worked very well for a long time! I have a situation where one table now has ...
0
votes
0answers
32 views

Retrieving a record for the last date received and returning the value of another column in that row

I have the following query which is returning me total number of expected records : select a.New_FirstName + ' ' + a.New_LastName as 'Account Name', a.New_MPRNNumber,MAX(b.New_readdate) as 'Last SC ...
2
votes
1answer
38 views

reading content of master database at a different server

I have a query for example select * from sys.databases select * from sys.configurations I believe this information is stored at master database. I would like to have a look at configuration ...
0
votes
3answers
57 views

Query for total downtime of site using datestamps and status columns

what want to find the total downtime for a site. I'm thinking I can subtract the 'down' DateStamp from the following 'up' DateStamp. then add the totals together for all downtime. I want to get a ...
1
vote
0answers
116 views

How to create a Linked Server from SQL Server 2008 to DB2?

( This is an edit...the real post was really big ) I'm having problem with my SQL Server 2008 to DB2 linked server. I'm getting this error: TITLE: Microsoft SQL Server Management Studio The ...
1
vote
1answer
27 views

always error “cannot insert value NULL” sqlserver

I want to update table "tmpiscunitmap.tr_kpi_id" year_period=2016 with value from table "tmp_kpi.tr_kpi_id where year_period=2016" with condition tmpiscunitmap.tr_kpi_id = tmp_kpi.tr_kpi_id on ...
1
vote
1answer
37 views

SQL Server Query For Getting data in Specific Format

We have two tables. One is PriceGroupTable and other is PricesTable. There is a one-to-many relationship between them. Please refer to the attached pic for more details. I am looking for a SQL ...
1
vote
1answer
14 views

Join tables up together to get different counts of account type per postcode are

I am trying to deterine the amount of account types per postcode range. I have the following code that works but I would like help in refactoring it as only 1 line of code changing between each ...
1
vote
0answers
22 views

How to mark loser as winner in p2p replication conflict resolution

We have sql server 2008 databases in 2 different regions that are p2p replicated. Now we can see there are some unresolved conflicts - most of them update/delete conflicts. The way our system is ...
1
vote
0answers
9 views

How I can read errors that occurred in the BBDD as processes incomplete in MS-SQL?

How I can to recognize the processes that failed on the SQL Server/bd, processes that any user run/exec. For example the last rollback occurred in the bd after some process failed. Would reading ...
4
votes
1answer
116 views

Preventing full backups for unmodified/slightly modified databases

Is there a way to either: ensure that unmodified databases are skipped during SQL backups, or even better choose between DIFF or FULL backup depending on the percent database changed since last ...
0
votes
1answer
46 views

Getting error: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value [closed]

I am getting the error The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. for the following query. After checking some questions here I was able to know ...
0
votes
1answer
36 views

Version error while restoring database [duplicate]

Can anybody resolve the issue where I am trying to restore a database to a SQL Server 2008 server from a backup file taken from a SQL Server 2008 R2 server?
3
votes
1answer
224 views

SQL Server DOUBLE keyword

There is a reserved keyword DOUBLE in SQL Server, but I know that it's not a data type (other languages' double is float or real in SQL Server); does anyone know why this is a keyword? I've tried to ...
2
votes
1answer
45 views

sql server listen on multiple ports

I have a push subscriber in transactional replication (and the distributor is the publisher), in this subscriber I configured sql server port on 1433, and I have a web application which connect to ...
0
votes
2answers
43 views

DB Re-index failure

I'm managing a DB (SQL Server 2008) with a two step SQL Agent job that is triggered to initiate a DB Re-index. However on the second step the SQL Agent job fails. Where can I find logs that detail the ...
0
votes
2answers
21 views

Find constraint disabled in SQL Server

i'm doing an audit of constraints in SQL Server. How to find all constraints that are not enabled? This, after using the next declaration: alter table mytable nocheck constraint all
-1
votes
2answers
55 views

Getting a total value for items obtained in the current quarter

I've been working with MS SQL Server Management Studio and have a problem I can't fix. I am currently able to get the total for a set of values (Volume and Activity) from my SQL Server database. ...
4
votes
1answer
119 views

Truncate log file mirrored database

In SQL Server 2008, I have a mirrored database with a log file that has increased to 80GB, which is not normal and I have serious problem. I would like to decrease the log file size by truncating it. ...
1
vote
1answer
51 views

TempDB Autogrowth - Does SQL need a restart?

I have a case where i'm running into an issue with the tempdb not being large enough. Here is my error: Could not allocate a new page for database 'TEMPDB' because of insufficient disk space in ...
0
votes
0answers
41 views

Reduce SORT overhead / Improve order by performance

My business works like this: The client downloads the data from this table which contains roughly 33 millions rows holding one week worth of data (which is then moved to a historic table). The client ...
0
votes
1answer
58 views

Do I need to rebuild indexes when upgrading a DB from 2008 to 2012?

I can't find anything on BOL that indicates I need to rebuild indexes or statistics after the migration and compatibility level upgrade of a database. But I have read a few articles/answers around the ...
0
votes
0answers
38 views

clarification of ALTER DATABASE error message

I took a SQL Server 2008 database offline: alter database FOO set offline; Then I copied its MDF and LDF physical files to a new folder on another hard drive. Then I ALTERed the database: ALTER ...