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
0answers
44 views

SQL Server 2014 - Query output

To be clear: I want to use the result of first query in the second query. Below are the two queries: Query 1 select files.originalfilename from files inner join digitalfiles on files.fileid ...
0
votes
1answer
26 views

Create a SQL Server Redirect (Alias / Linked Server)

I currently have a database on a named SQL server instance called \Mobius and database name of Mobius We need to move the database to the default (parent) instance but don't necessarily want to ...
1
vote
1answer
32 views

can i shrink log file in full recovery model

i have configured Always on Availability group where iam unable to shrink log file size through simple recovery model. can i shrink the log file size in full recovery model if yes or possible then is ...
3
votes
0answers
51 views

SQL DatabaseMail smtp error 5.7.57 at one site, email works at another with the same details

I have several SQL databases on different servers. I have used a script to set up Database mail. EXECUTE msdb.dbo.sysmail_add_account_sp @account_name = 'Emailer' ,@description = 'Email out ...
4
votes
2answers
98 views

How to avoid a “duplicate key” error?

This statement: INSERT INTO deleteme SELECT #t.id, 'test' FROM #t LEFT JOIN deleteme ON deleteme.id = #t.id WHERE deleteme.id IS NULL; ...will fail with a primary key violation in the concurrent ...
1
vote
1answer
37 views

Unable to Watch Live Data on Extended Events Session

I am running SQL Server 2014 Developer Edition on my PC. I am trying to view the data in the system_health session. In SSMS, I have connected to the database, expanded the server / Management / ...
0
votes
0answers
18 views

Error While restoring backup in SSMS

When I tried to restore a backup an error occurred showing access denied. The error message is as follows: Restore failed for Server 'VAIO\sqlexpress'. (Microsoft.SqlServer.SmoExtended) ...
2
votes
1answer
17 views

Returning XML Value for Extended Event

