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

learn more… | top users | synonyms (2)

2
votes
1answer
17 views

SELECT all rows when a variable is null

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 ...
4
votes
1answer
47 views

SQL Server DB become unusable overnight

Yesterday, my SQL server database was fine. Today it is almost unusable - it's slowed down by a factor of between five to twenty, depending on when I hit it. Some data was added to the server in an ...
1
vote
2answers
29 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
31 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
16 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
153 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 ...
0
votes
0answers
15 views

unsigned right shift '>>>' Operator in sql server [closed]

How to write unsigned right shift operator in sql server? The expression is like value >>> 0 Here is the e.g. -5381>>>0 = 4294961915
-5
votes
1answer
25 views

How to copy my SQL Server 2008 database [closed]

In my SQL Server 2008 copy database option is not present. Can you help me to copy the database?
1
vote
0answers
37 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
30 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
42 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
0answers
10 views

I want to move the listbox one to another listbox and update the particular listbox value [migrated]

Here, Below i used the code. I am new in VBA. I am trying to move the one list box to another listbox, but I am not able to update the database table. I am struggle on few days. Why this error came ...
2
votes
4answers
68 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
33 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
420 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 ...
0
votes
0answers
14 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
1answer
85 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
73 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
40 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, ...
3
votes
1answer
48 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
31 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
29 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
33 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
54 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
77 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
26 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
29 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
20 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
112 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
32 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 ...
-1
votes
0answers
30 views

SQL Server Cluster hardware and OS upgrade question

We have a 2-node and a 3-node SQL Server Cluster running on Windows Server 2008. It is time to update the hardware and the OS. Can you point us to resources on how to migrate to new hardware running ...
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
204 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
41 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
41 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
19 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
50 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
76 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. ...
0
votes
1answer
34 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
36 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
49 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 ...
0
votes
0answers
26 views

Running recursive Merge in SQL server

I just realized, I should have added it here in dba.StackExchange, instead of Stackoverflow, so apologies for the duplication I have two tables, a Card with a list of CardLines associated to it Card ...
2
votes
2answers
15 views

Meaning of “The database X needs to be upgraded” in ClearTrace

I'm trying out ClearTrace from http://www.scalesql.com/cleartrace/download.html , but it isn't very user friendly from my first impression. I have a database in SQL Server 2008 that I'm adding in the ...
0
votes
0answers
43 views

Intermittent DB connection failure

Recently I started to see intermittent errors in log files of my web application. Raising from different places of the application the error is always about failed connection to DB which is located on ...
-2
votes
2answers
46 views

SQL Server failed stored procedures log [closed]

How to find errors that was occurred in stored procedures in some timespan in Sql server management studio 2008 ?
0
votes
1answer
48 views

SQL Server 2008 commit overhead warnings

I have four mirrored user DB's on a pair of Server 2008 R2 machines. My Db engine is SQL Server 2008. Of the four Db's one is warning me of overhead commit latencies ( > 20ms). From some research on ...