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
33 views

SQL Server Log Shipping: Copy copies 0 files

(This is SQL 2014, but applies to several recent versions) I had the SQL Server log shipping wizard create the script for the primary and secondary. Since the primary already backs up logs every few ...
0
votes
1answer
33 views

Deployment script always re-create constraints and indexes

When generating deployment script from SSDT. It always generate a codes that drop the foreign key constraints, indexes then create again those constraints and indexes. How to remove the codes that ...
0
votes
1answer
24 views

Data warehouse: Can I tell any details from Source System on delays or blocks? [closed]

I have a MS SQL Server 2012 machine that is acting as our data warehouse currently. We are having issues with long running jobs, and am curious if there is a way to get detailed historical logging on ...
2
votes
1answer
33 views

How to execute maintenance job from script and get back the result

I am trying to find a way to execute a maintenance job from script and have it return if the the job was successful or not. I know that I can use msdb.dbo.sp_start_job to execute the maintenance job, ...
-1
votes
1answer
55 views

shrink transaction log

Can I shrink transaction log when database in online using below command ? DBCC SHRINKFILE(transactionloglogicalfilename, TRUNCATEONLY) FYI my database is in production server & highly critical ...
1
vote
4answers
124 views

NVARCHAR column as PRIMARY KEY or as UNIQUE column

I'm developing a SQL Server 2012 database and I have a doubt about nvarchar columns as primary keys. I have this table: CREATE TABLE [dbo].[CODES] ( [ID_CODE] [bigint] IDENTITY(1,1) NOT NULL, ...
0
votes
0answers
17 views

Setting up Pull Subscriptions in SQL Server 2014 Web Edition

When I setup a pull subscription for a SQL Server 2014 Web Edition subscriber to a 2008r2 Standard Edition publisher, I'm not getting any local agents to handle the synchronization. I expand the SQL ...
0
votes
3answers
96 views

A more efficient way to write multiple CASE statements [closed]

