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)

1
vote
1answer
81 views

How do I set up high availability at the instance level? [closed]

I have two database instances (Instance A, Instance B) of SQL Server, each one hosted on a separate VM using windows server 2012. Instance A has SQL Server 2008 R2, instance B has Sql server 2012. I'm ...
5
votes
1answer
3k views

SQL Server - How to determine ideal memory for instance?

We have some virtual machines that have X memory allocated to them. This amount of memory is somewhat random. It was allocated to the machine because that was the amount of memory the physical ...
1
vote
3answers
3k views

SQL Server backup job last 5 days

We've been having this nightly backup job on SQL Server 2012 but it appends to the .bak file instead of overwriting, so while googling I discovered master.dbo.xp_delete_file I noticed that I can ...
1
vote
0answers
158 views

Linked server query in profiler

I was profiling a DB for queries against it but have noticed that when a table in the DB is accessed through a linked server this does not show in profiler. Can anyone advise on why this is or what ...
-3
votes
1answer
94 views

Sproc - Adding columns with matching ID column [closed]

I currently have a sproc that is used for reporting on a table similar to the one below: ID Weight QTY OtherData 1 20 12 1234 1 44 4 1234 ...
3
votes
3answers
8k views

How to drop SQL Server database currently in use and in Single user mode

I have a Database on SQL Server 2008, which I want to drop. Currently it is in single user mode and it is currently in use. select * from sys.sysprocesses returns Msg 924, Level 14, State 1, Line ...
0
votes
1answer
108 views

SQL Server 2000 Replication

I have a challenge with replication on SQL Server 2000. The replication has full permissions, but still I get this below error. The SQL Server 2000 is installed on the C: Drive, but the database is on ...
1
vote
1answer
366 views

SQL Server 2012 SQL Log “the log file is not using Unicode format”:

On only one server of many, the SQL log is blank and shows a message "the log file is not using Unicode Format" when viewed via SSMS. The log is in the right location as specified in the service ...
0
votes
1answer
1k views

Why are these two INSERTs deadlocking? Is it the trigger? What does this deadlock trace 1222 log tell me?

We are seeing intermittent deadlocks in production when receiving multiple simultaneous API requests. Each request basically culminates in an INSERT statement into the same table, which is where we ...
0
votes
0answers
200 views

SQL Server Merge Replication Stuck, lots of conflicts and genstatus = 4 (interrupted) [closed]

Merge replication is the gift that keeps on giving as far as throwing new things at us, and the latest is a subscription that had been behaving for quite sometime suddenly slowing to a crawl. This ...
1
vote
2answers
2k views

What will be the initial size of my tempdb data file(s) after restart?

sys.database_files and sys.sysfiles report on size, but that's just the current size of the file. Is there a way to find out what the initial size of the tempdb datafiles will be after it's recreated ...
3
votes
2answers
162 views

Can I run concurrent backups of multiple read only filegroups?

I have 62 readonly filegroups in a SQL server 2008 enterprise database. Can I backup multiple read only filegroups at the same time? I would assume this to be the case but given this database is over ...
2
votes
1answer
1k views

What is MSrepl_tran_version? (MS SQL Server)

So, I'm an "enterprise software developer" (welcome to hell, here's your accordion), meaning I'm not a DBA and I'm inheriting something that's been around for years and very few people have a crisp ...
2
votes
1answer
126 views

Query does not use index when selecting all records [closed]

This is my first time handling a large database, and I was wondering why the two queries below are different in terms of execution plan. I have setup an index on a specific table: CREATE ...
0
votes
3answers
142 views

Design concerns for using 3x bit or one char(1) or one integer in table for holding status of item

I need to extend my existing table with status column. I am in doubt how to do that in most appropriate way regarding of future use of that status and performances of existing table. My table is ...
1
vote
1answer
1k views

A network-related or instance-specific error occurred

I have been using a local database on my laptop for the last view weeks. But today I cannot access it. I get the error: A network-related or instance-specific error occurred while establishing ...
0
votes
2answers
435 views

Is an AWS SQL Server RDS “log capture” the same as a transaction log backup?

