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).
0
votes
0answers
14 views
Help with MSSQL Code that Repeats data on return
SELECT
e1.patientid,
DxCodes = STUFF(REPLACE(CAST([XML].query('for $a in /a return xs:string($a)') AS VARCHAR(MAX)), ' |', '|'), 1, 1, '')
FROM (
SELECT
e.patientid
FROM ...
0
votes
2answers
22 views
Creating tables with inheritance
I'm fairly new to SQL. I just wanted to create a database from scratch to learn.
So I have a table called Addresses and I want to create two tables dependent on it that are Country and State, Im not ...
0
votes
1answer
21 views
Breaking changes between 2008R2 RTM going to 2008R2 SP3?
I have a few A/P FCIs running 2008R2 RTM, and I'd like to upgrade the passive node to SP3, fail over, and then upgrade the formerly passive node.
Has anyone else attempted this? Are there breaking ...
0
votes
1answer
17 views
View permission to SQL Server logs on SSMS GUI
I would like to give a user see SQL Server logs from GUI, not through xp_readerrorlog. I was just wondering if this was possible?
Thank you.
0
votes
2answers
34 views
How to load multiple values in cell from Excel to SQL Server many to many table
I have values in excel like this.
StudentNumber| Subjects
1| english, science, maths 2| maths, biology 3| history, zoology
I have Student table in database ...
2
votes
2answers
79 views
Change Data Types large Live table
I have a table in SQL Server 2008 R2 with close to a billion rows with Composit PK Column. I want to change the Datatype of Columns from Date to Datetime. Two times ALTER TABLE zzz ALTER COLUMN yyy ...
0
votes
0answers
29 views
How to fix deadlock caused by “X” locks on same resource?
I have the following <resource-list>:
<resource-list>
<keylock hobtid="72058301601677312" dbid="7" objectname="myDatabase.dbo.TableOne" indexname="PK_TableOne" id="lock2c336fb380" ...
0
votes
2answers
33 views
Solution on a complex sub select query MSSQL
I created an sql query that requires me to pull data from 2 separate databases, and I noticed that what I did is this:
Select *,
(Select Z.f From DatabaseZ.TblZ Z where Z.w = A.w) as valueZA,
(Select ...
1
vote
1answer
28 views
Script Table Definition in Powershell
I'm writing a powershell to create a duplicate table(in another schema) for the purposes of partition switching*. I'm having problems adding the columns and the clustered column store index.
Here's ...
0
votes
1answer
48 views
How vulnerable is SQL Server 2000?
I know there are still some SQL Server 2000 installs that exist out there. With Microsoft no longer supporting these versions, how can I check to see what vulnerabilities remain unpatched?
This ...
0
votes
1answer
19 views
query to pull one row per id when multiple rows of each id exist in table
I have a table holding email addresses where some people have more than one email address listed. I want to query the table to only pull a single email address per Individual.
Columns are:
ID
...
0
votes
0answers
27 views
CORP_*_Live_Login
when I am connecting using odbc with sql login connects fine.
I can log into server manager fine using the sql login.
When I use the same sql login from my app on the server local connection the login ...
0
votes
0answers
4 views
Microsoft.SqlServer.Configuration.Sco.ScoException: The specified driver is invalid
Trying to install SQL Server and I keep getting this error:
"Microsoft.SqlServer.Configuration.Sco.ScoException: The specified
driver is invalid."
Any ideas where to start troubleshooting?
2
votes
1answer
26 views
Copy database wizard-generated job blows up log file; alternative?
I've recently upgraded our deployment environment to include a staging server. Said server has a database on the same server as our production database. I am trying to set it up to copy data from the ...
0
votes
2answers
60 views
Is it good idea to repair sql file?
We are having an ETL process which inserts lots of data into tables. This database is set to Simple Recovery Model and the transaction log is growing a lot. I was thinking that would it help to set ...
0
votes
1answer
32 views
SQL Server Developer Edition Downgrading to Older Developer Edition
I have seen answers for questions regarding downgrading from different editions (e.g. - Enterprise to Standard), but is anyone familiar with downgrade policies for SQL Server Developer editions to ...
1
vote
1answer
33 views
What happens if an index build is cut half way through?
Today I ran a create NC index but stopped the execution after running for 1 hour 46 minutes. The main reason being I started to get worried about the disk space getting lower. It consumed roughly 10 ...
0
votes
2answers
33 views
Error in attaching mdf file from a crashed server to a new server
One of our server hosting an important Database crashes.
The sysadmin team could only access the files by erasing the password with a tool and then log in to access the MDF files.
I Copied the data ...
0
votes
1answer
38 views
what are the events recorded in the transaction log?
in regards to what events are recorded in the transaction log , is the below an accurate/comprehensive list?
How are things recorded? are the pages that are marked as modified written to the ...
2
votes
2answers
66 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
0answers
54 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
142 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
2answers
290 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
21 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
2answers
49 views
Why is cost threshold for parallelism ignored?
SQLServer 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
21 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
26 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
17 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
40 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. ...
4
votes
2answers
50 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
40 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
25 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 ...
0
votes
0answers
27 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 ...
0
votes
0answers
43 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
36 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
27 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
17 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
71 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
45 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
14 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
44 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
45 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
19 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
8 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
91 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
56 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
54 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
24 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 ...