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)

2
votes
1answer
50 views

SSRS: Line Chart, Grouping by Day

I have a fairly specific set of data I am trying to display. I have a dataset of helpdesk ticket data. I would like to display a line chart that shows tickets opened and tickets closed by day, over ...
0
votes
1answer
16 views

corrupt Access database file linked with SQL

I have a corrupt Access table and i don’t know how to handle the problem. When I am making any changes of the record in this file, the rows in the table shows me only ‘#Deleted’ message instead of my ...
1
vote
1answer
28 views

Store extended properties and apply to another copy of the database

I'm using SQL Doc to document a development copy of a database. SQL Doc uses extended properties to store user entered values. At some point, I would like to copy those extended properties to the ...
0
votes
1answer
38 views

sql display error

When I run store procedure in SQL Server with parameter 4 param 1 = 'all' param 2 =' all' param 3 = 'all' Result :displays 21 rows When I run store procedure in SQL Server with parameter 4 param ...
1
vote
0answers
51 views

Merge-Replication: New column doesn't get replicated down by update command

I do this frequently but all clients have this fault: I added a new column to a table using a SQL statement, which causes the column to be created and added to every publication that uses this table. ...
4
votes
2answers
274 views

Truncating table without using Alter Table permission

So my DBA don't want developers to give Alter table permission. Now one of the procedure that we created requires to Truncate tables (since apparently delete only removes records, but truncate frees ...
0
votes
1answer
33 views

Two rows having null values merge into one row without null values

I have fetched the record from table like this: Name Opp Bid Pro ---------------------------------------------------------------------- Admin ...
1
vote
1answer
31 views

Reverse engineer SQL Server diagram?

I've been trying to find an option similar to MySQL Workbench 'Reverse engineer' for MSSQL Server 2012. I want to generate the SQL script from a diagram I've created. Is such option available for SQL ...
0
votes
0answers
13 views

How do I change the default “File Name” value in SQL Server's Generate Scripts wizard?

I'm on SQL Server 2012. The "Generate and Publish Scripts" wizard seems to remember the first path I gave it in the Set Scripting Options → Save to File → File Name box, but will under no ...
1
vote
2answers
48 views

How to determine the data type of all fields in a result set in SSDT?

I'm writing a table valued function in SQL Server Data Tools (SSDT). Table valued functions require you to explicitly state the data type of the returned table. In my particular case, I've written a ...
0
votes
0answers
86 views

How to calculate database query accurate responses? [on hold]

I was given a set of data, 100000 rows of data queried using statistical interface for average value of an attribute. The response is determined using the random-sample query method, with subset of ...
2
votes
1answer
36 views

Transaction with multiple SQLCMD calls in a batch file