When an SQL Server RDS instance provided by Amazon is configured for a recovery model using Full transaction logging, will the transaction log be trimmed by the "transaction log capture" that Amazon ...
4
votes
3answers
1k views

Is there any time where we should avoid cascading delete?

In SQL Server 2008, there is a Primary table which is linked to three other child tables by 1 to many relationship. So, we are thinking of using Cascading delete in the primary table, so that all the ...
0
votes
1answer
60 views

Software for working with SQL Server databases in Windows Server 2008 [closed]

We have an ASP .NET project that uses SQL Server that we host on a Windows Server 2008 machine. Where does Microsoft keeps its documentation for the tools that can be used for administering SQL Server ...
3
votes
2answers
4k views

Publishing database changes with SSDT that include altering data types of columns

I have a SQL Server Data Tools (VS2012) project that's published automatically during the build process. A column was recently updated from an int to decimal(18,4). As a result of this change, the ...
1
vote
1answer
929 views

Server Wide DDL Trigger Permissions Issue

I am trying to implement a server wide DDL Trigger that will audit the DDL changes across the databases on the server using script very similar to the article found here The trigger will log the DDL ...
1
vote
1answer
673 views

The ordinal position for a column changed without my knowledge

I have a column that is out of order (ordinally, not in terms of select statement), and I just can't figure out how it got that way. I've been researching this for quite some time and am coming up ...
1
vote
3answers
139 views

Securely remove columns (and traces thereof) from a SQL database

I've come upon a database that has previously held sensitive data (think "passwords/credit-card-numbers" kind of sensitive) in plain text. All of the sensitive data in question has been deleted, but ...
0
votes
1answer
100 views

Grouping rows by looking at two columns without considering the order

I have a table looks like this one below: +----+---------+---------+ | ID | VALUE 1 | VALUE 2 | +----+---------+---------+ | 01 | A | B | | 01 | B | A | | 02 | C | D ...
3
votes
2answers
423 views

Configure Email to be sent on restoring a database

Is there a way to configure Email in SQL Server such that an Email is sent when a particular database is restored.
0
votes
1answer
155 views

Can I design this database better? [closed]

