All versions of Microsoft SQL Server (not MySQL). Please also add a version-specific tag like sql-server-2016 if that is relevant to the question.

learn more… | top users | synonyms (2)

0
votes
1answer
50 views

Automate Backup of SQL Server Database Structure

I have a data warehouse which isn't huge only about 16Gb in a Microsoft SQL Server Standard Edition 2014 database. However, now that it forms part of our production system I don't like developing on ...
7
votes
2answers
4k views

Latin1_General_BIN performance impact when changing the database default collation

I have set the database collation to Latin1_General_BIN, to make string comparisons case-sensitive. Will this have an impact on performance? Will it have any impact on DML or DDL operations in the ...
1
vote
1answer
276 views

How to find out the account(s) under which the sql server is running?

I have just created a proxy and I need to grant access to the proxy to the account that runs the sql server agent. It will probably be a domain account. How can I find it using T-SQL?
-4
votes
1answer
44 views

Is it allowed to have " in sql server name? [closed]

Double quotes can be given in sql server name. Looking for answers
1
vote
2answers
90 views

Spotlight for SQL Server LockType explanation required

I have just started using Spotlight as I'm a software developer, but I am forced to identify database issues causing blocking (Spotlight shows me AWAITING_COMMAND at the points and all other processes ...
2
votes
2answers
46 views

Database - Resource usage statistics

I would like to find (using SQL DMVs) whether a database is actually in use and if so then how much of that servers resources it is taking. I need some ideas on how we can properly collect usage ...
3
votes
2answers
232 views

Queries on database migration

I have a SQL Server 2008 database of size around 1 TB. I want to migrate it to SQL Server 2012. I have few queries: To migrate, I will take full backup of 2008 and restore it on 2012. I want to know ...
2
votes
1answer
65 views

Microsoft TDE Permissions For Changing Keys

I am setting up roles as a layer of protection inside of MSSQL. One of the roles will only have the ability to change database encryption keys for TDE on the database server. The server will be using ...
1
vote
0answers
109 views

SQL Server 2012 memory issue [closed]

I am having performance issues on a Windows 2012 Server running SQL 2012. When I run the DBCC MEMORYSTATUS command I receive the following. Process/System Counts Value Available Physical Memory ...
0
votes
0answers
32 views

SQL Server 2012 memory issue [duplicate]

I am having performance issues on a Windows 2012 Server running SQL 2012. When I run the DBCC MEMORYSTATUS command I receive the following. ---------------------------------------------------------...
4
votes
1answer
50 views

Scripting Microsoft Data Warehouse Wizard

I am trying to automate the MDW setup process in my environment. Currently I have everything complete except for enabling the data collectors (usually uses a wizard as seen ). Has anyone seen or ...
1
vote
1answer
58 views

Sum currencies excluding duplicatied records

I have a CRMOffer table containing customerID and other CRMOffer data. And a Sell table containing customerID and sellValue and sellPK. Sell table has a explicit PK, CRMOffer sadly doesn't have one ...
7
votes
1answer
221 views

Ola Hallengren Index Script not Reindexing

First, I realize a similar question was asked and the poster had page count set to 1000 for a 679 page index; not what's going on. I have Ola's script set as @Databases nvarchar(max) ,@...
4
votes
1answer
42 views

Configure SSMS intellisense / web browser settings to accept UNC directory path inputs

I would like to navigate to open a directory path from an in-line commented UNC path. SSMS integrates with Windows Explorer and Explorer allows UNC navigation from the address bar. Indeed, when in ...
4
votes
1answer
165 views

Performance problems with TOP and user defined functions in views

I have problem with performance of queries on simple query on view. To keep things simple, assume my view is defined as follows: CREATE VIEW [mon].[ViewDevicesWithGroups] AS SELECT Id, Name, ...
4
votes
3answers
154 views

MS-SQL 2014 Log Shipping: Access permission question

Wonder if someone could provide some advice or point me in the right direction towards achieving the below objective please. Unfortunately I have not been very successful in finding a solution online. ...
8
votes
4answers
4k views

Is it possible to develop a SSIS with a SQL Server Evaluation Version

