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

learn more… | top users | synonyms (1)

5
votes
2answers
2k views

SQL Server 2008 can't repair consistency

I have a problem with a SQL Server 2008 database. Launching DBCC CHECKDB I get this error: SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: ...
0
votes
3answers
108 views

How to improve this query performance by indexing properly?

I have following select query, and I need to improve the performance of this query. Can anyone suggest me how to convert the clustered index scan to index seek? DECLARE @now DateTime; DECLARE ...
2
votes
2answers
561 views

Deploy SQL Server Backup Maintenance Plan in multi-tenant environment

We have a multi-tenant environment in which I've been trying to deploy a standardised maintenance plan across all servers. I've been running into issues importing the maintenance plan properly, as ...
4
votes
3answers
14k views

How to Handle TimeZone Properly in SQL SERVER?

I have some issue which needed to be fixed quickly. My local development server is in middle east. But my production server is in UK. Now, I need to show the date to user to thier timezone. For ...
3
votes
1answer
3k views

Moving from SQL 2005 [SQL_Latin1_General_CP1_CI_AS] to 2008 - will I lose any features by using 'backwards compatibility'

We're moving from SQL 2005 [Instance and DB have collation of SQL_Latin1_General_CP1_CI_AS] to SQL 2008 [which defaults to Latin1_General_CI_AS]. I completed a SQL 2008 R2 installation, and used ...
5
votes
3answers
754 views

SQL Server renaming table from another database

Is there a way in SQL Server to rename a table in another database? When you are in current database and migrating data over to another database in the TEMP table and then renaming TEMP table in that ...
-4
votes
3answers
818 views

How database administrators can see my requests to SQL Server?

I'm a SQL Server 2008 user. I have access to some tables. I need to request few columns from table as I usually do. But I need to do it once (for example) in 5 seconds and system administrators ...
4
votes
3answers
693 views

Get notified when SQL Server 2008 Audit Server logs something?

I'm setting up SQL Server 2008 Audit Server to log any activities made by certain group of users of certain database. All I need to do is get notified when the Audit server logs something, so that I ...
4
votes
1answer
95 views

How to restore symmetric key on the new database?

I have an issue with symmetric key restoring on the another database. I have table in the first(old) database with encrypted column.(The table contains encrypted data) The key in the old database has ...
2
votes
1answer
139 views

How to improve this queries performance by indexing properly?

Hi here i have a query and i need to improve the performance of this query.Can anyone suggest me like how to convert the clustered index scan to index seek. DECLARE @now DateTime; DECLARE ...
1
vote
1answer
76 views

Why isn't my new index/table being created on the filegroup I specify?

Results from @@Version Microsoft SQL Server 2008 (SP3) - 10.0.5500.0 (X64) Sep 21 2011 22:45:45 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.1 ...
2
votes
0answers
51 views

Network and memory waits after massive ALTER

We had to do a massive ALTER to our DB, changing one central table's PK to BIGINT due to approaching ID's generated in the 2 billion range. Due to this, several hundred referencing keys and indexes ...
3
votes
2answers
618 views

Can I get notification when event occur?

SQL Servers has Traces and XEvents. These are used to capture and analyze what is going on with our SQL Server Instances. Events are stored in the stack for later analysis. For example, If I decide ...
3
votes
6answers
1k views

Stored Procedures under Source Control, best practice

I am currently using Tortoise SVN to source control a .NET Web Application. What would be the best way to bring our SQL Server stored procedures into Source Control? I am currently using VS 2010 as my ...
5
votes
2answers
313 views

Performance hit of CONVERT from nvarchar to money (SQL Server)

I have a dollar amount value, that for historical reasons has always just been stored in an nvarchar field. Now that we are storing many more rows than we have in the past, and are using this field to ...
2
votes
0answers
204 views

select top x works, but x+1 runs endlessly [closed]

Something happened to a table, that results in an endless executing select and I'm trying to figure out the reason. What I tried and found out: This runs endlessly: select * from dbo.MyTable As ...
4
votes
1answer
201 views

SQL query filled Temdb complete Harddisk [closed]

