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

Subscription fails with Incorrect syntax near '9'

In my Distributor To Subscriber History I get the following error: Command attempted: 9 (Transaction sequence number: 0x0018E94F0000207A006200000000, Command ID: 59) Error messages: ...
0
votes
1answer
51 views

SQL Server 2000 Backup fails with Status = 33

I am trying to take a Full Backup of a database size about 75GB. It is SQL Server 2000 - 8.00.2055 x86 version. I have plenty of disk space where the backup is being created. So disk space isn't an ...
5
votes
1answer
57 views

Full Text Search Term Casing Affects Results

I have been experiencing a full text problem when searching using CONTAINS. I have the full text catalog accent sensitive setting set to false. The table contains following rows: Microsoft C# ...
-3
votes
3answers
70 views

SQL cache hit ratio [closed]

I have install SQL server, but when i check report of DB there is cache hit ratio which is 98.92%. Is it harmful for sql, if yes then how to reduce it.....? please give me solution for that. thanks, ...
3
votes
1answer
63 views

Microsoft SQL Server Connection Coloring

I've been using the Redgate Query Tab Coloring feature (under SQL Prompt's Experimental Features) and I really like it. Somehow I've never known until today that this feature is built in to SSMS for ...
0
votes
1answer
29 views

How to find when change tracking was enabled?

How can I determine when change tracking was enabled on a table in a SQL database? Assume that this table has a regular cleanup routine, which means that looking at the oldest record in the change ...
3
votes
2answers
68 views

Designating databases to certain CPUs

SQL Server 2012. AlwaysOn Cluster with two nodes, each has 4 cores We are consolidating SQL server instances and moving bunch of databases from various locations to a single cluster which has two ...
0
votes
1answer
27 views

Script to Add a Job to a SQL Server DB

I want to add a job to my DB to make a back up weekly but i want to do it from an script, i've serched and with what i found i made this: CREATE SCHEMA job go CREATE PROC BACKUPS @dir varchar(max) AS ...
0
votes
0answers
88 views

Transaction log full due to log_backup

I am testing how certain operations are logged under different recovery models.Below are steps i have did till now 1.create database in full recovery model 2.take backup 3.create a table and insert ...
2
votes
2answers
82 views

Filtered index not chosen, and rejected with hint

I'm trying to understand why a non-clustered index is not available for a given query when filtered. The relevant part of my (large) query is this: ) results JOIN BE_Insurance ins ON results.PayorId ...
1
vote
1answer
21 views

Enable Agent Database Mail - TSQL

I have several new servers that need Database Mail configured on them. I found the TechNet article describing how to add the profile and account via procedure calls, but is there a way to enable ...
0
votes
0answers
35 views

Migrating SQL Server 2008 R2 to SQL Server 2014. What are the importing replication changes?

We currently have SQL Server 2008 R2 on our server. I now have the opportunity to migrate to SQL Server 2014. The database we use isn't large. Migration of data is not a issue. The question I have ...
1
vote
1answer
57 views

SQL Server data structure (in protocol)

If I have a Book table and Author table, with Book having a foreign key to Author, many rows in Book may have the same author. If I then run this query: SELECT * FROM Book INNER JOIN Author ON ...
11
votes
1answer
234 views

Why aggregate operator used after unique index scan

