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)

0
votes
0answers
13 views

Is it possible to target a specific instance in a clustered environment with group policy?

Not sure where to ask this, but here goes: I'm in a clustered environment, not the primary DBA (and he's not very AD/GP savvy either) and I'm being asked to set security permissions for an AD Service ...
0
votes
1answer
35 views

Server-wide Database Permissions in SQL Server

We have a SQL Server 2014 installation, which is accessible by a subset of our Active Directory users via Windows Authentication. Currently, when they log into the server for the first time they are ...
0
votes
2answers
38 views

Database logs growing during maintenance plan

I have read several threads and sites about SQL logs but I don't feel I have found the answer. Or if I did I did not understand it enough to address my issues. My issue: When I run my SQL maintenance ...
0
votes
1answer
30 views

How comes that login with no rights cam give himself db_creator?

I just created a new login using the GUI, which generates this script: USE [master] GO CREATE LOGIN [tester] WITH PASSWORD=N'tester', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF ...
2
votes
1answer
56 views

SQL Server: Recursive dynamic SQL puzzle

I was looking at this post of trim all columns of a table. In the answer query script the column names gets concatenated without any looping operation. I simplified it to check its work flow as ...
0
votes
0answers
17 views

Integrating Postgres/GIS data in a SQL Server environment without generating 'data islands'

Currently I'm facing an scenario in which a GIS expert is planning on starting to integrate mapping services for several departments within the organization I work for. I handle around 40 mid-sized ...
0
votes
1answer
35 views

Improve sql server lookup table performance [on hold]

We have a sql server database (on azure) with one large table c1billion rows. Each row consists of a key char32 which is an md5 hash and a value int. All queries select multiple values from the table ...
0
votes
2answers
32 views

Can I restore a SQL Server 2014 backup to SQL Server 2014 Express

Can I restore a SQL Server 2014 backup to SQL Server 2014 Express? I am given a backup of a SQL Server 2014 database and I need to do some development task on it. I was just wondering what option I ...
0
votes
1answer
38 views

Difficult Query: Can Only Modify The WHERE Clause

Table tblDistResell (the first row is the column headers): DISTRIBUTOR RESELLER STATE ABC BestBuy CA ABC RadioShack NJ XYZ BestBuy CA XYZ RadioShack MO ...
4
votes
0answers
49 views

Is sys.stats_columns incorrect?

Let's say I have a table Foo with columns ID1, ID2 and a composite primary key defined over ID2, ID1. (I'm currently working with a System Center product that has several tables defined this way with ...
1
vote
2answers
37 views

What is the best way to compare values of whole tables between many databases?

We are trying to compare the values of whole tables between many databases. The user can enter in input the table names and the columns names, and the database names he wants to compare. They can ...
1
vote
1answer
36 views

Deadlock scenario, where is this S lock coming from?

I am encountering the below deadlock scenario. Please see the attached object definitions and execution plans. The plans were pulled out of cache from a system where this deadlock does occur. I ...
0
votes
0answers
19 views

How do I abstract a WHERE clause condition?

I'm wondering how a condition in a commonly used WHERE clause can be abstracted away so that it can be safely changed. Say I have data like ColA | ColB | ColC ================== 1 | 2 | ABC ...
0
votes
1answer
22 views

Any reasons trigger AFTER INSERT would not fire?

Context: We're using microsoft sync framework in our project. Sync creates triggers AFTER INSERT, DELETE, UPDATE triggers for tables that are provisioned to sync. the framework also creates tracking ...
1
vote
2answers
28 views

To what extent can we monitor jobs/suspended queries as DBO

Short Background: I work for company A, at company A we have a DBA that should not be. When we are tasked with items for troubleshooting which require quick turn around, it generally takes quite a ...
0
votes
0answers
32 views

Parent-child Relationship with data scattered between these records

I have a 60 column query that fills in a card on an application. The problem I am running into is gathering all the parent-child relationship data into one record per child. As a quick example: The ...
0
votes
1answer
39 views

More Best Practices To Updating Large Tables?

I know there are a number of topics on this question, but I'm always seeking more insights. I have a large table with a billion+ records. The amount of records could be reduced and archived, but the ...
0
votes
0answers
41 views

