Viewing 15 posts - 331 through 345 (of 1,464 total)
Neither your example data nor requirements mentioned continent. If you don't come right, then come back with sample data that represents both continent and country, and show us what you...
September 17, 2020 at 10:46 am
The following SQL should get the results as requested in your post.
SELECT ID ...
September 17, 2020 at 9:50 am
If the users can add/remove columns to a table at will, I would actually consider this a good candidate for an EAV table.
September 16, 2020 at 12:51 pm
If i wish to use bigint for storing huge number of records in a table, i know bigint can go upto 9223372036854775807.
What if for next record if i...
August 31, 2020 at 1:37 pm
If i wish to use bigint for storing huge number of records in a table, i know bigint can go upto 9223372036854775807.
What if for next record if i reach...
August 31, 2020 at 12:06 pm
In order for anybody to assist with performance issues, you will need to upload the execution plan of the 2 different queries. The actual execution plan is preferred.
Just guessing here,...
August 24, 2020 at 6:54 am
If you use the SSMS table designer to change the field from INT to BIGINT, then generate the change script, you will see that under the hood, the table is...
August 24, 2020 at 5:53 am
Luckily, in this case, the PII views that sit on top of the underlying tables, all return data from only that table, and use exactly the same column names.
SO, I...
August 24, 2020 at 5:40 am
I don't see any way to do this. A view could have columns from several different referenced entities and from no referenced entity at all (such as CREATE VIEW...
August 24, 2020 at 5:36 am
What about INFORMATION_SCHEMA.COLUMNS or sys.columns ? Do you not have access to either of those? It just seems to me that those would make it far easier than trying...
August 24, 2020 at 5:34 am
I have adapted the code from the following 2 links in order to create a sample of how to dynamically unpivot data
if object_id('tempdb..#temp') is not...
July 30, 2020 at 9:07 am
I am not aware of any method similar to SELECT * FROM xml.
I use the text() for performance. If you look at the execution plans for the the same query...
July 23, 2020 at 10:22 am
Use something like this, and change your data types as needed
SELECT
id = XT.XC.value('(id/text())[1]',...
July 23, 2020 at 9:48 am
This should get you what you are looking for
SELECT
XT.XC.value('(id/text())[1]', 'int')
FROM
@MyXMLString.nodes('/items/item') AS XT(XC)
July 22, 2020 at 10:58 am
In order to compare NULL values, you need to convert them to a known value.
Below is how I would do it, with 3 different data types
DECLARE @Var1...
July 1, 2020 at 8:38 am
Viewing 15 posts - 331 through 345 (of 1,464 total)