Tagged Questions

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)

2
votes
2answers
72 views

What is difference between is_unique column and is_unique_constraint columns in sys.indexes

We have two columns is_unique and is_unique_constraint for unique constraints in sys.indexes and I want to clarify few concepts based on these two columns Create statement for both types of ...
0
votes
1answer
77 views

please help in query

Please help me in query to get data from two tables TruckLoad and TruckUnload having same data but readtime will be different. I want to get data like this, please find script for tables here
4
votes
2answers
170 views

How can I reliably determine if a given SQL Server instance has the “Lock Pages in Memory” right?

The "Lock Pages in Memory" right can be granted to the service account used by SQL Server. This allows SQL Server to prevent memory being paged to disk. I've noticed several of our SQL Server ...
1
vote
3answers
313 views

Purpose of Data Warehousing?

I have been reading up on Data Warehousing and its purpose. The main purpose seems to be to track historical data and whatever changes may have occurred over time. The DW book I am reading gives a ...
0
votes
0answers
25 views

Crazy SSRS Issue

We are working a data center migration and are to the SSRS boxes and I am having trouble. SSRS is installed on a server alone pointing to the ReportServer and ReportServerTempDB on a different SQL ...
2
votes
3answers
99 views

Why is cost threshold for parallelism ignored?

SQL Server 2012 SP2 Enterprise Edition. Users complaining of slowness. Monitoring tool shows highest wait event is CXPACKET. Instance settings MAXDOP: 8 Cost Threshold for Parallelism: 175 Ran ...
0
votes
0answers
42 views

Linked Server Security under SQL Agent Job Context

I have two SQL servers V1 and V2. Both 2012. V1 has linked server connection to V2. There are two Windows accounts: one running SQL server, the other running the Agent service. The two accounts are ...
0
votes
1answer
63 views

Stored procedure to compare two columns from different tables and make the insert

I have two tables: Project with fields fld_id (integer), fld_allocated_hours (integer), fld_project_id (integer) Timesheet with columns fld_id (integer), fld_allocated_time (integer), ...
1
vote
1answer
22 views

SQL Server 2008R2 - Replication - Log Files / Indexes

We have 4 SQL Servers engaged in Transactional Peer to Peer Replication. I am doing some work on the Indexes and have noticed 2 things I didn't expect: The Indexes have different fragmentation ...
0
votes
1answer
46 views

creating a multi table “identity” column (faux identity)

I am currently designing a job execution engine and have run into a problem I am looking for some advice on. I am converting some processes to a new system and need to define the table structure. ...
5
votes
3answers
107 views

Has the guidance on the setting for 'cost threshold for parallelism' changed with the advent of columnstore indexes?

First off, what I'm not asking. I'm not asking what my setting should be. Many are recommending upping the value past the default, and I certainly understand why that's the case for B-Tree based ...
0
votes
1answer
46 views

Removing some English token words (such as “are” or “or” etc.) from the system stoplist of full text search?

One of our table has full text catalog on it. It contains some data in a language other than English which makes some words such as "are", "or" useful. There is no stop list defined but these words ...
0
votes
0answers
29 views

Full text catalog missing a keyword

We have a full text catalog on one of our databases but one keyword does not work. e.g: select * from table where name = 'jon' -- result set returns as expected select * from table where ...
1
vote
1answer
87 views

routine to backup ssas databases fails with: The XML for Analysis request timed out before it was completed

I have developed my own stored procedure, that through a LINKED SERVER, backups the SSAS databases according to a table value parameter. the code for the stored procedure is below. the problem: it ...
1
vote
0answers
39 views

What is the RecoveryUnitID in DBCC LOGINFO

In SQL Server 2012, MSFT added a new column to the output of DBCC LOGINFO, called RecoveryUnitID. I know that this DBCC command is undocumented, but I am surprised that I can't find it anywhere what ...
1
vote
1answer
61 views

SQL Server Query performance with window function

