Microsoft SQL Server





Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

Share tech news, updates, or what's on your mind.

Sign up to Post


We have a 2012 dell SQL server running a Fusion IO card.

Now that Sandisk bought Fusion-IO what should we buy to replace this server?

Anything faster come out? Does Dell still sell Fusion IO Cards?

This for the Greenway practice management software.

This server is still fast but needs to get FASTER :)

Ultimate Tool Kit for Technology Solution Provider
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Hello, I'm trying to select a single row for each "ProtocolID" based on the max "ChangeOrderNumber"

The query I have so far is:

		s.[ProtocolID], MAX(s.[ChangeOrderNumber]) AS ChangeOrder
	FROM [dbo].[Study] s
	GROUP BY s.[ProtocolID]
) t
INNER JOIN [dbo].[Study] s ON s.[ProtocolID] = t.[ProtocolID]

Open in new window

But I'm still getting multiple rows for each ProtocolID. I have attached a sample image highlighting the type of rows I should be returning. I basically just want a single record for each protocol ID based on the MAX ChangeOrderNumber

Help is greatly appreciated.

I'm trying to write a query with the following rules:

If the MAX ChangeOrder OR MAX Revision has a SyncDate that is null then return the record, however
Change order takes precedence (see TEST5 in desired results)

[Study] <----- table name

ProtocolID	  Revision		ChangeOrder		SyncDate
TEST1		0		0			NULL
TEST1		0		1			01/02/2013
TEST1		0		2			NULL
TEST2		0		0			NULL
TEST2		0		1			NULL
TEST2		0		2			01/02/2013
TEST3		0		0			NULL
TEST3		1		0			01/02/2013
TEST3		2		0			NULL
TEST4		0		0			NULL
TEST4		1		0			NULL
TEST4		2		0			01/02/2013
TEST5		0		0			NULL
TEST5		1		0			NULL
TEST5		2		0			01/02/2013
TEST5		2		1			NULL

Open in new window

Desired resultset

ProtocolID    Revision		ChangeOrder		SyncDate
TEST1		0		2			NULL
TEST3		2		0			NULL
TEST5		4		1			NULL

Open in new window

TEST1 would return because the record with the MAX ChangeOrder (2) has a SyncDate that is NULL
TEST2 would NOT return because the record with the MAX ChangeOrder (2) has a SyncDate that is NOT NULL
TEST3 would return because the record with the MAX Revision (2) has a SyncDate that is NULL
TEST4 would NOT return because the record with the MAX Revision (2) has a SyncDate that is NOT NULL
TEST5 would return because although the record with the MAX Revision is NOT NULL, the record with the MAX ChangeOrder is NULL
I am using SSRS 2012 to create a report with parameters. There are two parameters for  begin and end dates and two parameters to allow the user to add notes to the report. I am having a problem when the notes to be added contain carriage returns or special characters. The parameter ignores everything after a carriage return and doesn't seem to like other formatting like a asterisk(*) (example a comment has *Note: This indicates data highlighted in the report). I took the carriage return out and it still cut off right before the asterisk. Once I removed the asterisk, it displayed everything. Is there a way to allow a user to enter into the parameter carriage returns and special characters? If I can't use a parameter, is there another way that I can allow a user to type in(or cut a paste) comments?
My SSRS 2016 report is not displaying data.  The stored procedure run in management studio returns data.  When I run the report in the Query Designer within SSRS it returns data but nothing is displayed.  What could be causing this
Have aa SSRS report which has a table near the top with case information.  In SSRS, this table is formatted to be 7.5" wide, and displays like:
SSRS formatBut when my users export this report to Word, that same section of the report is shrunk (horizontally) so that it displays in about 5.25" and looks like:
Word outputWhile the rest of the tables all retain their 7.5" width and the proper appearance.

Although this table is editable in Word, and the client can widen columns to get it to fit appropriately, they would prefer to focus on content, not layout (my job).

Any ideas what is causing this and how to fix it?
I have been reading up about transaction isolation levels in SQL Server.
I understand the differences between READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ and SERIALIZABLE, but the waters became muddy when I tried to understand SNAPSHOT.
How is the SNAPSHOT isolation level different from READ COMMITTED and REPEATABLE READ ?
consumed the most virtual memory: sqlservr.exe (1688) consumed 68628185088 bytes, I got this msg, server hang 2 twice , since yesterday and restarted the whole server from VC
Early the sql memory was configured was max default setting

and now I have have configured SQL sever 54488 MB SQL Max server memory(MB) currently.

after i have run full backup, the whole memory was consumed was already..sp_who2.xlsx