I have the following database design: Script to reproduce: /* DROP TABLE [dbo].[feedback] DROP TABLE [dbo].[action] DROP TABLE [dbo].[download] DROP TABLE [dbo].[user] DROP ...
1
vote
1answer
314 views

Simple update query balloons tempdb

I am trying to do a bulk update of a column from a csv file, however when I do the actual update operation my tempdb balloons to over 20 GB in size (overtaking the entire size of the SSD the tempdb is ...
1
vote
3answers
152 views

One or several tables for attributes

I just spent some time discussing two alternative DB designs with a coworker and I'm not convinced. Neither of us is strictly DBA so we may be missing something. The overall goal is to create the ...
1
vote
1answer
411 views

Optimising a query of an SSRS dataset

Consider the query given below: SELECT * FROM ((SELECT c.cust_id , c.username , REPLACE(qs.seg_type_ref_key_02, 'N/A', 'Non Vip') casino_group, ...
1
vote
0answers
169 views

Way to make differential backup from full different but from same database

I have the following situation: Our sql server is running in a cloud service. The database to be backed up have 60gb. We need to make a local copy of the database for some tests, and it need to be up ...
0
votes
1answer
265 views

DELETE query against a linked server issues error

I have a query that is part of a bigger process, and runs against a linked server. The code is like this: DELETE FROM [LinkServerIP].[Database].[dbo].[TableName] WHERE NOT EXISTS ( SELECT * ...
1
vote
1answer
1k views

Imitate 'dynamic' columns in SQL Server

We have a central SQL Server 2012 database. There is a single table [tbl_Users] that stores all kinds of information pertinent to an employee, for example, UserID CustomerID FirstName Surname ...
1
vote
1answer
591 views

Check for column in backupset table

Created a script to show last backup locations, sizes and dates SELECT DatabaseName = x.database_name, LastBackupDate = x.backup_finish_date, BackupSizeKB = x.backup_size, ...
0
votes
1answer
127 views

How do I setup a foreign key relationship based on two columns?

I have the following two tables: CREATE TABLE [dbo].[company] ( [CompanyID] [int] NOT NULL , [CompanyName] [varchar](150) NULL , [DepartmentID] [int] NOT NULL , ...
7
votes
4answers
497 views

Are there any problems with deploying an SQL Server database to a production server by taking a backup?

This is a slightly loaded question in that I have already assumed that the described scenario is wrong. A DBA is deploying an application I have written that includes an MS SQL Server 2008 database. ...
6
votes
2answers
4k views

When to make changes to the cost threshold for parallelism

While examining a performance issue , I have seen an influx on CXPACKETS suggesting I might need to look at the cost threshold for parallelism and perhaps the MAXDOP. Before making any drastic ...
1
vote
1answer
166 views

Data center from scratch which way to go

My budget for a data center (hardware,OS licences, SQL Licences WithOut CALS ) is around $50K~$60K. I have needs for around 200 users and my apps works only works in Microsoft environment (Window ...
3
votes
3answers
4k views

How to turn off identity for a database column of a table

I have mistakenly deleted a table in one one my database server. I have same set of data in the other server. What I have done is clicked on edit top 100 rows for the table, then copied it and pasted ...
4
votes
4answers
4k views

How to find unused indexes?

I am working on a Data warehouse. I have tables with up to 200M records. Some of these tables have around 20+ indexes (I can't provide a reason why they have been created in the first place). This is ...
5
votes
2answers
2k views

Restore Database SQL Server 2012

I'm a newbie when it comes to SQL Server, it would be helpful if someone could point me in the right direction. We have a database file that is called main-db.bak. This is the database file that we ...
4
votes
4answers
1k views

best ETL design to transfer transaction tables records into the data-warehouse

I have 2 type of tables to populate the data-warehouse with every day, lookup tables or configuration tables with few 100s records, and thats easy where i just truncate and refill the table. but for ...
1
vote
2answers
232 views

sql server-mirroring 3 sql server

we are developing an application for a company and this company has 3 branches, we design a SQL server for our application we can put this server in one of the branches but as the connection between ...
5
votes
2answers
480 views

How to determine when to reduce physical memory for SQL Server?

If I repeatedly notice SQL Server reporting a lot of free memory, can I likely remove about that amount of memory from the server without affecting performance? Or, can/should it use more for caching? ...
3
votes
1answer
250 views

Combine - Select Into, with Insert Into Select

I've read many explainations like this one here that say "Select Into ..." is to create new tables and "Insert Into ..." is to append to existing tables. I'm automating a coworker's sql scripts. ...
6
votes
2answers
497 views

Two Different Sources Taking Transaction Log Backups

I have inherited a database server with SQL Server 2005. The databases have full recovery mode with hourly transaction log backups. There are two sources taking full backups overnight and hourly ...
0
votes
1answer
38 views

migration sql 2003 to 2008, Sql side and php side [closed]

I have a system in php using MSSQL 2003. I need to change the database to MMSQL 2008. I want to know if there's issue I should look at on SQL Side (Query/SP/....) PHP Side (Query, connection type, ...
1
vote
2answers
113 views

Information on a Database that was restored with NO RECOVERY

I'm working with SQL Server 2008Sp3. I have a database that was restored from a full backup WITH NO RECOVERY and it then was restored with Transaction log backup files - also WITH NO RECOVERY. At ...
2
votes
1answer
2k views

SQL Server select with regex

Can we use regular expression to select the item from database? The table item is like below Table column|name| 10.01.02 | a | 100.2.03 | b | 1021.10.04 | c | Now my problem is that i ...
18
votes
2answers
7k views

Does a re-index update statistics?

I've been doing the MS10775A course this past week and one question that came up that the trainer couldn't answer reliably is: Does a re-index update the statistics? We found discussions online ...
0
votes
2answers
295 views

Access denied when disabling agent job, despite SqlAgentOperator membership

I am attempting to disable a SQL agent job from an account which a member of the SqlAgentOperator role (but not sysadmin) The doco says this should be possible 3 SQLAgentOperatorRole members can ...