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

Delete back ups more than 2 weeks in sql server

I am not a DBA, I need to delete the USER_DATABASE backups older than 2 weeks. Is this below stmt work for this scenario? EXECUTE dbo.DatabaseBackup @Databases = 'USER_DATABASE', @Directory = ...
0
votes
1answer
50 views

Update and Insert Statement taking forever

I have a database with two columns that is called using the following query: SELECT TimesUsed, Word FROM Predictions WHERE (Word LIKE @partialWord) ORDER BY TimesUsed DESC In my application it is ...
0
votes
1answer
23 views

Selecting row multiple times, as specified by a field in that row

As part of an redesign, there's need for an different schema in one of the main tables in our database. The data in one of the existing tables will be kept as legacy data. To make the changeover ...
3
votes
1answer
20 views

What is the PREEMPTIVE_REENLIST wait type in Microsoft SQL Server 2008 R2

This is not urgent, just curiosity. QUESTION: I was trying to troubleshoot a slow server today, and I came across a high figure for a wait type called PREEMPTIVE_REENLIST. I'm not able to find this ...
4
votes
4answers
94 views

Conversion of a varchar data type to a datetime data type resulted in an out-of-range value

I am trying to run a simple query to get all rows created in November: SELECT COUNT(*) FROM dbo.profile WHERE [Created] BETWEEN '2014-11-01 00:00:00.000' AND '2014-11-30 23:59:59.997'; SMSS ...
2
votes
2answers
135 views

Lines starting with colons in SQL Server

Playing around with DB projects, Visual Studio generated a change script with the following lines: GO SET ANSI_NULLS, ANSI_PADDING --etc.; SET NUMERIC_ROUNDABORT OFF; GO :setvar DatabaseName "Foo" ...
0
votes
0answers
48 views

SQL Server 2008 R2: After Insert Trigger and Query returning unexpected results for a split second

I am having trouble with an After Insert trigger and a query running right afterwards. The query goes and finds the most current record in each table by using OUTER APPLY with a table-valued ...
2
votes
3answers
435 views

Releasing Free Space

I am running a rather large database on SQL Server 2008 R2 Express. Recently I hit the 10GB limit, so the system would not allow me to create anymore objects, ect.. I have archived off a very large ...
1
vote
1answer
59 views

Indexed View - how to verify if it is worthy?

I have the following indexed view: CREATE view VProcessStatus WITH SCHEMABINDING AS select processstatus, StatusCount = COUNT_BIG(*) FROM DBO.tbltaxtransaction GROUP BY ...
1
vote
1answer
17 views

Create a log file for check which time import has been done and to split the import files

How to create a log table for when does the last import has been done and also for Query for split the records in to 1000 while importing. to avoid the bulk insert For example : If the data ...
4
votes
2answers
55 views

Using Database Engine Tuning Advisor in production

I have a SQL Server 2008R2 OLTP database which is experiencing performance issues during work hours. I would like to run Database Engine Tuning Advisor on this instance but I don't know how it will ...
0
votes
3answers
61 views

I do not understand SQL Server Transaction Logs

I understand that a Microsoft SQL Server Database has two components: A database file A transaction log file Whenever I make a change to a table, does it get written to both the database file AND ...
-1
votes
0answers
29 views

Database design for different wildlife types

I am planning to design a database for wildlife details (such as fishes, birds, and animals) in a certain state, e.g. what kind of wildlife is present. I have created a table in SQL Server 2014 in ...
4
votes
0answers
27 views

Enabling TDE in SQL Server with mirror without breaking existing mirror

I've been trying to enable TDE in a mirrored SQL Server 2008 R2 configuration. Enabling TDE is not so difficult, though when I enable TDE on the principal, the mirror database goes in to a suspended ...
0
votes
1answer
71 views

Small business SQL Server

I'm asking the experts.. I work in a small business (<10 employees) but I need a production database. I wouldn't go as to say I'm a DBA but I well versed in creating databases, tables, ...
2
votes
1answer
131 views

Alter table and update in sql server transactions

I'm trying to do an alter table to add a new column on a table, then I would like to do some update on the existing rows in the table to add a value to the recently new added column and finally do a ...
3
votes
1answer
44 views

for xml missing null columns