Not sure, wht is the issue, what needs to check

windows 2008 r2 enterprise,  has 64gb ram
sql server std 2008 r2
Single instance, db size is 485gb, full backup size is 78gb

the below query and attached file, is the output after few hours of backup completed

Physical Memory (MB)       Available Memory (MB)      Total Page File (MB)      Available Page File (MB)      System Cache (MB)      System Memory State
65535                                             6312                                    69629                           9970                                             3652          Available physical memory is high

I'm a mobile apps newbie. (but good on ADO, SQL)
I have a SQL Server online (Azure). I need to create a simple HTML5 phone app that can do (for demo purposes) the following.
  • Show a dropdown list of (say about 6 items) that a user can select from. The 6 items are populated from a table in the SQL Server with a SELECT statement. When click a Go button, the app sends a SQL UPDATE statement that includes the value of the selected item.
  • Show a textbox for entering a short message. Click Go button to send an INSERT statement.
I'm looking to do that as a Hello World (before I launch into deeper learning)
I have an iPhone 6s
We setup for HA with 1 Primary and 2 Secondary on QA Box.

Everything is working fine. This is SQL Server 2016 Enterprise Edition.

But as per the requirement we have to use customer port other than 1433.

Now i configured all SQL instances with Port 52062. Add reconfigure HA.

Now the problem is while adding DB to Secondary's, how to provide instance name with portnumber. In this imange it's grayed out so not able to provide port number, what is the alternative way.

I want specify Pornumber 52062. but it's grayed out.
Simplify Active Directory Administration
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

I have a SSRS report.  There are certain pages within the report that need to be printed twice (the user needs an extra copy of that page).  Is there anyway I can programatically do this within ssrs instead of trying to duplicate records in a stored procedure temp table.  I call a stored procedure when I run this report.
Hey Experts,

We are looking to log access to the database directly, meaning developers or admins that can open up SQL Management Studio and make changes to any and all databases.  For compliance reasons we need to have a log of these types of changes.

What's the best way to do this?  

Hi Expert,
I have question for MS SQL Server 2012 Experts DBA’s or Developers. I have been tasked recently to Created new SQL Instance on production Server and import or Copy the Existing SQL Data bases to new instance. The Scenario is, we have very critical Application e.g. “CRITICAL”, Application Server 2012 and MS SQL Server 2012 Instance for this application running in production environment. The project initiated by relevant department to upgrade the Application. With latest versions involving Application vendor and as requirement. I have built the new Application Server which done but there is requirement to create new SQL instance as well so they can test  and UAT purpose before bring this into production.
There is no problem to Create new SQL Server instance and backup all the existing Data base on production Server.
Question: how I have copy or import existing Data base from existing instance with all structure in New SQL server Instance, and what will be impact copying production database on new instance. Is this will not break the conflict with existing database and cause an issue with application?

I wish to install Microsoft Data Protection 2016 on a VMware VM running Windows Server 2012 R2. The VM also has Microsoft SQL 2014 SP2 installed.
When i run the DPM 2016 executable, the set up crashes with error id: 4387.  Would you kindly assist pls.
i have a table:
create table My_table
( [Opty ID] nvarchar (20) null,
[Product Category] nvarcar (50) null,
[Product] nvarchar (5) null,
[Value] float null)

insert into My_table ( [Opty ID],[Product Category],[Product],[Value])
('A0004764376', ' ','WE',100),
('A0004764376',' ', 'UU', 200),
('A0004764376','Hyper', 'AE', 120),
('A0004764376','Voyo', 'G4', 300),
('A0004759217', ' ', 'WE', 200),
('A0004759217', 'Edge','7A', 400)

So, i need to multiply the rows based only on the Products in (WE and UU) by Oppty ID. I need to take also in consideration the Opty ID to make those calculations.
So for the ID=A0004764376, it has 4 type of products but i need to add rows only for the products = WE and UU based on the other products (Hyper and Voyo). To calcuate the value of these 2 peoducts that are mandatory for me, i need to calculate the sum of the rest of the products that are included only in thisn Opty ID.

I uploaded an excel file with a saple of my data and teh table before and after it should look like.

the product category of the blank lines should be filled with the product category of teh value that divides teh sum. For example where the Product is WE, in the first line i populated with Hyper because the value of the Hyper=120 divides the sum between the Hyper and Voyo.

maybe dsome can give me an idea. Or at least how to multiply the rows and after i will figure it out a way how to make…
I have a failed SQL backup and have no clue why this is happening? Can anyone help with this?

