Microsoft's SQL Server is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. It originated from the Sybase SQL Server codebase, which is why both products use the extension of SQL called Transact-SQL (T-SQL).

learn more… | top users | synonyms (2)

0
votes
0answers
5 views

What is best way to handle transaction in sql server when inserting in 15 to 20 tables in one batch

What is best way to handle transaction in SQL Server when inserting in 15 to 20 tables in one batch. Currently I am using single transaction for multiple insert statements in stored procedure.For ...
0
votes
2answers
28 views

Snapshot replication - How to detect when a snapshot has arrived on the Subscriber from the Subscriber DB

I have snapshot replication set up to on a server which publishes to a second server as part of a scheduled SQL Server Agent job. When the snapshot finishes, I would like to detect when each table has ...
2
votes
1answer
74 views

SQL server query is slow *without* including execution plan

I have just set up fresh installation of SQL Server 2012 on a new server and I'm experiencing very strange performance problems. Long story short, for some reason not including execution plan makes my ...
1
vote
0answers
25 views

Tools and techniques for untangling monster views (nested views)

First a bit of context (venting). I'm working with a new vendor product which is really nothing more than a SQL Server database with a .NET interface. First few weeks with this client and users are ...
0
votes
1answer
34 views

SQL Server 2008 - How to schedule a copy of view to another database?

I am a Sharepoint admin and need to copy the log data in database to another temp database for analysis. The data is stored in a view ([WSS_Logging].[dbo].[RequestUsage]). There is a column [LogTime] ...
0
votes
1answer
30 views

Database analysis

I have database which that store the sold products in Orders Table and another table called Transaction to set the time and the total price for the individual order ,my question is: How to combined ...
1
vote
0answers
33 views

Clustered Index with nightly ETL process

We have a nightly ETL process that involves data from many different sources being flattened, and loaded into a completely denormalized table on SQL Server 2008 for reporting. The clustered index on ...
1
vote
2answers
26 views

Archiving data from logging db (high writes, no reads)

I have a logging database into with a few lookup tables and one massive event table that has 79 million rows. On busy days my code inserts over 3 million rows, so the event table would be enormous in ...
1
vote
1answer
35 views

Converting a VARCHAR to VARBINARY

I've been keeping a log of expensive running queries, along with their query plans, in a table to allow us to monitor trends in performance and identify areas that need optimising. However, it's come ...
1
vote
1answer
36 views

SQL Server Group By Very Slow unless using temp tables

I have a simple query: INSERT INTO #Values SELECT 2, MONTH(f.Datum), SUM(Quant * Price) FROM r_Fakt_Otpr_Data fd INNER JOIN r_Fakture f ON fd.FK_Faktura = f.ID_Faktura WHERE f.Type = 2 AND f.Stock = ...
2
votes
0answers
48 views

Sql Server 2012 Enterprise Backup with no file

We currently have a database which increments 5TB a day. The current backup solution we have uses Avamar, which I believe does a kind of block comparison backup where there is no need for an actual ...
3
votes
1answer
38 views

App domain is marked for unload due to memory pressure

In my sql server log (2005 SP4) I have this message every couple of seconds : "AppDomain XXX [DataBase.dbo[runtime], YYY] is marked for unload due to memory pressure" Our server : Windows Server ...
1
vote
2answers
75 views

How to Move All tables from one Database into Different Database?

I am using Oracle SQL Developer and I have ten tables. Now I want to move all 10 tables from Oracle into a SQL Server 2008 R2 database. Is there any easy solution for this task?
-3
votes
0answers
14 views

how can insert multipal data from table1 one column data can copy from another table2 from sql server [on hold]

how can insert multipal data from table1 one column data can copy from another table2 from sql server eg insert into Voterinfore(CustID) select CustID from CustomerVoterInfo --SET IDENTITY_INSERT ...
-2
votes
0answers
29 views

Error after SQL Server upgrade [on hold]

I upgraded my SQL Server from 2008 to 2014 and I can no longer get online. All web sites say waiting on website to load. Does anyone know what happens during this upgrade that might have caused this?
1
vote
1answer
67 views

