All versions of Microsoft SQL Server (not MySQL). Please also add a version-specific tag like sql-server-2016 if that is relevant to the question.

learn more… | top users | synonyms (2)

1
vote
0answers
35 views

Total billions of rows and daily millions of row insert: What database system suits best

We developed a system with very high volume of data but very simplified data structure. We had only cellX, cellY, timeStamp and value columns. Operations are: Insert 455+ thousand rows per day ...
0
votes
0answers
8 views

Database Server Daily Errors Check script [on hold]

Could anyone point me to script that I can run daily and report on the previous day's errors and warning coming from the SQL Server error logs including failed jobs and probably also windows event ...
1
vote
1answer
15 views

Differential backups are 2/3 the size of the full backup

I was investigating why my differential backups were taking almost as long as my full backups and I noticed that the size of the first differential backup after the daily full backup was 2/3 the size ...
3
votes
1answer
40 views

How do I change table used in from clause of a select based on udf parameter?

I have two tables A and B (with exactly the same columns and overall structure) and I'm trying to create a TVF with a select inside it that chooses to use A or B based on a parameter passed to the ...
3
votes
2answers
66 views

Is connection string's default database used if queries are run against other databases?

Let's say I have an app that uses this connection string to connect to a SQL Server using "DB1" as the default database (a.k.a. initial catalog): Server=myServerAddress; Database=DB1; User ...
5
votes
1answer
70 views

Index Allocation Maps

