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
2answers
124 views

Linked Server Has Run Out Of Memory

So I have a stored procedure that calls an AS400 Linked server. Now, the stored procedure will execute successfully. However, it is used in a SQL Agent Job and each time the job runs, it gives the ...
1
vote
2answers
79 views

Profiling feature for SQL server 2012

I'm using SQL Server 2012 to develop php/web applications. On my development machine, I have SQL server also. The php codebase is version controlled with git. The various applications we have (and ...
1
vote
2answers
194 views

What are the primary architectural differences between the backup formats of some of the more common RDBMS' and what advantage do they serve?

Of the systems with which I am familiar, I have noticed that SQL Server's native database backup format is binary and proprietary. PostgreSQL and MySQL allow for a simpler approach, dumping the ...
1
vote
2answers
409 views

How to give the least permissions for CRUD-managing and running SQLServerAgent jobs as well as Maintenance Plans?

Follow up to my question "What's the owner of SqlServerAgent job for?" Basically, I am trying to understand how to create a user-login with least privileges for CRUD-maintaining SQLServerAgent jobs ...
1
vote
2answers
314 views

What's the owner of SqlServerAgent job for?

What is the possible use of owner of an SQL Server Agent job, I wonder? Removed, and left it blank and the job still succeeds
1
vote
1answer
705 views

Any way to import-export-migrate-save-restore a maintenance plan without having SSIS installed (and running)? [duplicate]

I am having dozens of MSSQL Servers 2012 R2 on Windows Server 2008 R2 with similar setup, configuration (in virtual machines) in production. Neither has SSIS installed. I have to similarly maintain ...
1
vote
1answer
311 views

Approaches for Real time copy of database on same SQL Server instance

I have a draft of requirements that look like this: Production database should be copied in real-time to "Pre-prod" database The Pre-prod database should be available to read and update It should be ...
1
vote
2answers
963 views

Optimizing removal of duplicate rows from recursive CTE query

I need to write a recursive SQL query to fetch multiple projects together with their lineage from the following table: CREATE TABLE #Project ( Name VARCHAR(10), ParentName VARCHAR(10) ) INSERT INTO ...
1
vote
4answers
836 views

SQL Server Page Life Expectancy sharp drop

I'm trying to put my hands on the reason this SQL Server slows down sporadically. There are no patterns detected so far. It's a SQL Server 2008 R2 running on a Windows Server 2008R2 VM on top of ...
1
vote
2answers
1k views

Moving data in multiple tables from old database to one table in new database [closed]

I have two SQL Server 2008 databases. One is for my old application (full of data) and the other is for a complete re-write of my application. I want to migrate the data, but I have no idea how to ...
1
vote
2answers
612 views

How can I get a list of tables contained in a database diagram?

I need to get a list of the tables contained in a diagram in SQL Server. How can I do it using an SQL script? I don't need a list of tables in the database, but the list of tables contained in a ...
1
vote
3answers
128 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
2answers
5k views

Splitting a large table to improve performance

This is a follow-up to an earlier question. I have a SQL Server 2008 R2 Standard server, that holds a single database, which itself has almost nothing except a large table. The table is 100+ million ...
1
vote
1answer
346 views

Distributed - across multiple databases or servers - Transactions

I have some doubts related to transactions in SQL. I perform below steps. Connection 1 open for DB1 database Begin transaction for Connection 1 Run the commands on Connection 1 Connection 2 open for ...
1
vote
1answer
117 views

CTE query doesn't print the right structure?

I have this table which represents hierarchy : childID parentID NAME siblingOrder 1 1 a 0 212 1 ab 1 112 ...
1
vote
3answers
2k views

Import .bak file in Microsoft SQL Server 2008 Service Pack 3 [duplicate]

I have a backup of my database as a TestDatabase.bak file but I am unable to restore it. When I try to restore I receive the following error message in SSMS: RESTORE could not start database ...
1
vote
3answers
788 views

Restore database - maintenance plan task