SELECT CASE WHEN ( Table.COLUMN1) IS NOT NULL THEN 1 ELSE 0 END, CASE WHEN ( CASE WHEN ( Table.COLUMN1) IS NOT NULL AND ( Table.COLUMN2) IS NOT NULL THEN CASE WHEN ( Table.COLUMN1) - ( ...
1
vote
3answers
62 views

Best practice - Update Primary Keys

What's you opinion about Update a primary Key in SQL? I have a "link" table with 3 key from 3 other tables. Should the administration let people to edit one of the keys? I usely said no, dont change ...
0
votes
1answer
52 views

Best practice for archiving old data? [closed]

We are migrating 3 slightly different SQL databases into one (SQL Server 2008R2). We want to keep old databases "alive" for some period of time but once we've gone live we don’t want staff ...
5
votes
3answers
210 views

REORGANIZE seems to work as well as REBUILD all the time

On this MSDN Page it says if you should reorganize or rebuild based on the amount of fragmentation: 5% to 30% -> ALTER INDEX REORGANIZE Over 30% -> ALTER INDEX REBUILD WITH (ONLINE = ...
0
votes
2answers
96 views

Is it possible to set stand-by database to active, do changes and then continue restore chain?

Basically, I'm using a custom log shipping method on a sql 2012, where the transaction files are manually copied to an offsite location. The files are then restored using something similar: RESTORE ...
1
vote
1answer
55 views

Shrink log file after configuring backups properly

I had a database that was working in FULL recovery mode but never had transaction log backups done. The consequence of that was the fact that the log file kept growing and now its 10 GB in size. I ...
2
votes
0answers
37 views

Change Tracking across several Tables

I'm looking into providing DB level change tracking within my system. I need to be able to track changes at an entity level, rather than just individual tables. Right now, we have triggers on each of ...
7
votes
1answer
54 views

very poor cardinality estimate on a geometry intersection

I'm intersecting a point with a set of polygons. The query is indexed, and the polygons do not overlap but the query plan seems to think that instead of 1 row, i'll return 18k rows, and this results ...
3
votes
1answer
92 views

SQL Server log shipping: How to give SQL Agent the needed rights to remote share?

This is an old topic, and somehow I have not been able to find a clear answer. Setup: Two stand alone SQL Servers. They have full network visibility to each other. They are NOT in a domain. There is ...
0
votes
1answer
33 views

Unable to update or insert values table with DateTime column defaulted to GETDATE

I have atlered table by adding Datetime column. This column is not null and also default value from GETDATE(). ALTER TABLE myTable ADD myDateColun DATETIME NOT NULL DEFAULT (GETDATE()) I'm trying ...
1
vote
0answers
62 views

How to use HTTP Connection Manager in Script Component? (Not Script Task)

I'm trying to perform the same scenario as in the following link; Create a SSIS Script Component as a Data Source that uses a pre-existing HTTP Connection Manager to retreive a page with GET and emit ...
1
vote
2answers
91 views

How to split url in sql server like this

Here is the url www.abc.com/a/b/c/d/e/f/g/h/i I want result like this www.abc.com/a/b/c/d/e/f/g/h/i www.abc.com/a/b/c/d/e/f/g/h www.abc.com/a/b/c/d/e/f/g www.abc.com/a/b/c/d/e/f ...
1
vote
2answers
47 views

SQL Server Cumulative Updates - not visible in Windows Update

I just installed all possible Windows updates on WS2008R2/SQL2012 instance. When I run SELECT @@VERSION I get Microsoft SQL Server 2012 - 11.0.5058.0 (X64) May 14 2014 18:34:29 Copyright ...
0
votes
1answer
46 views

SSIS Package fails to “Transform File and create output file”

I have an SSIS (2012) package which was written by one of the developers. I've been tasked to with fixing the error. Each time the package is run I receive the following three messages indicating the ...
1
vote
1answer
51 views

Backup a remote database, from my machine, to another server (SQL Server 2008)

I'm trying to backup a database, of a remote server, from my machine, to another server. SERVER1 >>> BACKUPSERVER \ / \ / \ / ...
3
votes
2answers
81 views

What perfmon counters should I use to get the fastest restore possible on an idle system?

I have a development VM running Windows 2012-R2 and Sql Server 2014. I have one disk from a SAN holding the OS and SQL. My backup file is stored locally on the disk. I want to restore database as ...
0
votes
3answers
50 views

Should I enable db_writer in public facing website

I've come across an issue when using Entity Framework and trying to delete an object. The SQL-Server DB that it's trying to delete from, and the Login it is using, has a role membership of public ...
0
votes
2answers
48 views

How to split a row in a result into mutliple rows

I have the following query: SELECT vs.MonthName AS Month, vs.Region, vs.Category, CAST (MIN (a.TotalAmount) AS money) AS ActualAmount, MIN (a.TotalCases) AS ...
0
votes
2answers
76 views

Connecting SQL Server 2008 R2 to SQL Server 2000

Initially, my desktop has been installed with SQL Server 2000 Standard Edition SQL Client. Recently, I installed SQL Server 2008 R2 client and server instance. I'm using SQL Server 2008 Management ...
1
vote
1answer
119 views

SQL Server stored procedure causing 100% CPU usage

I'm using SQL Server 2008 R2 We have a single stored procedure that causes 100% CPU usage when ran. The said SP is ran once a month and performs heavy calculation for approximately 5 minutes. Since ...
0
votes
1answer
55 views

SQL Server 2014 and SQL Server 2014 Management Studio

I successfully installed SQL Server 2014, but when I look for SQL Server Management Studio it was not on the CD. I have just downloaded SQL Server 2014 Management Studio separately and would like to ...
1
vote
1answer
27 views

Filtering data in a publication

I'm looking to replicate a table that has a particular column for deciding if a row should be replicated. If the column is set to 'Y', then replicate. From my searching, Static Row filters are my ...
5
votes
2answers
136 views

Shrink or no Shrink dilemma

I have databases that I am tasked to move two databases DBName1 and DBName2 to SSD and I only have limited space on the SSD to fit these databases.I do not want to shrink log or data files for the ...
2
votes
3answers
360 views

Automatically restore SQL Server database from file from another server

We have a daily task to overwrite a number of development databases using backups of the associated production databases. The backups are produced by maintenance plans on the production server then ...
0
votes
1answer
60 views

Is there a reason my CTE with a basic subquery in the second stage of the CTE is failing?

Ok... anyone aid with this sorry...i've been playing with some of my works reports and i thought id found a way to mix two results into one when i came across a small issue... if i run my CTE code ...
2
votes
1answer
79 views

Indexing nvarchar(128) in SQL Server

Have no idea how indexing works in SQL Server. Working with a SQL Server 2012 Intel Xeon 2.2 GHz dual core 8 GB RAM. Will indexing a nvarchar(128) in addition to int primary key cause any ...
1
vote
0answers
15 views

Does an “update-update” conflict get created from the same node in P2P replication?

I have been told that an update-update conflict is being created in a production environment, which is set up using p2p replication, because of concurrent update by stored procedures. The msdn ...
2
votes
1answer
52 views

T-SQL query to find backup folder for specific maintenance plan

I want to check check if backup plans are set up correctly and need to query different servers, mostly SQL Server 2008, but also 2012. Is there any way to query the maintenance plans for databases, ...
1
vote
1answer
68 views

Modifying a non managed table partition

I ran across a partition that was initially setup (sql 2012) beginning of 2014 to break by month but wasn't updated for 2015. The main issue is that the last partition was setup as Jan 2015 so Feb ...
3
votes
1answer
60 views

Changing db ownership using a user which can only see the sa

At first, I would like to thank the community for creating such a resourceful forum. I've been using StackOverflow for years, and recently, using dba on SE too and you're great. Most of my questions ...
1
vote
1answer
14 views

Distribution clean up job in transactional replication. Records removed but files didnt

Distribution clean up job runs without errors according to schedule, but I noticed that snapshot files do not remove even if they are created beyond max_disretention period. Records from ...
2
votes
2answers
154 views

SQL Server Timeout Expired in ASP.NET C# WebForms application

I have the following issue on my database which is used by a c# ASP.NET application: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not ...
2
votes
3answers
99 views

Recover deleted table from the database

Currently I deleted one table from the database. But now I want some of the information from that table. Please suggest how to restore or get back the table. I am using SQL Server 2008 R2.
0
votes
4answers
29 views

ISNULL() OR Is NULL in UPDATE statement

I have to run UPDATE statement on live online database about 5 lac records so i want to know which statement are run faster Update Table set REC_ID = isnull(REC_ID,'') Update Table set REC_ID = '' ...
2
votes
1answer
31 views

Linked server issues and administration

We have around 15 linked servers in each of 2 servers and application is querying the views and stored procedures using these linked servers. I would like to know Is there a way to find from ...
-5
votes
1answer
35 views

SQL Server DBA database space [duplicate]

Some X application is using 650 GB of hard disk and after delete the XXX company now current data size is 85 GB so we need to release 500 GB back to disc. How to do it?
1
vote
2answers
53 views

DB backups for production to DR without creating jobs in prod

I had two servers(SQL 2005) A and B. B is Production server and A is DR. I want to take backups for B server databases from A server. We can not create any maintenance plans or jobs in B production ...
0
votes
1answer
22 views

How to use a group by in inner join

I have Two tables Table 1 ID totalamount 100 1000 101 500 Table 2 ID Individualamount 100 500 100 300 100 100 101 ...
0
votes
1answer
45 views

Error message when importing data into SQL (Import & Export Data Wizard)

I am trying to use the Import & Export Data Wizard to import the contents of a CSV file into a table in MSSQL. I have no issues if I import all columns as strings however, I need one column to be ...
0
votes
0answers
33 views

Will SSDT publish always fail with “Data Loss May Occur” when table is rebuilt?

Consider the following scenario: We have a SSDT database project. We add a new column to the middle of a table. This forces the database project to rebuild the table in order to deploy the change. ...
0
votes
0answers
9 views

DBM_INIT distributed transaction rollback in profiler

SQL Server 2008 R2. WebSphere 7.x Windows 2008 server. Our application is JEE in WebSphere 7.x, and so uses Microsoft JDBC I believe 4.0 to connect to the db server. During one of our batch jobs, ...
1
vote
0answers
17 views

Replicating Multiple SQL Servers to Azure and Accessing From Web Apps

I am setting up quite a large system with multiple servers (MS SQL Server), and Office 365 Access DB, and a custom SharePoint web app for reporting purposes. The system should work as follows: Each ...
0
votes
0answers
16 views

Issues with using a database snapshot to report off of production [duplicate]

Has anyone used a database snapshot to allow reports to be run off of a production environment? I'm currently evaluating whether this is a good idea, however, it seems like since the database snapshot ...