When we use for xml clause to create xml from a row like as follows select * from Menus where MenuID=100 for xml path('') The xml will miss the columns which have NULL as the value. I have a found ...
-2
votes
0answers
44 views

What are the alternates to replication? [duplicate]

I don't have any experience with database administration. What are the alternatives to replication in SQL Server (one-way)? I am looking for an alternative mainly because of the licensing. The ...
1
vote
0answers
9 views

“Skipping the default startup of database” SQL notification for AlwaysOn Cluster

So I set up our SQL servers to notify us of alerts at severity 17 or higher (as advised by various SQL Server articles). I've done this to each node of a SQL Server Always On Availability Cluster, ...
2
votes
2answers
66 views

What SQL Server database version do I need?

I am not a database experts but part of the project I am currently interested in accepting requires to do a DB replication. The system will have many outlets... says Site A, Site B, Site C, etc.. ...
2
votes
1answer
48 views

Threshold for sort spill and random cardinality estimates

I wanted to test tempdb spill warnings so I run the following script on SQL Server 2014: USE tempdb IF OBJECT_ID('tempdb..tblTest') IS NOT NULL DROP TABLE tblTest CREATE TABLE tblTest ( ...
-1
votes
1answer
47 views

How to know which columns value is different between two rows

I am trying to compare two addresses from the same ID to see whether they match. For example: Id Adress Code Address 1 1 123 Main 1 2 123 Main 2 1 ...
1
vote
1answer
41 views

How to join a table with a table valued function?

I have a user defined function: create function ut_FooFunc(@fooID bigint, @anotherParam tinyint) returns @tbl Table (Field1 int, Field2 varchar(100)) as begin -- blah blah end Now I want to join ...
1
vote
1answer
33 views

Dual site active-active highly available database

I have an application that is being run on two separate sites. Ideally they would share a database, because each application needs to see what the other is writing to the database. However, the sites ...
1
vote
1answer
38 views

Create copy of Azure SQL Database using SQL Server Management Studio

When running the following query on an Azure SQL Database "Master" in SQL Server Management Studio: CREATE DATABASE myDbBackup AS COPY OF myDb; The following error is produced: Msg 40818, Level ...
2
votes
1answer
84 views

Database with multiple .mdf files

I have search online but not found what I am looking for. The problem/query is to my knowledge a database in SQL Server should have One .mdf file and maybe some .ndf files and One .log file. I ...
2
votes
1answer
68 views

Ola Hallengren index maintenance - long periods of time between commands?

I run the Ola Hallengren scripts on all of my servers for index and statistics maintenance. When I look through the command log table, I notice long periods of time between a command ending, and the ...
0
votes
2answers
22 views

ASPStateTempApplications and ASPStateTempSessions tables creation in tempdb after sql server restart

I have a implemented SQL server session state management. So created ASPState database and ASPStateTempApplications and ASPStateTempSessions tables in TEMPDB database. When I restart SQL Service, ...
-3
votes
0answers
27 views

What is the best database design for blogging service [closed]

I am writting a blogging service that people can make sites in it. But I want to have an echaustive database design to have all sites information in one place. It means for an example I want to have a ...
4
votes
2answers
66 views

How to get COUNT of a range between 2 columns

Table: Staff | StartingTime | EndingTime | starthour | endhour ------------------------------------------------------------- 10 | 0813 | 1610 | 08 | 16 20 | ...
2
votes
4answers
139 views

Identical tables, identical columns, identical records, but why different record sizes?

Identical tables, identical columns, identical records, but why different record sizes? USE [test] GO CREATE TABLE [dbo].[mybit]( [col1] [bit] NOT NULL, [col2] [bit] NOT NULL, [col3] ...
1
vote
1answer
37 views

XACT_ABORT OFF vs COMMIT in trigger

I have a trigger on a table that kicks off several other processes. However, I would like to ensure that even if the other processes fail, the insert is successfully committed to the original table. ...
1
vote
0answers
32 views

Why does retrieving fewer rows take longer? [duplicate]

I have a view that (left outer) joins multiple recursive CTEs. There are about 10k rows. The results of running SELECT * FROM MyView ORDER BY MyPrimaryKey, with statistics time and io on: SQL Server ...
1
vote
1answer
42 views

Next value for Sequence Function

Why does this give me the same value, four 1? USE [TSQL2012] GO IF OBJECT_ID('dbo.sqlsequence', 'SO') IS NOT NULL DROP SEQUENCE dbo.sqlsequence; GO CREATE SEQUENCE [dbo].[SQLSequence] AS INT ...
1
vote
1answer
23 views

SQL Server - Log Shipping Into an AlwaysOn Availability Group

I have a requirement to build an AlwaysOn Availability Group, which I have done. Now the user wants me to set up log shipping from another server into the AlwaysOn Availability Group. I’m not sure ...
2
votes
2answers
63 views

Copying a database that is in Retore status

I have a database that needs to stay in restore mode (NonRecovery), I receive a new group of log files that I receive daily that I have to post to it. How can I copy the database while it is in non ...
0
votes
1answer
23 views

The message “Running the Merge Agent process would exceed the maximum number of processes allowed” appears, but it doesn't seem likely

The full text of the message is "Running the Merge Agent process at this time would exceed the maximum number of processes allowed by this publication. The process will run when resources become ...
1
vote
1answer
41 views

Migrate SQL Server binary datadump to postgresql

I just got a very big dataset (+/-55GB) in a binary SQL Server format. Is there an easy way to import this file into a Postgresql Server? I found some converter-programs, but they 'only' convert ...
1
vote
1answer
51 views

Is someone trying to hack into my SQL Server Database?

I was asked by a friend, who isn't technical at all, to help her with her application. I thought I would just being doing a little C# development and some SQL queries. Turns out it has been a lot ...
0
votes
0answers
48 views

How can you tell if a SQL Server instance max'ed out bottleneck is CPU or Memory?

How can you tell if a Microsoft SQL Server instance max'ed out bottleneck is CPU or Memory? This SELECT-INTO statement on a 8GB box with two 2.6Hz processors. CPU seems busy, goes up and down but ...
0
votes
2answers
27 views

good strategy for big tables and archiving in sql server 2012

I have a table with roughly ~500,000 rows a day getting added into it. The database supports an OLTP system. The make up of it is a bit like this: create table Stuff (StuffID int identity not null ...
-1
votes
2answers
32 views

Trimming the first and last characters from a field [closed]

I have a column like this DATE "112113" "011414" and so on.. I want to remove the first and last characters from the entire DATE column, i.e. I want to get rid of these "". Please help.
4
votes
1answer
111 views

sp_prepexec (sp_execute) vs. sp_executeSQL

The meat of the question: Are actual SPROCS the only mechanism that implements temp table caching or do system sprocs such as sp_executeSQL / sp_execute also take advantage of them? I am not a DBA, ...
0
votes
0answers
19 views

Unable to patch,uninstall or repair Reporting Sevices

I appear to have a corrupt installation of Reporting Sevices (2008) that I cannot repair or uninstall. Trying to repair this feature I get an error Message that says "The SQL Server feature ...
-3
votes
0answers
27 views

I want to reduce SQL Server Transaction log file size [duplicate]

I have 7 TB of db and this db having 3 data files and 5 log files. In this 5th log file having 1.2 TB space. And this db is in bulk-logged recovery model. Now what are the steps needs to do for reduce ...
1
vote
1answer
34 views

Granting permissions to SSIS for developer

I installed SSIS a couple of months after installing SQL Server 2014. I granted permissions to users per MSDN and rebooted SSMS and SSIS. I can login remotely from my client without issue, but have ...
2
votes
2answers
39 views

SELECT permission denied trying to import data into Excel

We recently migrated to a newer version of a program and migrated its database from SQL Server 2000 to SQL Server 2008 R2. We had some Excel files which ran a few custom queries to pull data. I ...
1
vote
1answer
41 views

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' [duplicate]

Hi I get this error when connecting to SQL Server remotely from a website. I checked the SQL Server logs and get the error: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. Reason: Token-based ...
1
vote
0answers
29 views

Database backup hangs both in SSMS and XMLA

I am using SQL Server Analysis Services 2008 R2 Service Pack 3. My database was recently upgraded from Analysis Services 2005 and since that time I have been unable to do a backup either from SSMS or ...
0
votes
0answers
20 views

SQL Server 2014 upgrade

I currently have websites running on SQL Server 2008 R2 - this is the version I also have installed on my own machine. I'm looking at moving my websites to a different provider, however they only run ...