Need help with SQL Server PIVOT

I know about the PIVOT feature in SQL Server and I've read a few other questions and answers on here but I just can't seem to grasp it in order to do what I need. I'm trying to run some calculations ...
1
vote
0answers
17 views

CHECKDB Allocation Errors Msg 2576, could not repair, object id does not exist

I inherited a database that has no value in LastKnownGood. I ran repair allow data loss, says it was successfully repaired, but no change to the errors when I run checkdb again. In case it was a SQL ...
0
votes
1answer
27 views

How can i insert the multiple data in table using the existance condition?

I am able to insert the multiple data in table mytest using the below query. But how can i modify the below query so that everytime it checks the first_name and @id_for_test and if its unique, it does ...
0
votes
0answers
12 views

SQL Server 2008 R2 installation device error

I am trying to install SQL Server 2008 R2 to use along with Visual Studio for a website I am creating. However when I am installing SQL Server I am constantly getting the following error: The ...
2
votes
2answers
207 views

How to know who dropped a database

I have in the SQL server a lot of databases, but one of them has been dropped, so I need to create a trigger to send me an email when someone try to drop another database. The e-mail should contain ...
3
votes
2answers
44 views

SysAdmin server role and Active Directory Groups

I've been struggling to find best practices information or any advice regarding Active Directory Groups that provide group members with the SysAdmin server role. I'm at a new job where I'm the only ...
0
votes
1answer
12 views

monitoring sql execution perfomance of an application that makes use of SP_prepare

we have an application that makes heavy use of sp_prepare and sp_execute and we would like to start monitoring the execution plans of the sql. but this is made difficult by the use of sp_prepare ...
0
votes
1answer
48 views

Fixing a corrupt Log File in small downtime window

I am working with a client who has been receiving the following error from their Log backups of one of their SharePoint databases: Backup detected log corruption in database FOOPORTAL_SP2010_Config. ...
1
vote
1answer
194 views

Understanding datetime formats in SQL Server

I've dealt with MS SQL Server datetime types for a long time but never thought why the following is happening: I query a table that contains a smalldatetime column. This smalldatetime is always ...
2
votes
1answer
123 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
138 views

Synchronization using triggers

I have a requirement similar to previous discussions at: Writing a simple bank schema: How should I keep my balances in sync with their transaction history? Trigger in combination with transaction ...
4
votes
0answers
47 views

Major Discrepancy Between SQLIO IOPS/Throughput Stats and DBCC CHECKDB Operations

I'm conducting time trials on a new SSD array running both SQLIO tests and a real-world workload of DB restores and DBCC CHECKDB calls. I'm seeing a major discrepancy between the IOPS and throughput ...
0
votes
3answers
80 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
1answer
59 views

How do I deal with query getting slower when a select parameter is not specified inline?

I faced this problem twice with SQL Azure and two different queries so far. Something like this: select top(100) * from SomeView WHERE AccountId='actual-guid-typed-in-here' runs super fast but ...
0
votes
1answer
73 views

How to get back sql table data? [duplicate]

IDE: Microsoft SQL Server Management Studio Mistakenly I have cleaned a table data using delete from table tblBookData and now it has cleaned that table, please tell me is there any way to get ...
3
votes
2answers
151 views

Track changes in database structure

There has been a change in our DB and one of the SPs has been deleted. We have no idea who did it or when. Is there any way to find it out? Or enabling an option to be able to track this in future?
2
votes
1answer
113 views

How do I transfer logins from 2008R2 to 2014 with passwords?

I've tried Tasks>Generate Scripts... and set 'Script Logins' in the Advanced Scripting Options, but I get this in the output: /* For security reasons the login is created disabled and with a random ...
1
vote
1answer
70 views

Possibly tempdb out of space or a system table is inconsistent

While running DBCC CHECKDB I got this error Msg 8921, Level 16, State 1, Line 1 Check terminated. A failure was detected while collecting facts. Possibly tempdb out of space or a system ...
-9
votes
0answers
33 views

Mirroring error #1418 [closed]