I have a query which was earlier fine but now it is running me out of hard disk space with message that tempdb is full. My Harddisk has 90 gb of space as soon as i run query temdb runs out of space in ...
1
vote
1answer
141 views

Using ODBC Connection to Access Firebird Database

I have an ODBC connection to a Firebird database that tests successfully. Is there a way to use this ODBC connection within SQL Server 2008 R2 to access the tables? I haven't used Linked Servers ...
3
votes
1answer
82 views

Suppressing the SSMS prompt to save changes

Is it possible to configure SQL Server Management Studio (SSMS). so that the dialog box shown above does not appear when I close an unsaved query window?
15
votes
7answers
3k views

Why should an application not use the sa account

My first question ever, please be gentle. I understand that the sa account enables complete control over a SQL Server and all the databases, users, permissions etc. I have an absolute belief that ...
0
votes
0answers
21 views

How to view contents of .sdf file?

I want to view contents of .sdf file but im not able to open the file, is there any way to open thi file and see its contents, could anyone please help on this?
3
votes
4answers
4k views

Scriptable command line access to SQL-Server from linux

Does anyone know of a ready made1 command line tool that would allow me to connect from a linux client to a sql-server? I want to be able to run arbitrary queries, but most of the time I want to be ...
0
votes
0answers
61 views

Transaction log backups during index maintenance

We have a database with large and complex files and fragmented indexes. The environment is SQL 2008 Full recovery model and Mirrored which limits me to reorganizing. The backup strategy is Full ...
2
votes
2answers
104 views

Need help performance tuning a query

Basically, here is the design of the table (the part that is necessary): id | dt -------- 1 | 2014-05-13 2 | 1900-01-01 3 | 1900-01-01 4 | 2014-05-12 5 | 1900-01-01 So what I am trying to do ...
0
votes
0answers
47 views

Transactional Replication