Failed:(-1073548784) Executing the query "BACKUP DATABASE [JDE910] TO  DISK = N'\\\\x.x.x.x..." failed with the following error: "Cannot open backup device '\\\\x.x.x.x\\JDE Images\\SQL Backup\\Daily\\JDE910_backup_2018_07_14_220001_8461617.bak'. Operating system error 1311(There are currently no logon servers available to service the logon request.).
BACKUP DATABASE is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

X.X.X.X are the IP address of the webserver jde
x.x.x.x is the ip address of the NAS device where the backup has to be moved
I'm running Power Bi Reporting Service 2018 Version 1.2.6648.38132

The problem I am running into is when running scheduled subscriptions, only 1 subscription can be run at a time.

When starting the subscription manually through the SQL Agent (while the other one is running), the status of the subscription goes directly to: The report server has encountered a configuration error.

I notice that the SQL Agent is starting the job, but it does not seem to trigger the Reporting Service to run the subscription. (Image attached)

Do you have any suggestions?

See the error message in the attached file.
how change database location in the storage from drive C: to N:
after install
we have many database in extension .mdf
I used to use a software called QueryCell.  It allowed you to easily take columns from excel and easily create update and insert statements.  Unfortunately this doesn't work with current versions of excel.  Can anyone tell me if they know of something similar?


 Screenshot of QueryCell
Cloud Class® Course: CompTIA Healthcare IT Tech
LVL 12
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

We are randomly having issues with our barracuda backup of our SQL 2014 DB's. It will run for weeks and then get this error for several days. Sometimes a reboot works, other times it does not.
here is the application event id info:

  - Provider

   [ Name]  SQLWRITER
  - EventID 24583

   [ Qualifiers]  0
   Level 2
   Task 0
   Keywords 0x80000000000000
  - TimeCreated

   [ SystemTime]  2018-07-13T02:03:27.000000000Z
   EventRecordID 79638946
   Channel Application
   Computer SQL2014.AbleHC.local

- EventData

   SQLSTATE: 42000, Native Error: 3013 Error state: 1, Severity: 16 Source: Microsoft SQL Server Native Client 11.0 Error message: BACKUP DATABASE is terminating abnormally. SQLSTATE: 42000, Native Error: 3271 Error state: 1, Severity: 16 Source: Microsoft SQL Server Native Client 11.0 Error message: A nonrecoverable I/O error occurred on file "{9259D979-BF0D-4316-AAC5-29F290E39625}5:" 995(The I/O operation has been aborted because of either a thread exit or an application request.).
Hello Experts,

I have a question related to maintenance plan and copy-only, Backup

Maintenance plan is generated 3 times per day.
I would like to know if selecting this option is the best practice.

I have a recommendation from a colleague that in case of crash and data base recover the backup issued without selecting this option will not be operational, I would like to know if he is correct or not.

Thank you very much for your help.
I have sql server 2012, where I Stored times zone for users, so that I can convert the datetimes to their timezones before showing it
 I stores date in UTC format.

I need to know how can I convert UTC dates to our customer's time zone lile CST or Indian Standard time.
Dear expert,

Simple query, I want MSSQL to exclude all the NULL result in columns from the table.

Any easy solution?
Hello Experts,
I am trying to display a table rows horizontally by TKT_Id.  I have two tables, TKT_DETAILS and FIELD_DETAILS.  Please see the details below.


There are about 750 different fields numbered as 1 thru 750.  Each row contains only 1 field.  There are 750 rows for every single record vertically.


This table contains Field Names of the every Field_Ids.

Because it is very difficult to read vertically, I am trying to create a view to show them all 750 fields in a single row as below.

Tkt_Id, Field_Name_1,  Field_Name_2,  Field_Name_3,  Field_Name_4,  Field_Name_5...  Field_Name_750
    1             001                     002                     003                     004                      005            ...             750

Plesae let me know how to do it without using PIVOT.  Thank you in advance for your time and help!
We need to implement row level security on one of the column of the table that contains the group of the user in sql server 2017.

There are certain users that will have access on this table but we need to restrict them to access only the records for the group they belong.

Users belonging to IT Service group can see only his records that is sam1 , kane , robert can see 3 records.

Example Table Structure

employee_code    employee_name    position          level       status           noofyears     organization_level1   organization_level2
  76576                       Sam                         DBA                   9        married               6                        IT                                  Retail
  76576                       Sam1                       Network           3         married              2                        IT Service                    Infrastructure
  76576                       Kane                        Network           4         married              8                        IT Service                    Infrastructure
  76576                       Robert                     Network           5         married              3                        IT Service                    Infrastructure

Microsoft SQL Server





Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.