Viewing 15 posts - 1,066 through 1,080 (of 2,645 total)
SELECT 'col1,col2,col3,col4' as line
UNION ALL
SELECT CONCAT('''', col1,''',''', col2,''',''', col3,''',''', col4,'''')
FROM myTable
March 29, 2020 at 5:56 pm
Is it really SQL 7, 2000 you are using?
March 26, 2020 at 7:37 pm
An alternative is to use OUTER APPLY:
OUTER APPLY (SELECT TOP(1) *
FROM...
March 26, 2020 at 6:57 pm
Is it REALLY possible to bypass the @Where_Clause variable and make the below SQL non-dynamic?
This is a statement from an SP that receives the below 5 parameters and dynamically...
March 23, 2020 at 3:59 pm
All this does is select rows where RN is odd
WHERE RN % 2 = 1
I'm not quite sure what you want. Are you looking to get the...
March 22, 2020 at 2:40 am
Couldn't you use TOP with OFFSET to get a fixed size chunk of records and insert that way? (So modify to do the insert in chunks?
I think the OP...
March 21, 2020 at 12:45 am
SELECT *
FROM #aaa a
WHERE EXISTS(select * from #aaa b where b.alertid = a.alertid and b.alerttypeid = 4)
AND EXISTS(select * from...
March 20, 2020 at 6:44 pm
DECLARE @Date1 datetime = '20150630'
SELECT DATEADD(m,6, @Date1)
'2015-12-30 00:00:00.000'
SELECT DATEADD(m,-12,GETDATE())
'2019-03-19 22:54:19.727'
'2015-12-30 00:00:00.000' < '2019-03-19 22:54:19.727' = TRUE
March 19, 2020 at 10:56 pm
Thanks, my CASE is what I was worried about. If all I have to do is change the ORs to ANDs, then I'm happy. I was able to find...
March 16, 2020 at 2:04 pm
I think you will get better results using a CTE than writing any function with a query in it.
This should be faster, but I think you could get it even...
March 16, 2020 at 12:12 pm
I'm confused by your query. Why have you got distinct in "SELECT distinct(td.EVENT_ID)"?
You have EVENT_ID in the group by. Distinct applies to the entire line, not just what you put...
March 16, 2020 at 7:19 am
and what do you recommend to do? I was looking into using a cross apply, but I think it will be the same
If you make it a table valued...
March 16, 2020 at 12:53 am
Each time you use the function it is doing a query on the table. So if you use the function 10 times it will do 10 queries on the table...
March 15, 2020 at 8:56 pm
SELECT….<column list>
FROM CA_Leaves CL
WHERE CL.C_Status = 'New'
AND (@i_PARAM1_field = @i_PARAM3_field
OR...
March 15, 2020 at 7:44 pm
Viewing 15 posts - 1,066 through 1,080 (of 2,645 total)