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
1answer
20 views

TempDB Best Practices For Shared Storage

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
21 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
30 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
33 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
16 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
28 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
29 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
51 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
46 views

What is causing an INTERSECT to run forever when the individual SELECTs run quickly?

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
106 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
26 views

From PostgreSQL to SQLServer (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
16 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
42 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
26 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
43 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
59 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
70 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
90 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
32 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
0answers
18 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
101 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
43 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
38 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
89 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
62 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
278 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
26 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 ...
0
votes
1answer
33 views

Join to a Culture Table vs Select Culture ID

I have a query that is executed several hundred thousand times a day. Due to legacy support, the incoming variables on this SP cannot change. Currently it looks like this: Select id, name, ...
7
votes
1answer
438 views

Why adding SQL Server user to “Perform volume maintenance tasks” improves the speed of database resizing so much?

If I want to create 5GB database with CREATE DATABASE [test] CONTAINMENT = NONE ON PRIMARY ( NAME = N'test', FILENAME = N'E:\2012\test.mdf' , SIZE = 5529600KB , FILEGROWTH = 1024KB ) LOG ON ( ...
0
votes
2answers
120 views

Optimizing queries for 25+ million rows

I am using MS SQL, and I have to run several queries on the same table on different criteria. At first I ran each query on the original table although they all share some filtering (i.e Date, status). ...
0
votes
0answers
29 views

Adding a constraint to check another table whether if the data exists [migrated]

currently I'm learning SQL but i got stucked at one point, I've searched a number of threads but it seems that i can't find the exact one that I'm trying to achieve. Currently after creating table, ...
0
votes
1answer
28 views

SSIS Merge Join Error [on hold]

I have a simple data flow. I'm trying to join two sets of data from two different databases. The TXT database is collation SQL_Latin1_General_CP1_CI_AS. The other dataset (Cost) is coming from ...
4
votes
1answer
268 views

Should I use Database Mirroring?

So I have the following scenario on my hands: I have a product database that runs for a specific app, all inserts into the database come in through three separate connections. Recently I have ...
2
votes
1answer
31 views

Agent service account shows as not clustered

One of the SQL Server 2008 R2 instances I administer is running on a two node Windows Cluster (Windows Server 2008 R2 Enterprise) When I run the DMV sys.dm_server_services, SQL Server Service Account ...
-2
votes
3answers
36 views

Cannot identify syntax errors [on hold]

Newbie here. I'm trying to execute this line in sql server: CREATE TABLE dummy_driver but I'm receiving the error message Incorrect syntax near 'dummy_driver'. I can't seem to locate the error. ...
0
votes
0answers
33 views

Peer-to-Peer Transactional Replication Load Balancing in MS SQL Server

I'm looking at Peer-to-Peer Transactional Replication and it looks like a perfect fit for my requirements, but there's one unclear part - load balancing (see picture below). How it is implemented in ...
1
vote
1answer
38 views

Return list of columns in user-provided subquery

I am trying to fill a ComboBox of all columns from results of a query. That query is submitted by the user on the form, so the program needs to run the query then have a procedure run that extracts ...
1
vote
0answers
29 views

How to architect Service Broker with three or more systems?

I'm trying to implement a Service Broker architecture for a business process involving three systems and I want to do it in the spirit of using SB as designed. System 'A' is an accounting system. ...
0
votes
1answer
53 views

Restoring SQL Server database on another box

I have a SQL Server database that is running these scripts to create backups. It's running full backups once a week, daily differentials, and hourly logs. These are being FTPd to another box where I ...
2
votes
3answers
61 views

Why is sql server waiting for acknowledgment?

I have an application that often request a big set of rows [about 20K] from a sql view, in the mean time other applications can't update the table from where the data comes from, the update query's ...