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
4 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
1answer
27 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 ...
0
votes
1answer
28 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
35 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? ...
0
votes
1answer
13 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
6 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
33 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
22 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
21 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
38 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
23 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
264 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
14 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
27 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
21 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
32 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
54 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
49 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
121 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
36 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
17 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
48 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 ...
0
votes
0answers
28 views

Table Design For Patterned Data Using Variable Bucket Ranges

Looking for table design for this scenario to be implemented on SQL Server 2012 instance. Scenario There are a total of seven types of reported data, each with variable number buckets of ...
1
vote
1answer
44 views

Database which was set up for logshipping is dropped

I dropped an old unused database. Then I found it was set up to be the source database of a logshipping setups. And there are a lot failing jobs in our job running status report now. How to remove the ...
1
vote
1answer
62 views

Where has STATMAN gone in SQL Server 2014?

So we've recently upgraded our environment to SQL Server 2014 (Enterprise on CU5) and are having some problems diagnosing performance issues, compounded by the problem that we no longer seem to be ...
1
vote
0answers
73 views

Update taking too long

I am updating a table with 250 million rows in SQL Server, and it's been running for 4.5 days. I'd like to use the computer it's running on for other memory-intensive work, so I'm torn about whether ...
1
vote
2answers
91 views

run a script for all databases

I need help what statement or function i can use to run a query in all database using one script , i want to run the below script at the same time to retrieve output in all databases select ...
1
vote
1answer
50 views

Tempdb growing, however it has a lot of free space

On a sql server dedicated to a Dynamics CRM database, I've been seeing some odd behavior. While monitoring growth using the following query as basis, I've noticed tempdb has grown quite frequently ...
0
votes
1answer
30 views

How to fix my Merge Replication upload order?

I have several Merge Replication instances in production on SQL 2008 R2. One of them has started to behave oddly in that it appears to attempting to upload the children tables before it uploads the ...
0
votes
1answer
33 views

Alter column opreation failed due to disk space in SQL Server

When i apply alter column on table, it full log file and disk too, and fails alter operation. Why this happened even table size is less than free disk? Can anyone please suggest a way to complete this ...
-1
votes
2answers
29 views

Cannot connect in SSMS with Windows Authentication

I found and added the server name through <Browse for more...> -> Network Servers so it exists and is correct. What seems weird is that the Password field is empty and I cannot modify ...
0
votes
1answer
29 views

Change Tracking clenup

Is there a way to know when cleanup of change tracking tables occurs? How to check last occurrence of cleanup process? BACKGROUND: I have Change Tracking on database (retention = 1 minute): ALTER ...
-4
votes
2answers
106 views

Incremental backup in SQL Server [on hold]

I got a task for backing up my clients data through internet. Client has about 50 GB of data there. So I need to back up the data and pass through internet, but it takes about 8 to 9 hours for this ...
0
votes
0answers
26 views

How can I run a SQL Server 2000 database on SQL Server 2005 Express with a different location for files

I am trying to help a client out after a server crash. The temporary replacement server has different drive letters and data file locations. Here are the system details as I understand them: ...
-3
votes
1answer
45 views

Ola Hallengren Index Optimise Script not Rebuilding Indexes [on hold]

I have downloaded Ola Hallengren's script and deployed to master database. I run it using the below... EXECUTE dbo.IndexOptimize @Databases = 'USER_DATABASES', @FragmentationLow = NULL, ...
0
votes
0answers
19 views

Windows Administrator doesn't have permission on SQL Server [duplicate]

My previous system administrator created a SQL Server 2008 instance on my local machine with his domain User. Now, I cannot create, delete, or view any databases or tables on that instance. Even with ...
3
votes
1answer
39 views

Cannot SUM datetime field in SQL Server migrated from Access

I am new here and am new to SQL Server (Express). I used the SSMA tool and it converted Access date/time fields to datatime2. The data contains duration data so there is no need for a date. I want to ...
1
vote
1answer
91 views

Can't connect to SQL Server

I'm trying to set up Peer-to-Peer Transactional Replication and I'm stuck at "Add a New Peer Node" step - I can't connect to another server. In server name field I specify serverIP\DBNODE2 and SQL ...
4
votes
1answer
67 views

Long running DBCC CHECKDB

I am on SQL 2014 Standard doing offline DBCC CHECKDBs (so on a box other than production). For the most part, my process is going pretty quick but for some reason I have this small DB (6gbs) and its ...
4
votes
1answer
281 views

Subselect of MAX(Version) takes many minutes, though there are only ~20K records

I have a pretty complicated data model. I can't understand most SQL examples without an explanation of what's being modeled, so I'll try to explain. Mainlines -> Releases -> Overlays -> Calibrations ...
0
votes
0answers
12 views

Oracle Linked Server only works with Sql Login

I'm having this weird error for some time. When I login to sql server and use the linked server SELECT * FROM OPENQUERY(MEGA, 'SELECT 1 FROM DUAL') I receive this error OLE DB provider ...
0
votes
1answer
22 views

Error with FUNCTION ( SQL Server 2008 ) - ''Cannot find either column…'

Friends, I have this Function: create function [dbo].[fn_xxx] ( @Nome varchar(100), @Descricao varchar(500) ) RETURNS @tbDados table ( Qtd int ) as Begin ...
1
vote
0answers
28 views

When does SQL Server follow the Minimum Password Age policy?

According to this SQL Server 2008 whitepaper, SQL Server should only pay attention to the Minimum Password Age policy when the Check_Expiration (Enforce Password Expiration) option is turned on. Page ...
0
votes
0answers
18 views

When does a port get assigned if SQL Server is set to TCP Dynamic Ports

I'm trying to determine when a dynamic port is assigned to SQL Server. If the TCP/IP Properties have the TCP Dynamic Ports enabled, does that port get assigned at the time the Server is installed or ...
1
vote
1answer
33 views

Best place to keep backup scripts

Where is the best place to leave the Database Backup scripts, currently I let them on the Backup Job itself, however I wonder if it's best to leave on a Database
1
vote
1answer
33 views

SSMS returns results immediately; ADO takes longer

I am running a query that returns ~250k results. It is basically SELECT * FROM my_schema.my_view (and the view is somewhat complex, and all table references in it are two-part) I am not passing any ...