Posts by Lucas Eduardo da Silva • 118 points
6 posts
-
0
votes2
answers68
viewsA: Error 102 in Openquery
Hello, Try to put DECLARE @SQL_LINKED VARCHAR(7000) before SET @SQL_LINKED = Getting Like this : DECLARE @SQL_LINKED VARCHAR(7000) SET @SQL_LINKED = You failed to declare your local variable…
-
3
votes2
answers1257
viewsA: Sql Server Error 8623: The query Processor Ran out of Internal Resources and could not Produce a query plan
First the amount you mentioned in the clause IN not necessarily the main cause of the problem, but obviously the greater the amount, the slower the query. If the amount was > 10k could be a good…
-
1
votes4
answers2082
viewsA: Compare a table field with another table
I didn’t find the question very clear, but I understood what you want to do, as some information is missing I believe you want to compare the information in the table. For this there is a command…
-
4
votes2
answers1510
viewsA: How to view the last 30 days of a query
I believe this can help : >= CONVERT(CHAR(10), GETDATE()-30, 101) The GETDATE()-30, will bring the last thirty days for the query, and we use the Convert to get the date out in the following…
-
1
votes3
answers634
viewsQ: Like bringing in salesmen who made and didn’t make sales yesterday?
In this select I am bringing all employees who accessed the application yesterday PO.DAT_COLETA and who held blindfold yesterday PE.COD_PEDIDO. But I also want to bring those who accessed yesterday…
-
1
votes4
answers1358
viewsA: How to return the date and time closest to that informed by the user
I believe this can help you : SELECT max(HORADOCAMINHAO), COD_CAMINHAO FROM tabela WHERE DAT_SOLICITACAO < '2016-10-31 06:36:01.000'/*informe a data desejada*/ and COD_CAMINHAO = 123 GROUP BY…