We write a query that include unpivot, partition by and order by.Query is: SELECT PersonId ,SalaryDate ,ID ,Type ,SalaryValue ,ROW_NUMBER() OVER ( PARTITION BY PersonId ...
0
votes
0answers
44 views

Log not truncating due to xpt_checkpoint

I have a DB on a SQL Server 2014 instance. I have a memory-optimized filegroup, but as yet, no memory optimized tables. I also have a FILESTREAM filegroup, which contains 1 FILETABLE and a Primary ...
1
vote
1answer
34 views

Sql Server Agent is part of the sysadmin role even tough Sql Server says it's not

I created a Windows account with no extra rights other than domain user and set it as the SQL Server Agent service account with the SQL Server Configuration Manager. The BoL/MSDN says that this user ...
0
votes
1answer
22 views

Query execution involving two servers in SQL server , is really slow

I am running the following query , and it takes over 1 hour to finish execution. As there are so many joins and then one union is involved, is it normal for this query to be executed in 1 hour, or is ...
0
votes
1answer
14 views

sp_helpdb — returns nothing, because db is restoring (log shipping target) SQL Server

How can I see where the db files live, etc? e.g. sp_helpdb output when sp_helpdb itself won't give results because db is in restoring state. This is SQL Server 2014
4
votes
0answers
98 views

Trace Flag 1222 Not Working?

I have a customer site with two similarly configured 2008r2 SQL Servers "A" and "C". On both servers the trace flags 1204 and 1222 are enabled and DBCC tracestatus shows the following on both ...
1
vote
1answer
47 views

How to sort rows to appear alternatively (e.g. A B A B … )?

Suppose I have a column x with values A and B. For example, Row X 1 A 2 A 3 A 4 B 5 B 6 B Now, I want to sort them into this fashion: Row X 1 A 2 B 3 A 4 B 5 A 6 B Of ...
0
votes
0answers
35 views

SSIS package error, can't find pre-compiled script

I'm working with an SSIS package (Visual Studio and BIDS/SQL Server 2005 SP3) and out of the blue my script tasks have started failing to compile. The actual error message: Validation error. ...
1
vote
2answers
52 views

Managing logins with Availabilty Groups

I have created a user on my primary node that has access to all of the databases in Availability Group AG1. How do I ensure that same user has the same rights on all the other replicas in AG1? ...
0
votes
2answers
52 views

Signal wait always high

I'm not sure if this is the right place to ask this question, so apologies in advance if not. Problem I'm facing is: One of my server's signal wait floats at around %35 and won't go down. Top 3 ...
0
votes
1answer
28 views

SSRS Domain Migration

My company is currently going through a data center migration. We are now down to the SQL Servers and this includes SSRS. The bad thing that is going to hit us is the current SSRS server is being ...
0
votes
0answers
14 views

How can I deploy a composite data tier application (DACPAC) from Managment Studio?

I have SQL Server Managment Studio 2014 installed and want to use it to Deploy a Data-tier application (dacpac) via the GUI. My database solution consists of two .dacpac files, where one package ...
0
votes
2answers
106 views

Error Grouping By Multiple Columns using CASE

Is it possible to group by multiple columns in a CASE statement? I get error "Incorrect syntax near ','." in below code... SELECT CASE WHEN Type = 'Test' THEN Description ELSE ...
0
votes
1answer
60 views

Return rows one at a time from variable table

I have a database which contains job numbers, each job has a list of invoices and a list of journals. Its an IRQ request accounting system. In order to see which jobs have a zero balance I'm ...
0
votes
2answers
67 views

Grouping data by MONTH on DATETIME column in SQL Server

I have a table Employee which has the columns Id, Date of joining and Name Date of joining is a DATETIME column. I want to know how many users have joined in the month of October?
0
votes
0answers
26 views

mirroring on sql server 2012 on different windows server 2012

I have 2 servers *.203 and *.205 I have sql server 2012 on each of them I tried to make mirroring between them every thing goes successfuly but when I tried to start mirroring it gives me ...
1
vote
0answers
47 views

SQL Server Comparison

I am merging two different versions of a database. I want to add some specific fields from source database to destination, so I used Visual Studio to do that. It does the job quite well but only table ...
1
vote
1answer
44 views

Refactoring sql for tables with similar columns but different table names

I have the task of re-factoring a SQL script that performs a lot of unions from different tables. These tables have similar information, so the script queries the same columns as in each table, except ...
0
votes
1answer
40 views

12 hour format time in SQL datatype

I can convert time datatype to 12 hour format using convert etc. But is there any option to save the time in 12 hour format in SQL tables using any settings or property or any other methods?
1
vote
1answer
33 views

Cancelling / Stopping ALTER INDEX REORGANIZE

ALTER INDEX [myIndex] ON [dbo].[myTable] REORGANIZE WITH ( LOB_COMPACTION = ON ) I have the above query running for 16 days (still running), the table is a dummy table used for benchmark tests, it ...
2
votes
2answers
56 views

Strategies for “checking out” records for processing

I'm not sure if there is a named pattern for this, or if there isn't because it's a terrible idea. But I need my service to operate in an active/active load balanced environment. This is the ...
-1
votes
1answer
45 views

SQL Server 2008 Trigger

New to triggers. I have two tables. One for users & other for circulated mails. The circulated mails table has [Sender, Receiver...] users table has [Personal Number, Names, Email]. when we have ...
0
votes
0answers
23 views

sql server snapshot replication compatibility issue

I have 2 SQL Server 2008 R2 and I am trying to set up Snapshot Replication over the Internet. I have successfully managed to get the subscriber to connect, but now as the Job executes on the ...
0
votes
1answer
55 views

Is there a way to force one optimization level in SQL Server?

Based on Paul White's blog, there are three optimization phases in SQL Server, search 0(Transaction Processing), search 1(quick plan) and search 2(full optimization). Each phase has entry and ...
2
votes
1answer
144 views

Difference in space used

When reviewing the space used by datafiles in SQL Server, there is a large difference betweens what SQL reports and Windows. How can this be explained?
1
vote
1answer
39 views

Can I create a database on a local folder mapped as a drive

I have mapped a local folder as a drive, as follows: subst E: c:\MyFolder I need to create a database on that drive, but it fails: CREATE DATABASE MyDb ...
0
votes
1answer
6 views

MSSQL 2000 replication, incrementing an integer column on a single row using an update statement

I have 2 web servers, both of which connect to separate mssql 2000 database servers, these two servers use merge replication in order to collate tracking data. Now each web server runs an update ...
0
votes
1answer
104 views

SSIS OLE DB Error on package execution

Good day, I have an SSIS package that runs on scheduled job for a while now. all was okay, until very recently, i started receiving some failed job executions. When I investigated it, I found the ...
3
votes
3answers
138 views

Keeping default max memory 2147483647 MB value in SQL Server, a bad practice?

Based on that msdn page : server memory settings it's a good practice to keep the default values for SQL-Servers min and max memory to keep it dynamic... From what I learned through tutorials you ...
0
votes
2answers
99 views

Best way to get the most recent insert from a table (SQL Server)

I have an app (which I have no control of) that writes the status (success or failed) of the file transaction to tableA in a DB on SQL Server 2008. I basically want to grab the most recent insert in ...
1
vote
1answer
35 views

How can client retrieve SQL Server pubic SSL certificate?

Can a user retrieve the connection certificate for an SQL Server instance (similar to how someone can retrieve an HTTP certificate)? If so, how? Context If encryption is requested by the SQL Server ...
2
votes
2answers
80 views

Good way to restructure a table

I have a number of tables in an existing database that i would like to migrate to a new database but with a little different structure. For example if a current table has columns like below: table1 ...
-3
votes
1answer
45 views

How to limit the buffer pool in Microsoft SQL Server 2014

How do I limit the buffer pool in Microsoft SQL Server 2014?
0
votes
3answers
72 views

Database Design for Paper Submission System

I am learner of Database design, I want to design a database for a journal paper submission system in which one paper can be submitted by one or more author. I have initially two tables Author and ...
1
vote
2answers
91 views

SQL Server 2008 R2 – Track Database Growth (Production Database)

My requirement is to get the database size information collected daily, I did not find any option to get database growth over a period of time. Someone please advise what the correct method for this ...