Viewing 15 posts - 7,591 through 7,605 (of 8,731 total)
ScottPletcher (10/18/2013)
T.Ashish (10/17/2013)
Jeff Moden (10/17/2013)
ScottPletcher (10/17/2013)
ORDER BY 1
I often avoid using the column names at all in UNIONed queries, as the names somehow seem to
change a lot :-)...
October 18, 2013 at 9:25 am
Maybe something like this would help.
WITH SampleData(String) AS(
SELECT 'ADB' UNION ALL SELECT 'ADC. DCD.' UNION ALL SELECT 'ADC.'
)
SELECT CASE WHEN RIGHT( String, 1) LIKE '[^A-Za-z0-9]'
THEN LEFT( String, LEN( String) -...
October 18, 2013 at 9:02 am
Could you give sample data and expected results?
October 17, 2013 at 4:45 pm
I get to the same result, but I might be missing information from you.
Will you always have 2 IDENT1 values? How would you show that?
For additional values, you might need...
October 17, 2013 at 3:23 pm
There's no need to create a schema. However, it would help you to manage the information. You can DENY premissions on specific objects. If you have a good user management,...
October 17, 2013 at 10:36 am
You're not grouping or using any aggregate functions. That might be your problem.
Without some sample data, we might not be able to help you. Please read the article linked on...
October 16, 2013 at 12:46 pm
Assuming also that both dates will be on the same year and months won't overlap. Otherwise a year column is also necessary.;-)
October 16, 2013 at 12:12 pm
Cost isn't a real performance indicator. It's just an estimated value used by the query optimizer to choose an execution plan.
October 16, 2013 at 11:39 am
You could add the MONTH and YEAR functions or a CONVERT to group by.
SELECT RIGHT( CONVERT(char(11), FlightDate, 113), 8) Month,
COUNT (PaxNum) as TotalPassengersCount
FROM dbo.FlightDetails
WHERE...
October 16, 2013 at 11:21 am
As far as I know, because I'm not that familiar with oracle either, Oracle doesn't have an Identity functionality as SQL Server has. That's why they use sequence.
Looking for information...
October 16, 2013 at 10:51 am
Just another option using dir parameters.
DECLARE @cmd nvarchar(500)
SET @cmd = 'dir C:\ /A:A'
CREATE TABLE #DirOutput(
files varchar(500))
INSERT INTO #DirOutput
EXEC master.dbo.xp_cmdshell @cmd
SELECT COUNT(*)
FROM #DirOutput
WHERE files LIKE '[0-9][0-9]/%'
DROP...
October 16, 2013 at 9:48 am
I guess you're lacking of imagination. You just needed to adjust the temp table query.
DECLARE @cmd nvarchar(500)
SET @cmd = 'dir C:\'
CREATE TABLE #DirOutput(
files varchar(500))
INSERT INTO...
October 16, 2013 at 9:44 am
You can still use DTS on 2008 but you would have to plan the migration (assisted by a tool or not) because 2012+ won't support them.
My advice, don't trust migration...
October 16, 2013 at 9:05 am
How about using dir?
(untested code)
DECLARE @cmd nvarchar(500)
SET @cmd = 'dir C:\MyFolder\'
CREATE TABLE #DirOutput(
files varchar(500))
INSERT INTO #DirOutput
EXEC master.dbo.xp_cmdshell @cmd
SELECT *
FROM #DirOutput
October 16, 2013 at 8:46 am
Drew Copenhaver (10/16/2013)
OCTom (10/16/2013)
He not only...
October 16, 2013 at 8:36 am
Viewing 15 posts - 7,591 through 7,605 (of 8,731 total)