Viewing 15 posts - 1,306 through 1,320 (of 1,464 total)
You could use dynamic SQL for each DELETE, thus having a separate sql command executed for each group.
December 13, 2016 at 11:43 am
This query should help
DECLARE @sql VARCHAR(MAX);
SELECT @sql = 'WITH cteMinMax AS (' + CHAR(10)
+ ' SELECT' +...
December 13, 2016 at 11:33 am
pinky_sam05 (12/11/2016)
December 12, 2016 at 1:23 am
ma701ss (12/11/2016)
This code returns the user id but what I want it to return is either 1, -1 or -2. My vb code then uses a...
December 12, 2016 at 12:19 am
dudekula.kareemulla (12/9/2016)
I have a query like below. table contains 70 million records
select MIN(createtime) _time_ from tablename
where status <> 20 and type_id = 44
and createtime >...
December 9, 2016 at 5:27 am
BOR15K (12/7/2016)
DesNorton (12/7/2016)
What CLUSTERED index does the table have?Currently none. The table has lots of records periodically loaded at once (every other hour or so).
If you use invoice_lines_I03 to replace...
December 7, 2016 at 4:57 am
What CLUSTERED index does the table have?
December 7, 2016 at 4:29 am
User-defined functions cannot make use of dynamic SQL or temp table
Source: https://msdn.microsoft.com/en-us/library/ms191320.aspx
If you need to use Dynamic SQL, then change your function to a Stored Procedure.
November 30, 2016 at 1:44 am
replace FSI.StepCompletion
with CONVERT(VARCHAR(30), FSI.StepCompletion)
November 29, 2016 at 10:58 pm
Is this for a Gregorian calendar year, or a fiscal year?
November 29, 2016 at 10:46 pm
OK. First things first.
Your #temp needs to change the datatype of UpdateDate
CREATE TABLE #temp (
[Type] VARCHAR(1)
, TableName VARCHAR(20)
, ClientID VARCHAR(10)
...
November 29, 2016 at 12:38 am
I cannot imagine any method that will not be a massive hit on your server.
Perhaps if you explained why you need to create such a massive amount data, some of...
November 28, 2016 at 5:14 am
This piece of code will not work for @NumberOfRows > 31.
urbanromio2 (11/27/2016)
Declare @NumberOfRows int;
Declare @Numbers Table(Number int);
;With cte As
(Select 1 As Number
Union All
Select Number + 1
From cte
Where Number < Power(2,...
November 28, 2016 at 2:31 am
You want to look into the PIVOT relational operator
November 27, 2016 at 10:50 pm
With a few nested queries, you could also sue the following code to generate the JSON
SELECT '['
+ STUFF((
...
November 25, 2016 at 2:05 pm
Viewing 15 posts - 1,306 through 1,320 (of 1,464 total)