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)

1
vote
1answer
14 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
57 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
21 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
32 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
32 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
37 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
256 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
303 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
34 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
170 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
263 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
27 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
91 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
28 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
74 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 ...
2
votes
1answer
39 views

Capturing sp_executesql statement in sql profiler

After catching some data in a SQL Profiler session, I can almost always see a second entry of type RPC:Completed for each query using a sp_executesql statement. I know that this is done to create ...
3
votes
1answer
85 views

ASP.NET & SQL Server 2012 timeouts once a month

We have an intranet site which works fine, except one day a month. There are slow queries, unoptimized tables, tables with ~8 million records, etc. but daily usage is fine, although some ...
0
votes
1answer
29 views

How to send an email with embedded values

I need to do a stored procedure that sends an email when a value reaches 100 with this wording in the body: "100 daily file downloaded from the user:USERID" where USERID is the user that reached 100. ...
4
votes
2answers
229 views

How to extract pipe-delimited data using BCP?

I tried the following command USE <DBNAME> SELECT 'exec master..xp_cmdshell' + ' ''' + 'bcp' + ' ' + TABLE_CATALOG + '.' + TABLE_SCHEMA + '.' + TABLE_NAME + ' out' + ' D:\' + TABLE_NAME + ...
2
votes
1answer
22 views

Problem with “not” in full text search

I don't understand why I'm getting these results with my full-text search query in SQL Server 2014. The following query returns results with "Supervisor" in the Title field and "Tokyo" in the ...
14
votes
1answer
102 views

User-shared queries: Dynamic SQL vs. SQLCMD

I have to refactor and document a number of foo.sql queries which will be shared by a team of DB tech support (for customer configurations and things like that). There are types of tickets that come ...
9
votes
3answers
750 views

How to answer why suddenly we need indexes or query needs to be changed

I am junior dba with 3 years of experience. Our job is to fine-tune queries or advise developers that particular code should be re-written or indexes are needed. One simple question the dev team asks ...
2
votes
0answers
29 views

Connecting to SQL Server using PHP, ODBC, and Windows authentication [migrated]

I'm trying to use PHP to connect to an ODBC data source using Windows authentication. I can connect just fine to the server in SQL Server so I know it's running. When I try to run the command ...
4
votes
2answers
96 views

Reducing impact of SUM(DATALENGTH()) over linked server

I have a query that reports back to me how much time elapsed for records to be added. I also in this query track the size of an image that was added to the database. From what I can see it looks like ...
3
votes
1answer
23 views

Error 7399 when the Access file has a password

I'm trying to create a linked server to access an old MS Access database (.mdb file) on SQL Server 2012, but I always get the error 7399 (authentication denied). So I tested with another mdb file that ...
2
votes
1answer
50 views

Index is seeked and scanned - is there a risk for seek to fail after modification?

I have an index that has been seeked 230.000 times and scanned 130.000 times. In order to improve the queries that have scanned, because they use an additional column I guess, I would like to change ...
6
votes
1answer
552 views

Dropping a large table

On our production db there is a table 180 GB, around 2 millions records, I want to re-create it as a new empty table in a new filegroup and delete the existing table. What is the best practice to ...
2
votes
1answer
66 views

How do i reverse this SQL Query Script, I am trying to remove filestream from my SQL 2014 Server

I am trying to remove filestream from my database, so I have to do the following I would like to know how to remove the following: ALTER TABLE AMGR_Documents_Tbl ADD UId uniqueidentifier ROWGUIDCOL ...
1
vote
1answer
27 views

SQL Server: modify data file size and shrink

When I try to modify the Database File Size, it shows this error. Specified size is less than or equal to current size I tried this query: Alter database [dbname] modify file ( ...