Viewing 15 posts - 1 through 15 (of 15 total)
Hi it's resolved I guess...
It was no so simple but I catched this from the internet:
http://www.sql-server-performance.com/2006/find-frequent-values/
And I folow the orientation and here it is, something like this:
SELECT par1.[Dest_Port],...
May 19, 2016 at 10:46 am
Hi John thanks for helping
I only want one line per Vessel/Port with the BL Number with more occurrences
Imagine the question: per Vessel/Port what was the BL Number more repeated then...
May 19, 2016 at 9:46 am
I'm ready to go to the .NET now...
Thank you John
This peace of my generated SQL
SELECT
OSUSR_CYW_TED_EVENTS.[AMOUNT],
(SELECT MIN(LABEL)
FROM OSAmber.DBO.OSUSR_CYW_TED_EVENT_TYPE
WHERE OSAmber.DBO.OSUSR_CYW_TED_EVENT_TYPE.[Id] = OSUSR_CYW_TED_EVENTS.[EVENTTYPEID])
AS [EVENTTYPEID],
OSUSR_CYW_TED_EVENTS.[SUBMITVACATIONSID],
OSUSR_CYW_TED_EVENTS.[TIMEEND]
FROM OSUSR_CYW_TED_EVENTS
Is the same as:
DECLARE @SQLStringGetTablename nvarchar(500);
DECLARE...
April 20, 2016 at 9:11 am
John I'm working and my boss is just waiting for this. This is a simple problem because after that I need to rebuild the .NET code to build all this...
April 20, 2016 at 8:04 am
I think I'm getting the logic
This is all about levels of execution, I think I need to do something like this:
SET @SQLGetLabel = N'SELECT
OSUSR_CYW_TED_EVENTS.[AMOUNT],
(SELECT MIN(label)
FROM ' + @tablename...
April 20, 2016 at 7:16 am
Amazing...
Step by step I'm getting there... I don't know how I will pay you for your help but If you came to Lisbon I definitely will pay you a lunch
If...
April 20, 2016 at 7:03 am
Thanks John for the advise.
As I said you this in only a short peace od SQL code we are talking about SQL code generated by a .net application and executed...
April 19, 2016 at 11:47 am
Yes John, I was looking for this now to understand how it works:
https://msdn.microsoft.com/en-us/library/ms188001.aspx
Thanks
April 19, 2016 at 8:48 am
Ok John,
The target with this new topic is to be sure that as you said: "you need to use dynamic SQL"
So what I want to do is this dynamically:
SELECT
OSUSR_CYW_TED_EVENTS.[AMOUNT],
(SELECT...
April 19, 2016 at 8:27 am
Hi Phill,
Thanks for your feedback.
I think I only can use Object_Name() in a Select statement right?
Here in my example I need to use in FROM and WHERE statements
SELECT OSUSR_CYW_TED_EVENTS.[AMOUNT],
(select TOP...
April 19, 2016 at 7:37 am
Hi Jonh. Thank you again for trying to help me. You was the one that helped me in the other topic:
http://www.sqlservercentral.com/Forums/Topic1778097-8-1.aspx#bm1778113
I was trying to use variables and functions...
April 19, 2016 at 6:44 am
Hi,
I open a new topic for this:
How to build a dynamical Query with T-SQL
http://www.sqlservercentral.com/Forums/Topic1778997-3077-1.aspx
Thank you,
Regards,
Nuno Oliveira
April 19, 2016 at 5:12 am
Hi again I'm having really difficult to do this, if anyone could help me would be fine
I'm completely lost and without ideas. What I need is simply but I need...
April 18, 2016 at 8:56 am
Thank you for the observation and feedback.
Regards,
Nuno Oliveira
April 15, 2016 at 6:36 am
WOW... good idea, for my example it worked! Thank you John, I will try to apply It to my app.
Kind regards!
declare @TablePhisicalName nvarchar(2000)
CREATE TABLE #temp_table (
test nvarchar(2000))
select @TablePhisicalName = (SELECT...
April 15, 2016 at 5:02 am
Viewing 15 posts - 1 through 15 (of 15 total)