I have a table with a unique index filtered for non-nullable values. In the query plan there is use of distinct. Is there a reason for this? USE tempdb CREATE TABLE T1( Id INT NOT NULL IDENTITY ...
0
votes
1answer
20 views

Don't delete exist data with SSMA

I'm trying to use Microsoft's SQL Server Migration Assistant for Sybase 5.3 ('SSMA') to migrate multiple Sybase databases (that have the same schema) to a single MSSQL database. The first database ...
0
votes
1answer
45 views

Does it make sense to order condition in where query?

We have a clustered index in table Tbl with order of A,B,C. Does it make senses to write a query to have WHERE A = @a, B = @b, C = @c or it'll be as same as WHERE C = @c, B = @b, A = @a Does the ...
0
votes
1answer
54 views

Database going to Suspect mode [closed]

I have a frequent problem, that is one of my databases goes to suspect mode. Many times I have recovered it with: ALTER DATABASE Your_Db SET EMERGENCY DBCC checkdb('Your_Db') ALTER DATABASE Your_Db ...
2
votes
1answer
32 views

Reporting services scheduled reports are clogging up sql job history log

This is a bit of a cross-disciplinary question - Hopefully I’ve posted in the right place. SQL server 2008 R2 Question: How can I limit the number of rows in [sysjobhistory] for specific jobs, ...
0
votes
0answers
53 views

Last few rows from a non-indexed table in Oracle

I'm trying to run a query on an Oracle DB through SQL Server [dont' ask, it's a requirement] The Oracle table in question [lets call it hugeTable] has over 200 million rows and no index. I'm not ...
0
votes
1answer
43 views

Is it possible to create a function in SQL server to act as clause e.g. Where or Limit

I've found a simple way to mimic the limit clause is SQL server by using SELECT * FROM customers OFFSET 22 ROWS FETCH NEXT 5 ROWS ONLY I'd like to replace those two line with LIMIT(22, 5) e.g. ...
0
votes
3answers
61 views

What is the quickest way to restore a DB

Lately I have been finding myself restoring a DB to my local instance of SQL-server a lot more. I wanted to speed up the process by writing a script and then just executing it in order to restore over ...
0
votes
2answers
47 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
29 views

Extra column when migrating Sybase databases to single SQL Server database

I'm trying to use Microsoft's SQL Server Migration Assistant for Sybase ('SSMA') to migrate multiple Sybase databases (that have the same schema) to a single SQL Server database. All of the tables in ...
0
votes
1answer
26 views

How to install/enable DAX functions in SQL Server [closed]

How to install/enable DAX functions in SQL Server? I want to pivot and use some Excel functions in SQL Server
0
votes
0answers
21 views

Setup for Availability Group with Analysis Services

We currently have one server with the Database Engine, SSAS, SSRS and SSIS all running on it. We are moving to a two server Availability Group setup. Currently I am not too worried about resources ...
2
votes
1answer
83 views

Database design for a table with both bulk insert and single row insert

I have to design a table where records will be inserted in two ways. Bulk insert from a batch process from a delimited text file between 2 - 3 million rows in a short burst. Later the same records ...
0
votes
1answer
37 views

Store logging in separate or existing database?

In a .NET WebForms project we want to log certain actions in a database for a year. The estimate is that the log will have a maximum size of 1GB (20.000 records per day of 10 fields) that will ...
1
vote
0answers
38 views

SQL Server : ALTER TABLE tablename SWITCH PARTITION 2 to tempempty

Have a sliding partition where I need to remove the trailing partition when they expire. I create an empty table that matches the existing table. When I create the empty table, I specify the file ...
0
votes
0answers
28 views

How to extend the Central Management Server in SSMS?

I'm looking into Central Management Server and I'm a bit surprised there's no 'Custom Reports' node in SSMS to add things into. It seems like that's exactly where you would want to place something ...
1
vote
0answers
50 views

Is it possible to use a temp table in a data flow source?

I have a data flow in a 2012 SSIS package where I'm trying to use a temp table as the data source. I'm using an OLE DB data source with a SQL Command Data access mode. My code looks like this: ...
2
votes
0answers
33 views

Slow Performance of Parametrized Query in Excel due to Parameter Datatype

I'm pulling Data from a SQL Server 2008 into Excel using a Parametrized ODBC Query created by the Excel Wizard. (Data-->getExternalData/FromOtherSources-->FromDataConnectionWizard-->ODBC DSN) My ...
2
votes
1answer
46 views

Temporarily splitting a SQL Server cluster

I currently have a pair of database servers up and running separately, but with the same structure and (hopefully) the same data on both of them. The applications that utilize the data from these ...
0
votes
0answers
49 views

SQL Server Agents Jobs failed when executed on schedule but succeeds when executed manually

I have a SQL job running an SSIS Package. This job can run manually but failed to run on schedule. The below is the error message generated. Any help will be highly appreciated. Code: 0x4004300A ...
0
votes
0answers
52 views

Index Tuning Question

I have the following query: SELECT T1.ITEMID, T1.ITEMTYPE, T1.PURCHMODEL, T1.HEIGHT, T1.WIDTH, T1.SALESMODEL, T1.COSTGROUPID, T1.REQGROUPID, T1.EPCMANAGER, ...
4
votes
2answers
128 views

How to write a query which finds all circular references when a table references itself? (II)

I have the following schema (names changed), which I cannot change: CREATE TABLE MyTable ( Id INT NOT NULL PRIMARY KEY, ParentId INT NOT NULL ); ALTER TABLE MyTable ADD FOREIGN KEY ...
0
votes
1answer
50 views

How to deploy SSIS package with XML config, using SQL agent

I wonder if anyone can help me with a question. Context I've created a database which needs a front end in MS Excel. When the user presses upload button I want it to start an SSIS package which moves ...
1
vote
2answers
70 views

Update on view over partitioned tables updating all indexes

We have a table, which is partitioned through a date field into separate years. There is a view over all of these tables (Call) Schema is as follows: CREATE TABLE [dbo].[Call_2015]( [calID] ...
2
votes
2answers
370 views

SQL Server : what licence is required? [closed]

I want to use SQL Server for a big project and was wanting to know what licence is needed, Enterprise or Standard? I have 2 servers and I'm looking to have the first as a primary and the second as a ...
1
vote
2answers
115 views

Converting a varchar date into a date (dd/mm/yy)

I have a CSV file that has dates written like this: 250909,240909 and they get stored in a SQL Server database as varchars. How do I get it to convert them into dates so that it gets displayed like ...
0
votes
0answers
12 views

Multiple Trace Files or Replay

I am just wondering how useful the replay functionality of SQL profiler is. The issue I have is that I can capture a workload from production with little overhead, however I would not be able to ...
0
votes
0answers
38 views

How to avoid copy of audit trace files

My database is copying all of SQL-Server trace data file everyday. The result is I have to delete them manually everyday because hard disk gets filled. How can I stop this?
0
votes
1answer
62 views

Create multiple variable columns from single column value

The following code gets the number of days for a specific month set in @month DECLARE @month tinyint , @Days varchar(max) SET @month = 1 -January ;WITH DaysInMonth AS ( SELECT DATEADD(month, ...
1
vote
1answer
45 views

Cannot open database “user_auth.mdf” requested by the login. The login failed. Login failed for user 'web_user'

I am trying to deploy my first VB.NET application on GODADDY. I created a SQL server database and was able to create tables using SQL Server Management Studio. I created a user web_user and was able ...
1
vote
2answers
56 views

Undo Deleted Records [duplicate]

My Database has Full BackUp Plan on Every Morning on 01:00 Am. Today I came to work and Deleted all of the Records in a table by mistake in sql server management Studio by running this command delete ...
-1
votes
0answers
28 views

How to merge multiple .ndf files into 1 .ndf file

I have a partitioned table that has boundaries of a single day by a daytime2 partition function. The range of the partition scheme is right and each partition is in a separate file within separate ...
0
votes
1answer
41 views

sql expiry date use Trigger OR Schedule a Job

I have this table : Now, i like the way when the date expires. EndTime < GETDATE() expire field is true. What method should I use? use a trigger to true or a schedule job that run before run ...
1
vote
1answer
56 views

Execution Plan in Microsoft SQL Server

I have a stored procedure in my database. As per my knowledge it's pre-compiled subroutine. Question 1: If I execute following queries from Hibernate, will database create a separate execution plan ...
5
votes
3answers
182 views

Rebuilding an entire Microsoft SQL Server Database

Is there a suggested way to rebuild an entire SQL Server database from another database in SQL Server 2012 SP2? Let me explain... we have a database that we are trying to enable partial containment ...
1
vote
1answer
54 views

Create Meaningful Visualization for Large Set of Tables [closed]

I'm trying to create a meaningful, usable visualization for my company's ERP database. I've extracted a skeleton of the database so I can make changes without modifying the production environment. ...
0
votes
1answer
51 views

Text Storage and Database Design Optimization in a SQL Server Database

Given a database with a number of columns (c), where some of these columns contain text that is one of multiple values due to a set CONSTRAINT on the columns, what is the most efficient way to ...