Viewing 15 posts - 571 through 585 (of 2,645 total)
If you paste the code into a "code" window it will be formatted:
CREATE TABLE [dbo].[Passaggi]
(
[Code] ...
January 30, 2023 at 7:46 pm
If you just want an id you can just add ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) id,
as a column to the query to get a sequential id column. e.g.
January 30, 2023 at 1:41 pm
There is also JSON download in that link:
DECLARE @json NVARCHAR(MAX) = '[{"name":" Zain Haider","fatherName":"Ahmad Nawaz","cnic":"3810481580749","province":"Punjab","district":"BHAKKAR"},{"name":"Aamir Bilal alias Babu Jhangvee ","fatherName":"Muhammad Bilal ","cnic":"3640177467701","province":"Punjab","district":"PAKPATTAN"},{"name":"Aamir Ismail ","fatherName":"Muhammad Ismail","cnic":"3320298151369","province":"Punjab","district":"JHANG"},{"name":"Abbas","fatherName":"Mohammad Ali....
January 30, 2023 at 1:35 pm
DECLARE @xml XML = '<ArrayOfHomeModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/NACTA.Models">
<HomeModel>
<CNIC>12345</CNIC>
<District>District 1</District>
<FatherName>XYZ</FatherName>
<Name>John XYZ</Name>
<Province>Province 1</Province>
</HomeModel>
<HomeModel>
<CNIC>65432</CNIC>
<District>District 2</District>
<FatherName>ABC</FatherName>
<Name>Kevin ABC</Name>
<Province>Province 2</Province>
</HomeModel>
<HomeModel>
<CNIC>65432</CNIC>
<District>District 3</District>
<FatherName>DEF</FatherName>
<Name>Tim DEF</Name>
<Province>Province 3</Province>
</HomeModel>
</ArrayOfHomeModel>';
WITH XMLNAMESPACES('http://schemas.datacontract.org/2004/07/NACTA.Models' AS ns)
SELECT T.C.value('(ns:CNIC)[1]', 'int') AS CNIC,
...
January 30, 2023 at 1:05 pm
And do remember that the resulting number is actually huge coming in at E33 and isn't just 3.97. Because of that, I'm seriously doubting this whole formula... especially since...
January 29, 2023 at 5:57 pm
It's sufficient to return 2 decimal places but I can't seem to ROUND or CONVERT to DECIMAL.
Just a note: You are not rounding to 2 decimal places but 3...
January 29, 2023 at 3:35 pm
You can use the ABS function as you can't take the logarithm of a negative number for zero use an IIF:
SELECT ROUND(T.C, 2 - FLOOR(IIF(T.C = 0,...
January 28, 2023 at 12:39 am
SELECT ROUND(T.C, 2 - FLOOR(LOG10(T.C)))
FROM (SELECT POWER(
...
January 27, 2023 at 10:56 pm
I think a case statement from a performance perspective is pretty much optimal. It would just need one scan of the table, it's not possible to do it in less...
January 27, 2023 at 4:52 pm
You cannot update the value of the identity column in SQL Server using UPDATE statement. You can delete the existing column and re-insert it with a new identity value. The...
January 23, 2023 at 7:10 pm
I think the topic is "bugged"... I got a notification of a response from Scott, and the forum shows they were the last to reply, but I don't see...
January 20, 2023 at 5:58 pm
Actually I think this might do it:
SELECT [W_SE-MFG].dbo.YearMonthNo(J.EntryDate) AS Per,
SUM(J.RunTime) AS TReg,
...
January 19, 2023 at 2:02 pm
I think this is a more straight forward way of doing it:
;WITH J1 AS
(
SELECT [W_SE-MFG].dbo.YearMonthNo(J1.EntryDate) AS Per,
...
January 19, 2023 at 1:56 pm
How do you run it from the file system from within an Agent job?
January 18, 2023 at 6:45 pm
I've got some SSIS packages that I run from the file system.
To run them I have a batch file and use a Windows Scheduled Task to run batch file.
It might...
January 18, 2023 at 4:58 pm
Viewing 15 posts - 571 through 585 (of 2,645 total)