Clarification on SQL PIVOT [closed] - sql-server

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
Can someone tell me what is missing in the second Pivot example. It returns NULL http://sqlfiddle.com/#!3/2b405/2

This is the literal answer:
There is no Car, Truck or Bicycle in your vehicle_parameters table. Nothing is missing in your statement, your result of NULL is correct.
Here are some other samples of PIVOT you may want to look up: https://technet.microsoft.com/en-us/library/ms177410%28v=sql.105%29.aspx
I think they explain dealing with nulls well.

Related

SQL Server table-valued function [XML READER] taking more cost. can any one explain what is the issue [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 days ago.
Improve this question
enter image description here
INSERT INTO #ApplicationFiles (OurBranchID, ApplicationFileNo)
SELECT
ApplicationDetails.x.value('OurBranchID[1]','nVarchar(12)'),
ApplicationDetails.x.value('ApplicationFileNo[1]','nVarchar(20)')
FROM
#ApplicationDetails.nodes('/JSON/dt_ApplicationDetails') AS ApplicationDetails(x)
The query is taking a long time to complete. I want to increase the performance of the query.

compare nullable param to non-nullable column [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 months ago.
Improve this question
I have a non-nullable bit column and in my Select statement I would like to only compare it with a nullable param if that nullable param is not null. What's the best way of doing this? There are other conditions in the where clause though I would still like to execute.
This sounds like a typical "kitchen sink" kind of query. It would help your question if you provided some details other than a vague explanation. I think you are looking for something like this.
and (#YourParam is null OR [YourBit] = #YourParam)

SQL Server - Index Seek: count of operation [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
In SQL Server we have Index Seek operator. Which works very well for a search operation.
How much operation SQL Server needs to perform in order to get a value? I assume that it should be the height of the tree.
Nobody can say the one answer for sure because it depends on many parameters :
Index type (Clusted, None Clustered)
Unique or Not
Null or Not Null
Expected rows stored in which page
So, there is the well-explained article about index seeking [O2] blow:
https://sqlserverfast.com/epr/index-seek/

Different keyword in sql [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
What is 'PROBLEM:' keyword in sql?
How to use it?
Basically I have seen this keyword in a sql query. But whenever I going to search about this keyword, then everyone posted a reply to get rid from problem in sql. But the main problem is, I failed to make understand to others that, "Problem:" is a keyword.
And this is the main problem. So can anyone describe about this keyword
A word preceding a colon is a label used by goto (https://msdn.microsoft.com/en-us/library/ms180188.aspx)
"PROBLEM" is not a reserved word.

table to store huge data [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Does any one have idea about storing email boby in the sql server. The email body is about 15 lines. what has to be done inorder to maintain a table with 40 different emails contents.
Example:
a : some cotent should be sent
b : some other content
You'll probably want an nvarchar(max) column to store the contents of the body. This allows you to store up to 2GB worth of text...which is kind of a lot of text, so you should be good.

Resources