I am a developer reading the book "Querying Microsoft SQL Server 2012." I have come across the following diagram: Why are the pages in the first two rows of the diagram (row 1 starting: 1:174 and ...
0
votes
0answers
20 views

DBA training/conference suggestions [on hold]

I recently transitioned from a developer role to a DBA role at my job. My boss wants me to attend some kind of training or conference this year. I maintain several Drupal websites that run on Ubuntu ...
0
votes
1answer
13 views

Assign a unique count to each row in the resulting table of a select statement

Let's assume we have a simple database that has the following schema: Article(Id, Body, AuthorId) and Author(Id, Name). Suppose that we want to develop a page where each author will be able to view ...
0
votes
1answer
46 views

Creating a database for the first time, (I'm new at this) [on hold]

So first thing first. I basically a student worker for a college department for career success, which is brand new and starting from scratch. I am not a Computer Science major or developer by career. ...
0
votes
0answers
6 views

SSPI handshake what does this mean [duplicate]

DESCRIPTION: SSPI handshake failed with error code 0x8009030c, state 14 while establishing a connection with integrated security; the connection has been closed. Reason: AcceptSecurityContext ...
3
votes
0answers
36 views

The transaction log for database 'database' is full due to 'LOG_BACKUP'. Nothing works

I have about 30 databases on SQL server 2012. One of the databases is erroring with "The transaction log for database 'database' is full due to 'LOG_BACKUP'." I have spent several hours googling and ...
0
votes
2answers
42 views

TSQL Delete All dates and stores data

This might sound like a stupid question but I can't seem to find a better way. It's a posting system where stores send us info on a daily basis (can be for multiple days). That info is placed in ...
0
votes
1answer
23 views

I would like to emulate the Microsoft SQL Server function GetSqlBinary() in MySQL version 5.6

I would like to emulate the Microsoft SQL Server function GetSqlBinary() in MySQL version 5.6. The C# namespace System.Data.SqlClient implements GetSqlBinary(), which is like fetching a blob.But the ...
0
votes
0answers
12 views

Odd service broker behavior

I have an established service broker relationship between two databases in our production environment. We do a weekly restore of these databases to another server for the purposes of testing our ...
2
votes
1answer
41 views

Behavior of case sensitivity of RAISERROR when run remotely

I have a remote SQL Server that I can connect to using a local instance of SSMS. When raising errors, we use RAISERROR( 'This works', 16, -1 ) Remotely, this works fine if it's all uppercase, or ...
1
vote
1answer
23 views

Does @@FETCH_STATUS have (or need) an equivalent to SCOPE_IDENTITY?

MSDN advises that @@FETCH_STATUS be used with care because it's global: Because @@FETCH_STATUS is global to all cursors on a connection, use @@FETCH_STATUS carefully. After a FETCH statement is ...
-2
votes
0answers
44 views

T-SQL Window over Window?

Ok, I already know window over window doesn't work, at least not on the same select. But I have this, almost a puzzle, to solve: (btw, that's a print in pt-BR, "soma" = "sum".) Columns N and O ...
4
votes
1answer
195 views

Logon Trigger preventing any connection

I was testing a logon trigger to restrict connections to certain IPs. It looks like the trigger was not correct. Now I can't log in to the server even as SA. Is there a way to fix this?
-4
votes
1answer
13 views

How long to keep order data in tables in a database [on hold]

How far back should you store data and when should you move the data off the production eCommerce site to a data warehouse? Can someone provide some links. I would think you would want to keep your ...
1
vote
1answer
31 views

Concatenate data in a single row [duplicate]

I have the following table: TicketID Type Code 44899B82-41C9-4020-9C2B-007C6000D283 ARTI 22150012 44899B82-41C9-4020-9C2B-007C6000D283 ...
0
votes
0answers
25 views

Limit number of entries written by Logon-Trigger

We are auditing connections to our SQL server by using a logon trigger. (SQL Server 2008 Standard Edition.) However what we are seeing is that there are always a number of entries logged for each ...
6
votes
4answers
212 views

Progress of SELECT INTO statement

Our ETL flow has a long-running SELECT INTO-statement, that's creating a table on the fly, and populating it with several hundred million records. The statement looks something like SELECT ... INTO ...
0
votes
0answers
19 views

SQL Server 2008 Patch Installer shows incorrect information

When running the SQL Server 2008 SP3CU16, on one of our instances, the install seems to run through the wizard OK. However, the Setup Bootstrap log reports "The patch installer has failed to ...
1
vote
1answer
27 views

Query XML without namespace

I can query XML, which has defined xmlns tag with common table expression DECLARE @XML XML SET @XML = '<NodeA xmlns="https://XYZ.xsd"> <NodeB verzePis=""> <NodeC1 attrA="Hello" ...
0
votes
0answers
10 views

SQL Server transactional replication distributor

If I have a SQL Server 2012, with two databases, both publishers, replicating to a bunch of subscribers. Can each database go through a different distributor? Is the publisher the server or the ...
-2
votes
0answers
29 views

Data retention and purge process [on hold]

how can i verify that purge process is working in database. Pls help any links or any information on it will be appreciated. I have SQL server 2012 database
0
votes
0answers
19 views

Restrict connection to SQL Server By IP [duplicate]

On a QA server I need to give access to specific login from just one IP to log to this server. I wrote This login trigger Create TRIGGER tr_CheckIP ON ALL SERVER FOR LOGON AS BEGIN ...
0
votes
0answers
16 views

SQL-Server Full-Text Index Auto-Population Stops Working

From time to time auto population stops working (SQL Server 2014 11.0.6518). I have to use ALTER FULLTEXT INDEX ON [table] RESUME POPULATION to make it work again. In the SQLFT*.LOG there is no ...
0
votes
0answers
14 views

How to pass parameters to a cmd.exe using Servcice Broker External Activator

I am trying to use SQL Server Broker External Activator to launch C:\Windows\System32\cmd.exe application and pass commands to it. For example: echo Hello World x 2 >C:\Test\cmd1executed.txt To do ...
2
votes
1answer
39 views

How can I create a role to create,update,delete stored procedures and views

what permissions do I need to give in order to achieve the above task to get users the capacity to create,update,delete stored procedures and views to a database role.
0
votes
0answers
21 views

Issues with the @query parameter in sp_send_dbmail

When I use the following: select * from table A where repID in ( select repID from table B where id = 5 ) as the string I'm assigning to the @Query parameter. ...
0
votes
0answers
26 views

Resource Governor - user in classifier function using NULL pool rather than stated pool

I have a problem with transaction log backups for an AlwaysOn HA database causing latch contention. It's not a problem when we run backups on the replica but we're not licensed for that, so I'd like ...
2
votes
2answers
276 views

SQL Server : Included columns in an Index: is there something like “too many”?

We have a table in one of our databases with approximately following structure: Field1 int primary key Field2 int foreign key A Field3 int foreign key B Field4 int foreign key C Field5 ... Field70 ...
0
votes
0answers
15 views

Changing MaximumErrorCount when executing maintenance plan

I have defined a Maintenance Plan in Microsoft SQL Server 2012. It doesn't execute and it says DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (2) ...
0
votes
0answers
11 views

Full text search error: Invalid locale ID was specified

Query involving full text search is generating the following error message after restoring the database to a new server: Invalid locale ID was specified. Please verify that the locale ID is ...
2
votes
1answer
37 views

Pros and cons of DBCC SHRINKDATABASE operation

I have read MSDN - Microsoft Manual according to this issue, but I still do not have clear understanding, when it is useful to apply this option and when it is not. Please advise.
-1
votes
0answers
30 views

What are the Pros and Cons of modelling a ready only query system with Multiple databases vs Multiple schemas?

I have the following scenario where an SQL Server database (D1) is being replicated to D1_p (on-premise SQL Server). I have another on-premise oracle database (D2) being replicated to D2_p (on-premise ...
3
votes
3answers
112 views

Install Express/Standard side-by-side

I've reviewed these two existing questions: Install SQL Server 2008 Express on same machine as normal SQL Server 2008 install? Installing SQL Server Express in parallel of Standard ...and I ...
2
votes
0answers
20 views

AlwaysOn Multi Subnet Configuration

Environment Two Nodes A & B A - Site/Subnet 1 B - Site/Subnet 2 File Share - at Site 3 We have an AG listener that has two IP addresses spanning the two subnets (1 up, the other down ...
0
votes
0answers
12 views

Enabling the use of OPENROWSET in Sql Server [duplicate]

I am trying to make my DEV Server allow the use of OPENROWSET. Though I can use it on my production but not in my DEV. I cannot use the Bulk insert because the excel file is dynamic (Column changes ...
3
votes
0answers
71 views

Sort operation SQL Server 2012

I am trying to optimize a query and the sort operation (91% cost) is the costliest operation. Any help will be appreciated. Query is : SELECT TOP 1 ArchiveType, CONVERT(NVARCHAR(30), ...
0
votes
0answers
24 views

Suitability of sqlite vs sql server compact or local db [on hold]

I am currently using sqlite with my C# application. The issue why I need this is for simple deployment using the clickonce. I could not use mysql here is cause of steps needed for its depolyment. I ...
0
votes
0answers
28 views

One bitmask column vs multiple bit columns [duplicate]

I have many tables with a column storing a set of days of week. I used to use MySQL and data type "set" worked well. For example: [worker] id weekday_mask (data type: ...
2
votes
0answers
30 views

Very high avg_write_stall_ms for tempdb [duplicate]

What could be causing (and how to fix) my tempdb files (8 equal size) to have [avg_write_stall_ms] of 7300ms and the next highest data file is 47ms. System is Hyper-V fail-over cluster, SQL 2012 ...
6
votes
1answer
461 views

What does SOS in SQL Server stand for?

I am reading SQL Server 2012 Internals book now. There are several phrases with SOS acronym, such as "SOS Scheduler" (in chapter about the scheduler), "SOS Memory node" (in chapter about the free ...
6
votes
1answer
62 views

Does SELECT INTO Reserve the #Object Name in TempDB Prior to Runtime?

Putting together a quickie proc to help with debugging, I ran into a what seems to be a error in the compiler. create proc spFoo @param bit as begin if @param = 0 begin select * ...
0
votes
2answers
62 views

How many log files does a database usually have? [duplicate]

I'm studying SQL Server. I have read that a database can have several data files and one log file, but recently I was heard that a database can have more than one log file. Is this true?
4
votes
2answers
131 views

How to optimize this tricky SQL self-join?

I want to perform a complex self-join on a table. I know that this could in theory be done very efficiently (see below), but I have trouble getting SQL (on Microsoft SQL Server) to do so. My question ...
0
votes
0answers
23 views

SQLAgent Job Step- Database field blank, but not

In looking at a historical SQL Agent job on my employers server I noted a job with 4 steps. The Databasefield was set as master for the step 1 and not set at all for the other 3 steps. Yet each of ...
1
vote
1answer
24 views

Synchronous SQL Server Replication only for specified subscribers

I would like to create database replication between multiple localisation. There will be one publisher and multiple subscribers. Is it possible to define that synchronisation is synchronous only for ...