SQL server 2008 R2. I have set up transactional replication on 40 tables in a database (other tables don't replicate). There was an issue in the morning and it is fixed now. I resynchronised the ...
2
votes
1answer
152 views

Using OPENQUERY to execute a script

I have a SQL Server 2008 instance which I want to use to import data from an Oracle server. I have set up a linked server that works correctly when running simple queries like SELECT * FROM table. ...
0
votes
0answers
51 views

Login failed for a user in a Domain Local Group

I have recently been considering moving from using SQL Logins in my applications, to a model using Windows Authentication using Active Directory groups My intention is to allow users access to ...
2
votes
1answer
57 views

Select query - group by and sub group by

CREATE TABLE [dbo].[temptable] ( [Id] INT NOT NULL PRIMARY KEY IDENTITY, [uid] INT NOT NULL, [pid] INT NOT NULL, [event] INT NOT NULL, [timeStamp] DateTime NOT NULL ) I want ...
5
votes
3answers
9k views

How to restore multiple backups

I'm using ExpressMaint and Windows Scheduled Tasks to create weekly full and daily differential backups of some MS SQL Server 2008 R2 Express databases Weekly fulls expressmaint -S ...
1
vote
1answer
42 views

Order of output row in random order [duplicate]

When I do select query on single table then I get output rows ordered by primary key which is perfect, following query: select * from recondata where importid=131; but when I'm joining this table ...
6
votes
5answers
16k views

Restoring a backup to an older version of SQL Server

When trying to restore a backup to a SQL Server Express 2008 database I got the following error: Restore failed for Server '...\SQLEXPRESS'. (Microsoft.SqlServer.SmoExtended) ...
1
vote
3answers
6k views

How to query last restore date in SQL Server?

Is there a TSQL query that shows the last restore datetime for a certain database?
-2
votes
1answer
64 views

How to create a user via GUI in SQL server 2008 R2 with read only access on specific databases? [closed]

I am a newbie in SQL server 2008 and slowly learning it. Today I got a task of creating a user with read only access for a specific database in a server. So what should I specify under the tab- ...
2
votes
0answers
19 views

enable database to work with Snapshot Isolation [closed]

I can't enable snapshot isolation ALTER DATABASE mydb SET READ_COMMITTED_SNAPSHOT ON; ALTER DATABASE mydb SET ALLOW_SNAPSHOT_ISOLATION ON; query still 0 rows working 5 days and nothing ...
-5
votes
1answer
110 views

How to clone a user in SQL Server 2008 R2?

I am a newbie in MS SQL Server, and just got assigned a new task to clone 5 users from an existing user in a Database. Could anyone help me? P.S.: It would be great if the step or method is in GUI. ...
3
votes
1answer
45 views

Safe to start Mirroring on Production Server?

We have a 350 Gig DB on SQL Server 2008. We intend to backup and restore it then immediately start mirroring. Is starting a mirror a dangerous operation to do on a production database ? Can I expect ...
1
vote
0answers
68 views

How to copy a subset of SQL objects across databases within a transaction?

We already have a .dtsx package to copy a subset of tables (about 20) from one database to another (at least once in every month). It is using "Transfer SQL Server Objects Task". However this does not ...
3
votes
3answers
1k views

Setting up SQL Server 2008 R2

I need to set up a SQL Server for a development environment for a client. First I installed SQL Server 2008, I was able to connect to it from SQL Server Management Studio fine but when I tried to ...
3
votes
3answers
1k views

How to run bcp utility from root drive?

My machine does not have full SQL Server installed. The following distributable packages are installed on my machine:- Microsoft® SQL Server® 2008 R2 Command Line Utilities Microsoft® SQL Server® ...
0
votes
1answer
68 views

SQL Server monthly Backup

Im pretty new to SQL and some employee asked me if is possible to make monthly database backups. We do daily full backups to NAS server via cobian and we use SQL Server Management Studio to make ...
1
vote
3answers
165 views

How to build a database that contain only the delta from yesterday

I need to know what has been changed on my database since last night. Is it possible to extract this data from the LDF file and to build a new Database that contains the delta? For example, let say I ...
0
votes
2answers
51 views

How to change the path of data during database restore + SQL Server 2008

I am trying to restore a big database in SQL Server 2008 R2. The database is about 700GB in size. My SQL Server is installed in C drive which has only 100GB of space left in it. I have the .bak file ...
0
votes
1answer
149 views

How to set variables to multiple values (that are integers)?

I have 5 facilities in my division, but the code below in a stored procedure only pulls documents when the "facilityID = 4" unless if I change it manually to represent other ID numbers. So I need the ...
0
votes
3answers
388 views

SQL Server XML Insert Optimize?

I have a 400k XML document trying to insert into an 86-column SQL Server 2008 table. It takes about 35 minutes to get that XML into a temp table using this code: with XmlNamespaces ( ...
2
votes
2answers
518 views

SQL Server stored procedure working when run manually, not running from SQL Server Agent

I have a procedure that runs fine using the execute command in SSMS, however putting the same command in a job gives the following error. line 9, character 9, unexpected end of input The code ...
1
vote
1answer
559 views

Add Check Constraint On Varchar Column to enforce no duplicates

I have a varchar(max) column where users will populate a pre-given key from another system. I want to enable that the users are forced to enter a unique key which means no duplicate values on that ...
2
votes
1answer
134 views

Numbering multiple dates per delivery

I am interested in producing the following view where different delivery dates are numbered. SalesID Delivery Date DateNo SO00000014 2014-02-21 1 SO00000015 2014-02-13 1 SO00000016 ...
6
votes
1answer
673 views

Service Broker: Queue Monitor is dropped after poison message

I have searched everywhere and there isn't an answer online. There is one similar question on stackoverflow but it's not exactly the same and it has no accepted answer. When I setup event ...
0
votes
3answers
112 views

Get into SQL Server 2008 with no management studio and no sqlcmd

I got office program. This program stores his data in SQL Server 2008 Express, but there is no management studio and no sqlcmd. How can i get into pure SQL tables, to use them in my plugin.
3
votes
5answers
1k views

Trigger Performance : Is Using Trigger is a good way?

We are using SQL Server 2008 for a j2ee web application. I need to maintains the audits for updates for each column with their previous value and new value on one of my table which is very heavy, ...