I want to calculate time for each ticket [on hold]

I have a ticket table as.. ticketid owner owndate 1001 LEWIS 2004-06-18 14:15:11 1001 WILSON 2004-06-18 14:16:54 1001 WILSON ...
0
votes
1answer
13 views

SQL Server Replication with 2 system in different locations

I have 2 Servers with static public Ip Addresses located one in UK and another in US. Can I implement SQL Replication on these 2 servers located in 2 different locations accessible via public ip ...
0
votes
0answers
19 views

Mirroring via dedicated NIC between two multi-instance clusters

Scenario: Two node SQL Server 2012 cluster in Primary Site. Two node SQL Server 2012 cluster in DR site. Both sites connected via general MPLS network. Replication line available between the two. ...
0
votes
3answers
24 views

Move result of a query from one server to another table on another server

What are my options in moving result of a query in one server to another table on another server? Data contains ~400.000 rows so it won't be a quick one. (Both of them are SQL Server 2008 R2) ...
0
votes
1answer
25 views

How to measure the SQL Server 2012 performance [on hold]

We have a high end server (128 GB RAM, 20 cores with 2.20GHz, 40 logical processors), 64-bit windows 2012 R2 OS. I have observed that the SQL Server performance is slow compared to our low end ...
0
votes
0answers
9 views

