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)

3
votes
1answer
32 views

SQL Server - monitor changes on linked server

We have a local SQL Server database which we have full control over, and in this local server we are linking a remote SQL Server database, to which we have only read access (no schema changes, no ...
0
votes
2answers
45 views

Finding the longest entries for a given column (nvarchar(100))

I am trying to find the biggest / longest entries of a column which is of type nvarchar(100). I need to understand if I can maybe restrict that column to be only nvarchar(20) or something. Is there a ...
1
vote
1answer
24 views

Category entity relationship / subtype relationships design

I am looking to implement a generic comment and file attachment facility within a web application which would be used across various parts and allow users to provide comments and add attachments to ...
0
votes
0answers
33 views

Versioning database tables

I need to store all the changes made for almost every table in a meta-data database. I am thinking about storing every previous version in a JSON array or XML in the table. Like: CREATE TABLE ...
2
votes
2answers
42 views

How to identify database users and their owned schemas before dropping server logins?

While deleting logins, there might be a possibility that there are users in databases along with chances that they own schemas in those databases. Is there a way to find this out with a single ...
1
vote
1answer
16 views

FIPS 140-2 Compliance

Just wondering if anyone has configured FIPS? Based on the information I found in the Microsoft support pages, it would seem FIPS is configured at the Windows level only and that all instances on my ...
1
vote
2answers
58 views

SQL Server : Tracking a slow running query on completion

Am trying to work on script for slow-running queries. I understand that we can get the list of slow running queries using sys.dm_exec_requests. Say, I have a query Q1 which is running very slow, say, ...
0
votes
1answer
49 views

Breaking up long running query into batches runs fine for a while and then produces fatal error

I'm using a variation of this post which details using "careful batching" to delete records in batches from a table that contains 38MM records. The script below runs for a while and shows results ...
2
votes
1answer
23 views

Duration measure in fact table

I have a fact table with the user reservations with StartDate and EndDate. I am thinking what is the proper way of serving the duration queries in the reports. Should I calculate DurationDays and ...
2
votes
3answers
61 views

updating the entire column with datetime values based on other values in the row

I have a very large table [server].[dbo].[MyTable] where I need the SQL statement to fill the column 'ToDateTime' (currently full of NULLs) according to the following logic: Only add a value to ...
5
votes
2answers
136 views

SQL Server compatibility with New TLS Standards

The major browsers are moving beyond SSL3.0 and TLS1.0 . The PCI Security Council has declared an end-of-life date for these protocols to be considered sufficiently strong encryption. We need to ...
3
votes
1answer
30 views

Guidelines for full-text index maintenance

What guidelines should be considered for maintaining full-text indexes? Should I REBUILD or REORGANIZE the full-text catalog (see BOL)? What is a reasonable maintenance cadence? What heuristics ...
1
vote
1answer
39 views

Performance improvement on SQL query joining table on itself

I'm running this query on a table with approximately 20MM records in it. It's a very slow query, and I'm wondering if there's a better way to accomplish this that might run faster ? delete previous ...
3
votes
2answers
69 views

Does SQL Server prioritize select and update statements?

Assume that SQL Server received both select and update statements to the same table at the same time Do any of them get prioritized? I know that select statements are delayed until update completed. ...
1
vote
1answer
28 views

Do Triggers in the Active Secondary Database of an AlwaysOn Group Execute?

If I have triggers on tables in a database that is a member of an AlwaysOn group, will they fire on the secondary? If they do fire, and they do something different on the secondary will it matter as ...
0
votes
1answer
21 views

SQL Server 2012 - sp_executesql multiple parameter error

I am receiving an error when attempting to execute the following code that builds a dynamic string to be executed by sp_executesql. DECLARE @paramDefinition NVARCHAR(500); DECLARE @ID1 NVARCHAR(20); ...
1
vote
3answers
58 views

SSIS: How to check if a record DOESN'T exist in flat file but exists on the database

I am working on preparing an SSIS job where I am importing a .CVSV file to OLE DB destination (sql database). We are going to get these files on daily basis. The .CSV file contains records of doctors. ...
0
votes
1answer
42 views

How to configure SQL Server Port on multiple instances?

I have a server called SQLDWDEV01, with 2 instances: default and UAT. To the default instance that uses port 1433, everything works fine. However, the UAT instace, which I configured according to ...
0
votes
0answers
17 views

Converting Legacy SQL Server 2005 Stored Procedure to Transaction based for parallelism [closed]

My task is to convert a legacy stored procedure written in SQL Server 2005 so that it can be used in parallel (multiple executions from different users). As of now the stored procedure is designed ...
-3
votes
1answer
36 views

Microsoft Sql Server online [closed]

I am having a Sql Server Standard Version on my PC. I would like to make this Sql Server available over the internet with/without VPN. Please suggest me how is that possible. Thanks Kalyan
0
votes
0answers
14 views

Auto Increment Sequence Broken After Applying a Key [duplicate]

After SQL Server 2012 Enterprise edition's evaluation period expired, I applied another key using the edition upgrade wizard. After it was successfully done, all Auto-Increment columns started ...
3
votes
3answers
83 views

Restoring and upgrading multiple databases

I have a SQL Server 2005 instance on my PROD server. I have been given a task to migrate databases from that instance to a different box (SQL Server 2008 R2 on Windows 2008 R2). The current instance ...
-1
votes
0answers
15 views

Unable to connect to [PC-NAME]\Instance in SQL

I'm installing a new SQL instance together with an application I'm running on Windows Desktop. The name of the instance is "MyAppSQL". After some attempts, I managed to get it able to connect (using ...
2
votes
0answers
29 views

Can data streams from Informatica to SQL Server be multi-threaded?

Suppose we have a database server, with SQL Server on it. And we are moving data from another database server, through our Informatica server, and onto that SQL Server database server. And our SQL ...
6
votes
1answer
113 views

Several Questions about SGAM & GAM & IAM & PFS in SQL Server

Have several questions about internal structure of SQL Server. Lets assume that we have a table in a database. SGAM & GAM pages keep track of shared & uniform extents within a single ...
0
votes
0answers
11 views

Reset default value for many foreign keys in SQL Server

I need to reset the foreign keys default values to null for a big database by using some sql queries. My research in the stackoverflow website got me to drop the existing default values contraints and ...
6
votes
1answer
95 views

Log shipping large DBs - what about the log?

I'm currently setting up log shipping of a large DB (Approx 1.5TB) and am wondering what I can do about the log file. As it stands, I want to do the following steps: Change DB to FULL recovery ...
2
votes
1answer
27 views

TDE restored DB encryption state

I've been looking into using TDE in our SQL Server 2014 environment and have a few questions. I think I have a fairly solid grasp on the numerous "how-to's" that are out there on initially ...
0
votes
2answers
39 views

How to add deleted user in sql server? [duplicate]

I have set up sql server 2008 in windows server 2008 r2 and it works fine. However, I have deleted the my user from logins in the sql server accidentally and now I cannot find a way to log in to the ...
0
votes
0answers
28 views

Looking for feedback on a design for a simple task manager

I've got tired of using notepad / excel to manage my tasks at work. Since tasks may sometimes contain sensitive data, my boss will not allow us to use an online task management system, so I've decided ...
0
votes
1answer
28 views

Can SQL Server 2014 schema be defined using ODBC?

I am trying to use the ODBC driver for SQL Server 2014 to export data from an Autodesk Revit 2015 model to a database. However, I would like to export to a default database (e.g. db1), creating a new ...
2
votes
0answers
16 views

Deny BACKUP CERTIFICATE

In SQL Server, there are three database roles that have CONTROL certificate permissions. Those are db_owner, db_DDLadmin and db_securityadmin. Also, the documentation for decryptbycert specifies ...
0
votes
1answer
36 views

Cache statistic data in SQL Server

Currently my team develop additional web app to let customers analyze user statistics to theirs portals. So we have a table with all logins. It contains about 100 millions of rows. One user could ...
0
votes
1answer
30 views

SQL Server 2008 Triggers and Merge Replication

I am trying to have a trigger fire when the Merge agent inserts or deletes data into / from a table. It is supposed to insert data into a report table for use with SSRS. I DO NOT have the "NOT FOR ...
-3
votes
0answers
22 views

what is other way of use Limit function in MSSQL server [migrated]

How to use LIMIT function in SQL Server. I need to create a pagination using SQL Server data and I need to fetch the data using $start and $pagesize. This is the query used: SELECT * FROM ...
-6
votes
2answers
55 views

bring the output into single column from a table as vertical order [closed]

Name Age Type City Tom 20 life null tim null motor UK john 55 null USA I need Output as Tom 20 life Tim motor UK John 55 USA
3
votes
1answer
121 views

How to get the daily amount of committed transactions on a given MSSQL database?

The number of transactions for the current connection can be obtained with @@TRANCOUNT. How can you get a daily counter of the globally committed transactions on a given database?
0
votes
0answers
27 views

What options exist for replicating SQL Server over the public internet

Specifically, I'd like to set up a reporting copy of a SQL Server 2012 transactional database. This primary runs in a managed services provider, and I want a copy in an AWS EC2 SQL Server instance. ...
1
vote
1answer
38 views

Cannot connect to SQL Server database regardless of connection string

I'm having a tough time to connect to a local SQL Server instance within a C# app. I can connect to external databases on other servers, but I need to be able to use my own local database. The ...
0
votes
2answers
26 views

Help writing query for MS SQL Server [closed]

I need to write a MS SQL Server query statement that will generate the result set table name SUMMARY from the DETAIL table Server name: Development Database name: Test DETAIL ...
0
votes
1answer
19 views

“Unresolved reference to User” after importing as a VS DB project

I just imported an existing SQL Server 2008r2 production database into a VS 2013 database project. I now get a number of errors along the lines of Error SQL71501: User: [mydbuser] has an ...
0
votes
0answers
42 views

Linked Server Query Failures Due To Indexes

We are trying to query a 2008R2 database (ServerA) from 2012 (ServerB) using a linked server on ServerB that has security setup to use a SYSADMIN SQL Server Login on ServerA. Example: When I run the ...
2
votes
1answer
11 views

SQL Server Replication across firewall

We would like to set up replication between two SQL Server 2012 instances. Server "Internal" can see and make connections to server "External". External is completely firewalled from the internal ...
0
votes
1answer
31 views

How user options works at SQL Server?

I'm searching one way to set ARITHABORT ON for all opened connections, and I found this question. Some answers says to run the following command, and it really works: EXEC sys.sp_configure N'user ...
11
votes
3answers
966 views

Is a weekly rebuild of indexes a good idea? [duplicate]

We had a SQL expert suggest rebuilding our table indexes weekly. We're currently doing this Saturday night and it causes lots of timeouts during the rebuild process. I'd like to avoid the timeouts ...
0
votes
1answer
29 views

Need to make sense of FileTable permissions

I'm setting up a FileTable to allow users to quickly stuff some PDF report files into a database for later searching via an intranet application (to be built later). Sorting out the necessary ...
1
vote
2answers
182 views

What is the best way to purge data from a table with minimum damage to performance?

When you purge records from a database table, deleting them, you have impact on the logical and physical structure of the target table, as well as indexes and statistics. What maintenance should be ...
5
votes
2answers
111 views

How do I merge similar records with different validity dates?

The table I am working on has three components: An ID column (primary key in another table) Some data columns Date valid from/to columns. Values: ID Data From To 1 a ...
3
votes
2answers
36 views

Trace to find “error messages”( SQL Server 2008 R2 )

I'm using this config, trying to find error when a certain host executes a task ( it runs inside a software ): The user says that the software is running, but it's not updating what it needs to ...
1
vote
0answers
16 views

Why do async_network_io wait types occur?

Last week something strange happened on our database. All of a suddon, the application blocked for our users which were not able to save new entities etc. After looking at the Activity Monitor of the ...