I need to schedule a task that restores a database once a week from a backup. I have setup maintenance plans for backing up databases (Management > Maintenance Plans) but cannot find out how to make a ...
1
vote
2answers
4k views

How to restore SQL Server database with mirroring

I have SQL Server with mirroring. I am trying to restore the database using the command: USE [master] ALTER DATABASE [CentralStorage] SET SINGLE_USER WITH ROLLBACK IMMEDIATE RESTORE DATABASE ...
1
vote
2answers
4k views

Database running out of space

My database has 16MB of space left. I used to just truncate as I was taught but I found these links that advise against truncating: ...
1
vote
3answers
446 views

How to create new users for restored databases?

I am not too familiar with SQL Server and am facing the following problem: The server was freshly installed and the only existing login is sa. Then a couple of databases were restored from earlier ...
1
vote
2answers
147 views

Why does this 120 GB insert grow the log by over 780 GB?

A table [tbl_old] has about 3 billion rows and about 120 GB for disk space, and then created a [tbl_new] with the same schema (actually, just dumped the script of [tbl_old], then rename the table name ...
1
vote
3answers
369 views

Performance issues moving 1 million rows between tables

I want to replicate 1 million rows from table1 to table2. I have written a job with a query like this: delete from table1 OUTPUT *.delete into table2 I am executing this job every hour, but it ...
1
vote
3answers
559 views

Is transaction log lost after backup on SQL Server?

I have database that has regular nightly backup (full recovery, full backup). I noticed some irregularities in data and wanted to check out transaction log to see what happened. I restored earlier ...
1
vote
1answer
3k views

How to recover data from corrupted SQL Server database?

We had several power outages and server rebooted couple times which seemed to cause issues with one of the databases. We tried detaching at attaching database again but it looks like database is ...
1
vote
1answer
451 views

How can I change SQL Agent Log file to use unicode format?

I've created a database with tables that heavily leverages nvarchar for most of the columns. One of the challenges I'm running into is that when I go to view the SQL Server Agent Log files, I get the ...
1
vote
2answers
214 views

How to link each column in sql?

I have been working around on a query given by one of my developers who works on crystal reports as a junior DBA, I always like to help them even though I am busy with other things as it will increase ...
1
vote
2answers
253 views

Multiple schema or multiple databases for better performance

I need to improve the performance of our entriprise search application(.net) from the database point of view. The app already has 4 schemas on a separate sql server 2008. 2 schemas for front-end ...
1
vote
0answers
495 views

SELECT value from database over ODBC wont reach the software [closed]

SQL Server 2008 R2 latest updates. SQL server ODBC driver version 6.01.7601.17514 PS!!! native drivers are incompatible with the software so i cannot use them. I cannot edit or change the server ...
1
vote
1answer
3k views

Restoring an SQL Server 2012 MDF to SQL Server 2008 [duplicate]

Possible Duplicate: Restore SQL Server 2012 backup to a SQL Server 2008 database? I have created a database on SQL server 2012 with compatibility mode for SQL server 2008 (100). When I do a ...
1
vote
1answer
160 views

Follow up to certificate sharing question

Follow up to the post Sharing certificates encryped by password between DBs and instances I created a certificate with a password CREATE CERTIFICATE testcert ENCRYPTION BY PASSWORD = 'test123' ...
1
vote
1answer
893 views

SQL Server 2008 R2 : multiple files and filegroup

I am getting bit confused regarding advantages of multiple files and filegroups in SQL Server Using SQL Server 2008 R2, I have following filegroups and files configuration Drive D: Primary Filegroup ...
1
vote
1answer
172 views

Hard Drive Configuration for my setup

I have a fairly large transactional database (100GB) with a lot of users. The database access is solely via stored procs that make heavy use of temp tables, table variables, cursors and other fun ...
1
vote
2answers
300 views

Editing built-in templates in Management Studio

I'm running SQL Server Management Studio 2008 (10.0.5500.0) and was attempting to edit the built-in template "Create T-SQL Trigger (New Menu)". I open the Template Explorer, right-click the template, ...
1
vote
2answers
793 views

SSIS error Property BackupDirectory is not available for Settings

I am trying to edit the SSIS Back Up Database Task And it gives the folowing error Property BackupDirectory is not available for Settings 'Microsoft.SqlServer.Management.Smo.Settings'. This ...
1
vote
1answer
359 views

Going from separate databases to shared databases and schemas (Multi Tenant Data Architecture)

I am eagerly trying to design the perfect multitenant data architecture for my database. I am getting inspiration from an article posted by Microsoft, based on scenario 3. I have been given all my ...
1
vote
3answers
118 views

DBCC CheckDB Consistency error on a empty table

What could be the reason behind a DBCC CheckDB reporting a consistency error on a empty table in sql server 2008? This DB is restored from sql server 2000. DBCC CheckDB on sql server 2000 doesnot ...
1
vote
3answers
399 views

SQL Server 2008 eval expired

I have (more than one instance) some of my experiments with SQL Server 2008 eval (why eval --> brutal bureaucracy about using licenced version for testing or short life-cycle experiments), and after ...
1
vote
1answer
513 views

How to setup daily SQL server export to csv text file?

We are exporting 100,000+ rows from a SQL Server 2005 DB to a text file. We have a web script setup to read all rows and then write the text file and it takes over 5 minutes to complete that script. ...
1
vote
1answer
13k views

How to determine used/free space within SQL database files?

I normally use the following method to determine the free/used space within each file of a database: Select *, fileproperty(name, 'SpaceUsed') as Used From dbo.sysfiles This returns total and used ...
1
vote
4answers
3k views

Attaching database to the SQL server

I have the following error The database 'Test' cannot be opened because it is version 661. This server supports versions 655 and earlier. A downgrade path is not supported. Usually this kind ...
1
vote
2answers
305 views

Best type to use in a composite key when one of the values varies in type

I am building a data store for the content of multiple blog sites which have been scraped. Each of these sites is going to have an entry in a Blog table BlogId Url ...
1
vote
2answers
738 views

Restore System Databases from MDF/LOG files

We recently experienced a hardware failure that caused our SQL 2005 server to take it in the dump. The good news is that we have the MDF and LOG files for all the databases, the bad news is that we ...
1
vote
1answer
704 views

Cartesian Product SQL / Inserts with multiple Values Clauses

I want to create cartesian product sql query.But,I'm getting the error.Where I wrong? alter table #Personel ( Ad varchar(100) ) alter table #Masa ( MasaAdi varchar(100) ) insert into #Personel ...
0
votes
0answers
37 views

SqlServer: can one table's PK be the FK of two table's?

I have three tables project, users and proj_user. The PK of proj_user table is the FK of project and users table's pk e.g.(project_id,user_id) My question is, is it possible if the project_id and ...
0
votes
2answers
55 views

Set default value for all columns with specific name within a database

I've got a database that includes an int column project_id on many tables, and I want to script setting the default value to a specific value for all columns with that name in the database. Note that ...
0
votes
1answer
154 views

SQL Server 2014 Install Not Creating Default Instance [closed]

I am trying to install SQL Server 2014. The problem that I am having is that during the installation it is not letting my choose whether I want to use a default or a named instance. I have been ...
0
votes
2answers
73 views

How to provision the SQL Server Agent service after SQL Server Edition upgrade

I have upgraded SQL Server 2008 R2 Express to SQL Server Standard Edition. After I have upgraded it, the SQL Server Agent was stopped. I have tried to start but it fails. Only when I have changed ...
0
votes
2answers
190 views

Get Date Limitation

So what I need is a limitation for the user of the funded contracts. So this is what I am trying to implement. I am trying to let the user enter dates within the year 2014, which will bring up how ...
0
votes
1answer
134 views

How can I count different types in a column in sql?

Data: QID Type DOB ------------- 1 1 01/01/1980 1 2 03/01/1981 1 2 01/02/1991 1 1 01/01/1980 1 2 03/01/1981 ...
0
votes
1answer
26 views

Create a certificate with a private key

Reading this answer I have a question about it: How can I create a certificate with a private key in my app database?