I would like to get the filepath for my extended event event_file and put it inside a variable but I'm stuck. Here's what I have: DECLARE @ExpensiveXML XML SET @ExpensiveXML = (SELECT ...
0
votes
1answer
37 views

Select tree-based structure

I have a table in my SQL Server database with data like this: ID ParentID --- --------- 1 NULL 2 1 3 1 5 1 5 4 5 6 8 6 7 9 9 10 I need a select statement that will return all the ...
3
votes
1answer
53 views

Fractional Transaction Count [closed]

Based on this question I understand the meaning of the following sorts of errors: Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, ...
7
votes
3answers
279 views

Index tuning question

I am tuning some indexes and seeing some issues would like to take your advice On 1 table there are 3 indexes dbo.Address.IX_Address_ProfileId [1 KEY] ProfileId {int 4} Reads: 0 Writes:10,519 ...
0
votes
0answers
23 views

Send trigger email when someone connects to a database

How do I set up a trigger or alert so that when anyone connects to a specific database, an email will get send with that user's login credentials?
0
votes
0answers
11 views

SQL Server 2008 R2 FREETEXTTABLE with FORMSOF(inflectional, string)

Can anyone confirm that using FORMSOF(inflectional, ...) is redundant when querying FREETEXTTABLE in SQL Server 2008 R2? Using FreeTextTable without formsof... gives me the same result list but with ...
0
votes
1answer
53 views

How to insert values through inner join

Could anybody tell me how to do insert statement with inner join. i am trying to insert ProductName,ProductCompany,ProductPrice,ProductQty in Product table and CategoryName in category Table. And ...
1
vote
1answer
15 views

Is it okay to clear SQL Server Buffer every weekend or month end?

We have started using SQL Server 2014 Enterprise edition on our new server having 32 gigs of RAM, and in less than 3 weeks the server process is accumulated 13 GB and plus of RAM. Including IIS ...
0
votes
1answer
49 views

SQL server 2014 Transaction Log Backup fails

I have setup a Maintenance Plan for my SQL server 2014 Database. This Plan Generates Full Backup every Sunday, and Differential backup every Day and Transaction Log every hour. This Maintenance plan ...
1
vote
1answer
58 views

SQL Server deprecated Functions effect

I'm using SQL Server in various versions. In case of this I'm using functions which got deprecated. My question is, how a deprecated function affects the usage of SQL Server? The functions are ...
2
votes
1answer
67 views

Single row update using primary key affects many rows

I'm doing a very simple datetime update in a table using its primary key: update TABLE set END_DATE = '2015-10-14 00:00:00' where ID = 1165027; I received the message (1 row(s) affected) 183 ...
0
votes
0answers
23 views

how to shrink database log file size where the database is in full recovery and configured for AOA

How can i shrink database log file where the database is in full recovery and configured for Always on Availability group and i am unable to change it to simple recovery model. Earlier i used to ...
0
votes
0answers
23 views

Can I use Data Quality Services for checking data integrity?

As Data Quality Services documentation seems too broad, could anyone tell me if the DQS is suitable for solving such issue: find if each row in one table has corresponding row in second table and if ...
3
votes
1answer
33 views

How to call modify() on a nodelist in T-SQL?

I have a process step where I have an XML document in a SQL Server column and I need to alter the text of a node that could occur multiple times. Modify() with 'replace' DML only operates on single ...
0
votes
0answers
24 views

Can you use SQL Server Development Edition for a website? [duplicate]

I've got a website I'm developing, and it's database driven. If I use SQL Server Development Edition as the back end, is that "legal"? I'll be the only developer using the software, but it will be ...
8
votes
3answers
159 views

zero-or-one to zero-or-one

How do I model zero-or-one to zero-or-one relationship in Sql Server the most natural way? There is a 'Hazard' table that lists hazards on a site. There is a 'Task' table for work that needs to be ...
2
votes
1answer
20 views

Selecting closest, non expired value [duplicate]

I'm trying to select multiple rows where the value is closest to the end date but not passed, and return only those rows. Here's a sample of some data: School Code | School Year | Semester | Term | ...
1
vote
1answer
44 views

SQL Server After Insert trigger does not perform actions

I have a problem with 2 After Insert triggers and 1 Instead Of Insert trigger. The After Insert triggers should perform some actions but that actions are not fired. When the Instead Of trigger ...
1
vote
1answer
21 views

Sql parent Child Query not working

I want to get parent and their child data which means, parents first, then children. Below is the query that I tried to convert to parent and their children SELECT a.FactorTitle, a.FactorCode, ...
0
votes
1answer
24 views

Pivot Results By Day [duplicate]

I have a table in SQL Server 2008, with mails received from a pop account. The table has the following columns: +------+----+---------+------+------+ | from | to | subject | body | date | ...
9
votes
1answer
99 views

Statistics disappear after incremental update

We have a large partitioned SQL Server database utilizing incremental statistics. All of the indexes are partitioned aligned. When we try to rebuild a partition online by partition all of the ...
2
votes
0answers
22 views

How to increase ETL performance in Informatica for Netezza as a source and SQL Server as a target?

What settings or configuration on the Informatica server, in the Informatica software itself, or on the database servers can be changed to increase Informatica ETL throughput? What are some ...
1
vote
1answer
35 views

How to audit all DML operations on a SQL Server 2008 R2 database

In order to assess options of implementing indexed views, I want to check the usage of DML operations of the tables. The database is new to me as well as the relevant business knowledge, so I just ...
0
votes
1answer
37 views

Connecting to the default instance of SQL Server connects to a named instance

I have 2 instances of SQL Server installed on one server: SQL002. One instance is a default instance, SQL2008 R2, and the SQL service is generally not running except for specific tests. The other ...
0
votes
0answers
34 views

SMO Not Scripting DB Objects

I have a PowerShell function included in the allusersallhost profile. It is basically scripting linked servers. When I execute the function from a PowerShell session, it scripts the linked server ...
0
votes
0answers
21 views

Query to get result in Excel file [duplicate]

The following query gives me the error Incorrect syntax near 'OUTPUT'. SELECT * FROM dbo.sales ; OUTPUT USING 'Driver=Microsoft Excel Driver (*.xls); DBQ=c:\\test\\sales.xls; READONLY=0' INTO ...
1
vote
2answers
38 views

Concatenate Columns in Stored Procedure [duplicate]

I have a stored procedure which returns a weekly result from input parameters start date and end date. I am getting multiple rows in the result. Requirement: I want to add the results of columns in a ...
6
votes
1answer
258 views

Cannot execute as the database principal because the principal “dbo” does not exist [duplicate]

I restored a backup of a database from SQL Server 2008 R2 to SQL Server 2012. When I try to access a particular page of my application, I get this error: Cannot execute as the database principal ...
3
votes
1answer
40 views

SSMS 2012 mutiple query windows using same session

I wonder if it is possible to connect multiple files or query windows in SSMS to one session? The reason is that I want to use local temporary tables that are created in one file/query-window in other ...
0
votes
1answer
33 views

SQL Azure Migration Wizard - Duplicate Primary Key

Just did a test at migrating a 120gb database onto RDS using SQL Azure Migration Wizard Because we can't afford any downtime for "just" a test we ran the tool on the live database (meaning data was ...
7
votes
3answers
314 views

Find the identity of the client firing a query in SQL Server without using triggers?

I'm currently using Change Data Capture (CDC) to track data changes, and I wish to track the host name and IP address of the client submitting the query that made the changes. If there are 5 different ...
0
votes
1answer
22 views

See SQL Server Reporting Services Reports without logging in?

I have installed SQL Server 2015 with SSRS and I have some reports I need to run, but in order to access http://reportsserver/Reports I need to start Internet Explorer in administrator mode. This is ...
-1
votes
1answer
35 views

SQL query is in “Execution” status and it keeps on running

I try to run a simple query in SQL 2102 select count(*) from cab_details , but it keeps on executing. If i restart the sql service , the result is shown in just one second. (Count is around 250,000 - ...
3
votes
2answers
53 views

Is is possible to recover a database from the 'raw' files (.mdf and .ldf) of the old server to a new SQL Server instance on a new server?

I have a client that has POS software called Restaurant Pro Express (RPE) from www.pcamerica.com. RPE uses a SQL Server database. Their old POS server had a hardware failure, but I was able to attach ...
15
votes
2answers
173 views

Does CPU utilization affect the cost of foreign NUMA access?

Scenario Let's assume I have a SQL Server with 4 sockets with each 1 NUMA node. Each socket has 4 physical cores. There is 512 GB of memory total so each NUMA node has 128 GB of RAM. A key table is ...
1
vote
2answers
282 views

SQL Server 2014 SP1 Setup Freezes Removing Temporary Files On Windows 10 x64

I want to install SQL Server 2014 Enterprise Edition with Service Pack 1 on Windows 10. But when I try, the installation stops every time at the part the screenshot below shows, and I wait for hours. ...
1
vote
0answers
28 views

Speed of Split Database vs ODBC with SQL Server vs ODBC with Azure Cloud

I would like to be able to host my data either in the cloud or in SQL Server, as having all my data in one Access file just doesn't seem the most secure to me (or am I wrong?). My forms contain many ...
-2
votes
2answers
93 views

Cannot find one or more components. Please reinstall the application

I am getting this error in Windows Server 2012 with Visual Studio 2012 installed trying to open SQL Server Management Studio 2012: Cannot find one or more components. Please reinstall the ...
1
vote
1answer
45 views

AlwaysOn Manual failback not working correctly

I've set up a small fail over cluster using AlwaysOn in SQL Server 2014 and Windows 2012R2. The cluster (SQL-CLUSTER-DEMO) just contains 2 SQL nodes (SQL-01 [Primary] & SQL-02 [Secondary]) and a ...
1
vote
0answers
29 views

Howto measure improvement after create and move new filegroups in SQL Server

How can one measure the (hopefully) positive effect of moving couples of indexes to a different finegroup, so to say seperate them from the data filegroup, and move this filegroup to another LUN in ...
5
votes
1answer
75 views

Detect if two time periods overlap

I have an HR system and I need to detect if a new leave (time off) request conflicts with an existing one. I have written code to do this based on the entire day; I now need to do the comparison based ...
0
votes
1answer
27 views

Referring system views and functions in production functions

I am using the following system objects in a stored procedure in order to build dynamic T-SQL statements: [sys].[objects] [sys].[parameters] [sys].[dm_exec_describe_first_result_set] [sys].[columns] ...
2
votes
1answer
21 views

Overwrite event - data from SQL Server to MySQL

In MySQL is it possible to execute an update query with values selected from external SQL Server database? I'd like to execute every night a timed query, which overwrites some data in MySQL with data ...