Viewing 15 posts - 346 through 360 (of 1,468 total)
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
...
He hasn't quite figured out how to tell us when he needs to go potty, so all we can do is get him seated on it until he goes....
June 17, 2020 at 4:43 am
WOW!! My problems with this quarantine are nothing, compared to yours! I'm very sorry you have to put up with all of that.
Thanks Rod.
At the risk of turning this...
May 21, 2020 at 7:12 am
We had a cruise booked. Then came a hard lock-down, so our cruise was cancelled.
We are confined to our homes - Only allowed to go out to purchase groceries or...
May 19, 2020 at 3:18 pm
CREATE TABLE [dbo].[A]([DatabaseName] [nvarchar](1000) NULL, [DBSize] [nvarchar](1000) NULL)
insert into A values (DatabaseA , 580960.00 MB)
insert into A values(DatabaseB, 23523.00 GB)
insert into A values(DatabaseC,234.00 KB)
Table values:
DatabaseA 580960.00...
May 12, 2020 at 7:53 am
You are going to have to check the joins. Without knowing your tables and data, I have attempted to change the joins, so that I can add the OUTER APPLY...
March 12, 2020 at 2:39 pm
Please see the code below.
Which tables contain the fields countryCode and site_id ?
FROM dbo.
,...
March 12, 2020 at 2:06 pm
Help us out by providing the source table name for each field in the WHERE clause
March 12, 2020 at 1:25 pm
So, what is the name of the view?
Do you really have a table or view name dbo?
March 12, 2020 at 1:20 pm
The structure of yor SQL does not make sense to me. Is this for SQL Server, or some other flavour of SQL?
March 12, 2020 at 1:11 pm
You could keep the function, but change it to an inline TVF, like this
CREATE FUNCTION dbo.Stringmultitypes ( @id int )
RETURNS table
AS
RETURN SELECT Types = CAST(STUFF((
...
March 12, 2020 at 12:46 pm
If the source and destination tables are the same structure, you can swap out the partitions
March 6, 2020 at 4:34 am
Viewing 15 posts - 346 through 360 (of 1,468 total)