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

learn more… | top users | synonyms (1)

3
votes
2answers
609 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
311 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
202 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
200 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
118 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
80 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
2k 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
19 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
3k 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
45 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
148 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
50 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
54 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
41 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) ...
7
votes
6answers
637 views

Scheduled backup task doesn't always backup all databases despite always saying job successful

I have a job in SQL 2008 that runs a stored proc to backup all databases. This runs daily via sql server agent job. It quits with success every day but some days it quits with success only after ...
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
62 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
95 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
164 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
48 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
134 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
385 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
509 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
553 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
133 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
665 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, ...
2
votes
1answer
672 views

Can't Restore DB Because of Active Connections

I have a DB I would like to restore. There are other active connections on the DB. I tried using sp_who2 to find those connections and manually kill them. Unfortunately, this did not solve the ...
3
votes
1answer
277 views

Shared locks taken under Read Committed Snapshot Isolation (RCSI)

I am seeing waits for shared locks (LCK_M_S) when using RCSI. My understanding is that this isn't supposed to happen since SELECTs do not require shared locks when using RCSI. How can I be seeing ...
1
vote
3answers
68 views

New SQL Server 2008 instance, load old instance DB's

BACK STORY: I'm a developer with a local instance of SQL Server 2008 on my workstation. I just recently upgraded my motherboard and found out (much to my dismay) the old motherboard's RAID drivers ...
11
votes
4answers
18k views

How do you kick users out of a SQL Server 2008 database?

We need to do a restore, and cannot because other users are connected. We thought we had disconnected every process, but apparently not. How can we, from Management Studio, kick off everyone else so ...
0
votes
2answers
866 views

Create an Audit trail on SQL Server 2008 to trace all privilege users

I need to create a trace of all the commands issued by members of SysAdmin or SecurityAdmin server Roles. I figured, I could use Profiler to do that but it will not comprise all the added members. I ...
4
votes
3answers
2k views

How to compare two SQL Server 2008 configurations

I have a problem with my application that works on my dev SQL Server 2008 (Developer Edition), but not on a production SQL Server 2008. Is there an easy way to export the settings from the production ...
1
vote
3answers
999 views

SQL Agent still attempting replication for deleted publication

We recently retired a replication publication, deleting each subscription (push subscriptions) and then deleting the publication, all from within SSMS. However, we continue to get the following ...
2
votes
3answers
2k views

Recover lost data from .LDF file

Background: Using Business Contacts Manager 2010 with SQL 2008. Master database is hosted through SQL and each computer connects. When the connection is stopped, each computer switches to local copy ...
1
vote
3answers
56 views

Programatically copying data from table from offline database to online database [closed]

I have a local database and an online database. When i make an entry into my local database, it should also automatically make an entry in the online database. Can anybody tell me how I can do that?
0
votes
3answers
301 views

SQL Server 2008 R2 Remote Connection issue

I have installed SQL Server 2008 R2 in mixed mode, but currently issue is I can't use SQL through ip nor ip with port, even I have enabled TCP/IP and open port in firewall too. I tried to telnet ...
1
vote
0answers
38 views

Multiple login mappings for linked server

Can we assign two logins for two different databases on target server. For example, I would like to create a Linked Server between ServerA and ServerB. ServerB has two databases on it and both using ...