I have configured mirroring in server without witness but I am getting a error no 1418 please suggest how to solve it. Even if I tried to create a endpoint but I couldn't create it.
0
votes
2answers
31 views

Dynamically REVOKE CONNECT FROM guest in SQL Server 2005

I wrote this simplistic script (I'm not very familiar with TSQL and dynamic SQL) to revoke all connections from guest accounts: DECLARE @database_id int, @database_name nvarchar(100); DECLARE ...
13
votes
2answers
234 views

In SQL Server, should I force a LOOP JOIN in the following case?

Typically, I recommend against using join hints for all the standard reasons. Recently, however, I have found a pattern where I almost always find a forced loop join to perform better. In fact, I am ...
2
votes
0answers
56 views

Phantom Transactions using Version Store in tempDB

We are seeing version store space increasing on one of our servers, and there are ~20 sessions that are showing as actively accessing version store rows for over 24 hours. The problem is, when I try ...
0
votes
0answers
52 views

OUTER APPLY vs LEFT JOIN

I'm working on the query bellow. Its structure is based on someone else's similar query... SELECT tptype.Code AS ThirdpartyTypeCode, ptf.Ticker AS TextId, finIn.InternalCode AS ...
-1
votes
0answers
51 views

SQL Server Implement Limit Functionality

I am facing problem to implement the pagination on grid. Actually after applying all the filter we get 3000k records from database but if pull the 3000k data the query take time so I am showing only ...
0
votes
4answers
84 views

PostgreSQL 9.3 on Ubuntu Server 12.04 v.s. MS SQL Server 2008 R2 on Windows 7 Ultima

I have searched many articles in Google about the performance of PostgreSQL vs MS SQL 2008 R2 and found that many of those articles say the performance of PostgreSQL is better than that of MSSQL 2008 ...
1
vote
1answer
45 views

Looking for ideas on maintaining data warehouse in close to real-time - ETL tools, etc

I have done a fair number of traditional data warehouse implementations where the loads were done in a batch-oriented manner, i.e. the data is refreshed nightly or, at most, every few hours. I now ...
0
votes
1answer
37 views

What data will be lost with DBCC CHECKDB (REPAIR_ALLOW_DATA_LOSS)?

I have a corrupt database. The last known good backup was over 2 weeks ago. I've run a CHECKDB and have the page numbers where SQL Server located the corruption. I've looked at the data on the ...
1
vote
2answers
98 views

What is the best way to get all data for a date range, plus the last event just before the range?

For this question assume the following: There is a table of events [Event] There is a table of employees [Employee] There is a table that relates the two [EventEmployee] (EventID + EmployeeID) Each ...
1
vote
1answer
34 views

Avoiding entitized characters when using FOR XML PATH for string concatenation

I have this query: SELECT DISTINCT f1.CourseEventKey, STUFF ( ( SELECT '; ' + Title FROM ( SELECT DISTINCT ...
2
votes
1answer
57 views

Error checking with sp_send_dbmail

This question is kind of multifaceted. First, what I'm trying to actually accomplish: I am in an environment where there is not really heavy data validation on inputs. So there is lots of opportunity ...
1
vote
1answer
45 views

Profiling parameters

I was trying to fine the parameters of a query I suspect to be causing unnecessary logical read and eventually captured it in profiler, however parameters @p3 and @p4 are not listed. Is anyone able ...
1
vote
3answers
37 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 ...
0
votes
0answers
53 views

A rollback on a production server that's been running too long

I have a problem with a production server that is causing considerable locking and performance degradation. It all started the night of Tuesday into Wednesday with a procedure that inserts data into ...
1
vote
0answers
40 views

Using #temp to work around Reporting Services blocking issue

Having utterly failed to resolve why a perfectly acceptable but admitidly large stored procedure was suffering the blocking process lck_m_s when called via a report in SQL Reporting Services I have ...
0
votes
1answer
20 views

SQL Server Permission [duplicate]

I installed SQL Server, I deleted my windows user account, now I'm trying to access SQL Server using administrator account but it could not connect. It throws error like this The database TEST is ...