We are thinking about buying an SQL Standard Server for implementing an ETL via SSIS. Since it is very expensive for us I would like to test developing SSIS Packages on a free version. Since the ...
0
votes
1answer
1k views

SQL Server Management Studio backup not shown when restoring

I am trying to restore a database from a backup taken on another server. I am doing this by using SQL Server 2012 Management Studio. After I have taken the backup on server 1, I go on to select the ...
0
votes
2answers
65 views

Identical SQL Server databases hosted in the same physical DB server

We have hosted similar SQL Server 2014 databases TestDB and TESTDB_Copy on the same physical server. The two databases are almost the same and there may be minor differences in the number of records (...
1
vote
0answers
3k views

SQL Server does not exist or access denied" after installing SSMS

I recently installed SQL Server Management Studio (which also installed SQL Server 2016 to my local machine), and now am unable to connect to SQL Server from applications on my machine. It will come ...
1
vote
2answers
29 views

Dynamically changing an order number to end in _ERR

I'm trying to update multiple orders at once instead of doing them one at a time. Is there a way to dynamically update them all at once? For example: I have 5 orders ABC, BCD, CDE, DEF, EFG. I need ...
5
votes
1answer
52 views

TDE prep: key/certificate backup for restores

I am working in a dev environment to better understand TDE encryption. I have it working along with backups and restores on another server. Had a few questions, I know I need to backup the certificate ...
1
vote
1answer
266 views

Query to get yesterdays data only for a specific time interval

Here is my where condition which I use for daily data but I've got to change the date everyday. WHERE X.stage = 'Approval' AND X.T_ExitTime between '2015-08-06 06:00:00:000' and '2015-08-06 17:00:00:...
1
vote
1answer
56 views

Temporary permissions for DDL

I was hoping to use user impersonation to setup a user that has permissions to modify DDL, and only when I need to deploy DDL changes would I impersonate that user. This way I can use my windows ...
1
vote
0answers
66 views

AlwaysOn Availability Groups

We are looking at setting up SQL AlwaysOn availability groups in the following environment: we have two SQL 2014 Enterprise Servers on two different host Hyper-V 2012 servers. They each have ...
2
votes
1answer
938 views

Can't upgrade a SQL Express to SQL Standard

I have a 64 bit SQL Server 2008 Express R2 installed and I cannot upgrade it to a fully licensed 2014 Standard. When I try to update to SP 4, I get this issue: If I try to run the upgrade edition, ...
1
vote
1answer
128 views

use fulltext formsof inflectional to generate terms

Is there a way to use the FullText query components to generate the list of words in the FullText dictionary that are the inflectional formsof a word? This query would give me matches based on the ...
3
votes
2answers
341 views

Database Schema for Blank Database is large. 20MB

Is it normal for blank databases with just schema to be large? Or is there a way that I can reduce the size of the initial database?
0
votes
0answers
67 views

Tools to insert data faster in MySql database

I am trying to insert data from a flat file which is around 9 GB with about 15 million rows, I used SQl-server 2012 for that. I noticed data insert is much faster with sql server and it took around 30 ...
1
vote
0answers
17 views

Indexing AppFabric Monitoring Database

AppFabric is killing the page life expectancy and disk read metrics on my SQL Server. Does anyone know if I can add indexes to the AsStaging table or will that break things? There are some very ...
0
votes
1answer
149 views

Database structure for object with dynamic attributes

I am developing a proof of concept for a personalized email sending web application (like MailChimp, but with premade dynamic templates). The general structure is that I have my templates (different ...
-1
votes
2answers
43 views

error18470 when i try to connect to Database Engine

I am new in SQL Server. Wrongly I disabled my instance when I'd worked with Logins. Now I can not connect to Database Engine. Could you please help me?
1
vote
3answers
90 views

Sql Script takes much longer than estimated

In order to clean up a very large table holding binary Files in IMAGE Cols, I created the following sequence (based on this: Article) to get rid of a part of those image Blobs quickly: Select * into ...
0
votes
1answer
728 views

SQL Jobs Running - How to Kill

I ran the below query and it shows list of currently running jobs. However, in Activity Monitor none of these are running. How do I verify that these are/are not running? And how do I kill them? ...
1
vote
1answer
83 views

SQL get row based on condition [closed]

Hi all please see attached data below. I'm trying to get a row based on various conditions. scenario 1 - get highest row if no hours exist against it that has (setup + processtime > 0). scenario 2 ...
5
votes
2answers
152 views

Catch event of auto_shrink in SQL Server Log? [duplicate]

I am aware of the disadvantages of AUTO_SHRINK being configured on SQL Server databases. Recently, in a new environment, I discovered several production servers with the Auto Shrink option turned on. ...
1
vote
0answers
37 views

CDC and datamodel updates, best methodology?

We're about to start using CDC to track changes to a large number of tables in our db's. But since our datamodel is rather frequently updated, I'm wondering what is the best method for easily keeping ...
0
votes
1answer
37 views

SQL Server 2014 - Replica Server not available

I'm new to Sql Server and want to install SQL server alwayson clustering on my test environment. I followed the steps by this site: On each node I can connect to SQL Server but why my 2nd node is not ...
0
votes
1answer
102 views

sync many databases instance to one central database

I have four different SQL database instances which are installed on different servers. I want to sync all the databases into one central SQL instance i.e on (backup) instance which is on DR site and ...
4
votes
1answer
486 views

Is it possible to validate more than one parameter simultaneously into a Stored Procedure in sql?

On Microsoft SQL Server 2008 I realized a stored procedure which contains more than 20 parameters, in this SP I update or insert data into table which does not accept null values. I need to evaluate ...
13
votes
2answers
320 views

How are these two SQL Server rollbacks different?

In SQL Server 2008 R2, how are these two rollbacks different: Run an ALTER statement, for a few minutes, and then hit 'Cancel Executing'. It takes a few minutes to rollback completely. Run the same ...
4
votes
1answer
117 views

SQL 2012 insert data into a table from another table and custom columns

I'm trying to insert data from one table into another table and I also have 4 columns that are not in the source table but need to be populated in the target table. Here is the Insert statement SET ...
3
votes
0answers
127 views

Very High wait time?

We currently have one production SQL Server 2012 Standard Edition , running on Windows server 2008R2 standard ( 32 GB RAM , 16 cpu). there are around 22,000 connection. the Max worker thread is ...
2
votes
1answer
84 views

Can Indexes mitigate untrusted Constraint

I using sp_blitz and found two tables that have foreign keys that is untrusted. tried to enable the trust with: ALTER TABLE MyTableName WITH CHECK CHECK CONSTRAINT MyConstraintName; GO But got this ...
0
votes
1answer
38 views

How do I drop the TIME portion from DATEADD?

I am trying to create some test data where each Employee has a random birthdate. I accomplished the randomizing part but it did not return result in the format that I want.. NOTE: the DateOfBirth ...
0
votes
0answers
50 views

SQL Server Profiler performance

I was wondering if I set a filter for just a particular user does it limit the amount of resource consumption used by sql server and does using a filter(depending on the filter) limit the performance ...
2
votes
3answers
399 views

SQL Server restore database with active connections [duplicate]

I am trying to run this SQL script on a SQL Server instance to restore a test database to a newer copy of the live database. RESTORE FILELISTONLY FROM disk = '\\staging_server\path\to\db_backup....
3
votes
1answer
151 views

SQL server restore readonly file group without backup from .ndf file

We have SQl Server database with ReadOnly file group. Common file groups except readonly are backuped regulary. We restore the database from backup but readonly file group has not restored, its *.ndf ...
3
votes
4answers
2k views

Creating one stored procedure for all CRUD operations

I'm very inexperienced at writing stored procedures with conditional logic and I could really use some help. I have a data model with 7 tables and I'm trying to write a stored procedure for each table ...
3
votes
1answer
73 views

Remove mixed extents in SQL Server

In SQL Server you can make sure that the engine uses the whole extent for a single object (i.e. a table). I know how to enable the trace 1118, but that only applies to newly written data as I recall. ...