Application hangs user login to apps but not able to open the other link (app is in C# using SQL Server 2008) [on hold]

The user log on to the application but does not do any other task. The application is in C# using SQL Server 2008.
1
vote
1answer
26 views

SQL Server database recovery complete?

I'm having trouble working out when a database is 'ready' after an unscheduled SQL Server restart. If there was a large transaction running when the server was restarted the database will go into ...
0
votes
0answers
68 views

Insert into multiple tables using a single stored procedure

I have four tables, in all the four tables I have similar columns. I want to make an entry into each table using a single stored procedure. I have created a user defined table type: CREATE TYPE ...
1
vote
1answer
43 views

A query for merging date intervals

I have a simple table with 3 columns: (cid, from, to) -> (int, datetime, datetime) The difference between dateFrom and dateTo should be >= 1 month. And unfortunately i have some corrupt data ...
1
vote
1answer
33 views

Performance of Combination lookup

I've been looking into this most of the day and I'm still not getting far so I thought I'd ask on here. Basically its a lottery system and what I need to do is check whether 4 of the 6 balls I have ...
0
votes
2answers
42 views

What to do with a table with a lot ( 50+ ) indexes? SQL Server 2008

We have a table here, used by our software. Since i'm new in this company ( the new dba here ), what i see is that some tables of some databases have a LOT of indexes ( like 50...60 ). Is this good? ...
1
vote
1answer
15 views

SQL CLR very slow on Amazon EC2 Instance (SQL Server 2014 CU6)

I am running a SQL Server 2014 Standard Edition (Cumulative Updates 6) instance on an r3.large Amazon EC2 box. I noticed that the CPU usage of SQL Server skyrockets to 100% while executing pretty much ...
0
votes
0answers
11 views

How do I manage environment specific connections for SSAS projects?

I am using SQL Server 2012 and I am responsible for implementing release automation for our SQL, SSIS, and SSAS projects. SSIS projects have project parameters and you can link those to SSISDB ...
1
vote
0answers
38 views

Trying to add a NULLable column to a table with over 90 million rows takes a very long time

I have been trying to add a NULLable column to a table with over 90 million rows. ALTER TABLE <TableName> ADD <FieldName> INT NULL; It is taking a very long time (been running for over ...
0
votes
1answer
38 views

Backup SQL Server database on UNC path using SA

We need to backup some database to an unc path, the problem it's that it's a SQL Server instance that has to execute with SQL Server autentication (sa user). How can we configure the plan task in ...
1
vote
0answers
24 views

Backup terminating abnormally [on hold]

Does anyone in the community know which SQL-Server 2014 CU will fix the issue of a backup terminating abnormally and causing a stack dump. This SQL-Server instance was an upgrade from 2012 to 2014 ...
0
votes
2answers
43 views

DBA Tasks ( SQL Server 2008 ) - Recommendation - Maintenance plan

I'm a JR DBA on a big company. I was hired 6 months ago, and I'm learning things really fast (I'm the only DBA here). The old DBA left servers and SQL Server instances for me, to take care of it. ...
-1
votes
0answers
26 views

Restore of database '[name of database]' failed [on hold]

I want to to restore my database from a .bak file when I show direction to the file for device, appearing error in dialog window. How can I fix it?? Thank you for your answers!
6
votes
1answer
280 views

SQL Server: Create default stored procedure as and when a new database is created

I am using SQL Server 2008 R2. I need one simple stored procedure to be created by default, as and when a new database is created in SQL Server. How can I achieve this? Assume the stored procedure to ...
-2
votes
0answers
16 views

How can I attach my database to my C# setup? [on hold]

How can I attach my SQL Server 2008 database file to my C# setup?
1
vote
1answer
32 views

TempDB Best Practices For Shared Storage [on hold]

Microsoft recommends separating the SQL Data Files from the Temp Files to limit device contention but what about cases involving shared storage. I have a shared environment where the data and temp ...
0
votes
0answers
29 views

Why Can't You Have Immediate Access To Source Table When Killing ONLINE Clustered Index CREATE/REBUILD/DROP?

When you CREATE/REBUILD/DROP a clustered index with ONLINE=ON, why can't you have immediate access to the underlying table after issuing a KILL? While performed said operations ONLINE, the source ...
0
votes
1answer
39 views

How to change the database mode to STANDBY?

I have a "log shipping" from server A(Database Name = main) to server B(Database Name = LS_main) . I want to take a Snapshot Database From the secondary Database (Database Name = LS_main), but he id ...
3
votes
1answer
50 views

How to perform server-side transaction timeout if COMMIT TRANSACTION will never arrive?

How can SQL Server terminate one of its transactions if it exceeds preset timeout? Imagine the following transaction performed by traveling salesman's SQL client application, which is submitted ...
2
votes
0answers
26 views

How can I speed SQLPS connection when I don't have WMI permissions at the server

When connecting SQLPS to a SQL Server, it will try to run some WMI service status queries. In an environment where one does not have permissions for those, PowerShell issues a bunch of warnings, and ...
0
votes
2answers
34 views

How to list LOGIN + ROLE in SQL Server 2008?

I'm looking for an answer but i can't found. Just a lot of long scripts. I need to list Login | Role ( sysadmin, dbcreator, etc ) but i can't find a table to join. I have this for now: SELECT name ...
-3
votes
0answers
30 views

How to read default value [on hold]

I am giving startdate and enddate. There are multiple items present in table. If data is not present for item to any date. How to return default value as 0 (zero)?
0
votes
1answer
57 views

Order of Columns in Index

I have following query which has ON clause on different column, Where clause on different column and Selection on different columns so my question is what should be Order of Columns in Index as ...
1
vote
1answer
51 views

What is causing an INTERSECT to run forever when the individual SELECTs run quickly? [on hold]

I have a script that applies the INTERSECT operator to 2 separate queries. Query1 executes instantly and returns ~1k rows. Query2 executes almost instantly and returns 200k rows However, when ...
5
votes
4answers
128 views

How to check if Alter view/stored proc script has run successfully

For the database deployments, I call all the db schema changes in a batch file and run them on the target database. Sometimes we have scripts for altering the views or stored procs. I'm wondering ...
0
votes
1answer
38 views

From PostgreSQL to SQL Server (No User/Pass)

Some of you MAY be able to crack a really tough nut... I have to move all the data from a PostgreSQL (9.1 - Windows) database to SQL Server because the company I am contracting with is upgrading the ...
1
vote
1answer
18 views

Trigger to apply user mapping to logins on database creation [on hold]

Does anyone have any example triggers that apply user mapping on database creation?
0
votes
1answer
51 views

Can I re-replicate a transactional publication? Should I?

We use a cloud-based SAAS provider as one of our line-of-business applications. An on-site SQL Server 2008 R2 instance in our DMZ is a transactional replication subscriber to a number of publications ...