Is there a good way to do something like the following? SQLCMD -S %SERVER% -E -Q "BEGIN TRANSACTION" FOR %%f in (script1 script2 script3) do ( SET CURRENT_SCRIPT=%%f SQLCMD -S Localhost -E -b ...
2
votes
1answer
50 views

SQL Server 2008 R2 Readable Mirror

I know that SQL Server 2012 and 2014 offer AlwaysOn Availability Groups which provide this functionality, but I'm still stuck on SQL Server 2008 R2 for a while. I recently came across this AWS ...
1
vote
0answers
37 views

Is it good to save tempdb and log files in one drive? [duplicate]

My server has a very 40GB drive for OS, two 2TB drives and one 450GB drive. The server will have about 10 databases; the total data size of the databases is about 1.4TB. Most of the databases are ...
0
votes
0answers
21 views

What are the system requirements for running Microsoft SQL Server Analysis Services 2014? [on hold]

Background info: Hardware is much less expensive than consultant billing hours. I am a developer, not a hardware guy. I have been asked by an IT department for the SSAS system requirements. The server ...
1
vote
1answer
44 views

Transaction log backup file larger than expected?

I've recently taken over a SQL Server database that didn't have any transaction log backup routine running for at least 2 years. The first log backup was very large (3.8 gb on a 1.14 gb database) as ...
7
votes
1answer
111 views

High PAGELATCH_* and WRITELOG waits. Are they related?

We are seeing very high PAGELATCH_EX and PAGELATCH_SH wait types along with high WRITELOG waits. I've diagnosed the query causing the PAGELATCH waits and can eliminate them by reducing the insertion ...
1
vote
2answers
74 views

How to reduce database size with BLOB fields

I have a database that's used to store fingerprints. Under my conception this should be a small database but the problem is that the original developer was probably tripping on peyote and decided it ...
2
votes
0answers
38 views

How is it possible that two deletes give a deadlock, if they do have different primary key data

I am getting a deadlock by the same delete stored procedures that is called by two different threads for deleting two concurrent records. The deadlock happened on the primary key index of the X ...
0
votes
0answers
9 views

Transactional Replication to a Version Two Versions Older--Count by Name or Number?

According to Microsoft SQL Server documentation, a "Subscriber to a transactional publication can be any version within two versions of the Publisher version." In this context, are versions named ...
-3
votes
1answer
37 views

Unable to attach mdf file on SQL Server 2014

I have SQL Server 2014 on my Windows 8.1 Pro machine. However, I couldn't find any sample database for 2014 version and hence I am trying to attach AdventureWorks2012_Data.mdf file by right clicking ...
0
votes
0answers
29 views

Sql server bijection function in below alphabats [on hold]

a, b, c Convert into a -> b b -> c c -> a Without loop in sql server
1
vote
2answers
86 views

Query to return zero if nothing exist

I have a table With currency, paymenttype and invoiceamount. I have to write a query to get currency, paymenttype and total invoiceamount made. This is pretty simple with group by. But actually I ...
0
votes
1answer
38 views

SQL Server Express Limitation

I would like to use Express instead of Standard. Does Express still have the annoying habit of going to sleep if left unused for a period of time?
1
vote
1answer
47 views

Using LIKE or Full-text when searching database

I am fairly new to SQL and I am currently trying to create a search function for my website, much like the one on imdb.com. I have 3 tables and I need to search two rows (nvarchar) in each table when ...
1
vote
2answers
37 views

Stored procedure big where clause or multiple procedures

Is it better to have one big query or N small ones? For example to select all the customers with multiple parameters: select id, name, firstname, city, birthday, ... from ...
0
votes
0answers
47 views

TSQL LAG equivalent

I am trying to understand how lag works, by converting the following code back to using self-join sql code without using lag. https://msdn.microsoft.com/en-us/library/hh231256.aspx USE ...
1
vote
0answers
17 views

SQL Server Transactional Replication

I am using SQL Server 2012 and I am investigating transactional replication and had a question on SQL Versions that can be used. The Distribution and Publisher will be on SQL2012 Standard Edition, ...
7
votes
1answer
120 views

Unable to restore (error 3456)

I have a situation that is not easy to figure out, and thought I'd ask on this forum if others might have suggestions. I'm running SQL Server 2008 R2 Standard SP3 on Windows Server 2008R2 Enterprise. ...
1
vote
1answer
57 views

SQL Server 2012 - Dropping Snapshots takes hours

We recently did a SQL Server upgrade from 2005 to 2012. We have a nightly job that drops a snapshot of an active database. The snapshots gets created again later in the day. Before upgrading, in SQL ...
2
votes
1answer
29 views

Replicating to Older Versions of MS SQL Server

According to an old MSDN article (from the SQL Server 2008 R2 era), Microsoft SQL Server transactional replication subscribers need to be within two versions of the publisher. Does this hold true for ...
2
votes
0answers
50 views

How to copy SQL Server log shipping files to AWS EC2 instance

I am using SQL Server 2008 R2 and would like to log ship from my local data center SQL Server instance to a log shipping target SQL Server running in AWS EC2. What is the best way to copy the log ...
1
vote
0answers
27 views

Changing filegroups from primary to user-defined for existing table in SQL Server

I have 10 million records in a table. But the table is created on primary filegroup.All the indexes and primary keys were created in primary filegroup.There 5 partitions on the table which are also on ...
0
votes
0answers
9 views

Changing filegroups from primary to user-defined for existing table in SQL Server

I have 10 million records in a table. But the table is created on primary filegroup.All the indexes and primary keys were created in primary filegroup. Is there any way to move Table, indexes and ...
4
votes
1answer
180 views

Order In WHERE Clause Matter For SARGability?

Suppose that I have a table with 1000 records and I have the below query, which would return 7 total records: SELECT * FROM MyTable WHERE IndexedColumn > 5000 AND OtherIndexedColumn = 2 ...
-4
votes
1answer
17 views

ExecuteNonQuery () not fungsional and database failed [closed]

Public Class Form1 Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Dim SumberDb As String = "Data Source=c:\users\ogieuntung\documents\visual studio ...
0
votes
2answers
42 views

SQL Server choose at random from giving data

My problem is that I don't know how to choose the random data from a giving set. For example: I have a Node column which need to produce different inserts but only from these numbers: 16, 17, 18, 22, ...
0
votes
1answer
40 views

Different runtimes using parameter vs. constant

A strange thing is happening to me during execution a specific query. I have this query: DECLARE @P0 as varchar(4000) DECLARE @P1 as varchar(4000) SET @P0 ='P0' SET @P1 ='2015-02-21 00:00:00' ...
1
vote
0answers
52 views

How does SQL Server know it was abnormally shutdown last time [closed]

I am doing background reading on this. Would like to know how does SQL Server know it was abnormally shutdown last time?
-2
votes
0answers
24 views

Enable sql row versioning and issue in select inserted row

I worked on a project that high rate of insert and select execute on it. after a while I saw below error: was deadlocked on lock resources with another process and has been chosen as the ...
0
votes
0answers
34 views

Partitioning large table requires lots of extra disk space: does switching recovery model help?

We are in the process of implementing partitioning on a SQL Server 2012 database. It worked fine in our environment, but in the client environment we ran out of disk space. The entire database was ...
-1
votes
0answers
36 views

List of SQL Server System Error Messages [closed]

I have read through quite a bit pages and blogs about different kinds of SQL Server Error Logs. I am looking for exact types and list of errors it will cover. I am not asking how to read or configure ...
-2
votes
1answer
71 views

Arithmetic overflow error for type varchar

This is my query: insert into [Consolidated_LoB].[dbo].[consold] ([shp_to_pstl_cd] ,[LoB] ,[catlg_nbr] ,[shpd_qty]) select [POSTAL_CODE] ,[LoB] ,[PART] ...
-1
votes
1answer
63 views

SQL Server's aggregate functions ignore nulls. How do I correct this?

According to MS's knowledgebase, Except for COUNT, aggregate functions ignore null values. Does anyone know how I can get it to work correctly, that is, return a null if it attempts to ...
-1
votes
0answers
22 views

DBMS Project (SRS to ERD mapper) [closed]

suppose you a are a IT profession & you have a final year project a specific format provided in which user put requirement in the form of paragraph & click generate button to ER diagram. My ...
0
votes
1answer
54 views

Single query approach to split and copy string values in a column

This is a part of my previous question. I have the below logic to split a string value from a column in table tblProjects as below: SELECT @Docs = Documents FROM tblProjects WHERE ID = @ID SET ...
2
votes
1answer
97 views

T-SQL CTE Compare previous non-NULL and current row to filter out by difference value

My sample database (in fact a CTE statement data) looks like this: eventdate val 2012-03-23 3965 2012-03-26 3979 2012-03-27 3974 2012-03-28 3965 2012-03-29 3967 2012-03-30 3959 2012-04-02 ...
-2
votes
1answer
45 views

What are the ways to handle temp table with more than 9000 rows? [closed]

I am creating a temp table in my stored procedure which has more than 9000 rows and I read some articles saying that its bad practice to use temp table with more than 9000 rows as it uses temb db for ...
0
votes
0answers
24 views

how to create an online Database that tracks members only 1 level deep for each member

I want to create a database for a web site so that when a member signs up they have the option of choosing their sponsor (the person who referred them). Each member only has to sponsor 2 other ...
0
votes
1answer
37 views

Is it possible to install SQL Server 2014 Enterprise on Windows 7?

I'm planning to install SQL Server 2014 Enterprise Edition on a 64bit HP workstation. I read the SW and HW requirements on: https://msdn.microsoft.com/en-us/library/ms143506.aspx And according to it, ...