Viewing 15 posts - 3,091 through 3,105 (of 7,187 total)
The answer's right there in the error message. You don't have an alias for the third column of your SELECT statement.
John
August 17, 2015 at 4:56 am
Please will you post your whole query and a CREATE TABLE statement for the table you're selecting from?
Thanks
John
August 17, 2015 at 4:50 am
Another way of doing it:
SELECT A, B, C, 'Text 1' MyText
FROM MyTable
UNION ALL
SELECT A, B, C, 'Text 2'
FROM MyTable
John
August 13, 2015 at 8:56 am
Since 2016 hasn't been publicly released yet, I wouldn't advise you use it for production. There's SQL Server 2014 to consider as well, don't forget.
John
August 10, 2015 at 8:47 am
Happyt 43606 (8/10/2015)
returns -in a column, 346 in a column and A in a column.
What do you want in the other two columns? Is this a homework question, by...
August 10, 2015 at 5:20 am
Something like this?
SELECT
dato
FROM dbo.dutyrostershift d
JOIN dbo.vacation v
ON d.dato BETWEEN CAST(start-36163 AS datetime) AND CAST(fld_end-36163 AS datetime)
AND d.employeeid = v.personalid
WHERE d.shifttype = 2
John
August 10, 2015 at 4:54 am
It's not clear whether you want five columns or three. This will work for your example:
DECLARE @StreetName varchar(100)
SET @StreetName = '-346A'
SELECT
col1 = LEFT(@StreetName,1)
,col2 = SUBSTRING(@StreetName,2,3)
,col3 = RIGHT(@StreetName,1)
John
August 10, 2015 at 4:37 am
The issue is still that, with the set of parameters you've passed in, you're selecting every row from the table. What you originally posted, though, was only the subquery...
August 10, 2015 at 3:36 am
You're selecting every row from the table, so it's not going to be all that quick. Get rid of your whole WHERE clause - it's just noise. A...
August 10, 2015 at 2:20 am
"The system cannot find the path specified" - that's a very clear error message. Is the file on the same computer as the database? If not, you'll need...
August 5, 2015 at 3:00 am
You don't normally need to consider the LSN. Just to be safe, it's probably best to retain log backups to an hour, say, before the full backup starts. ...
August 4, 2015 at 9:09 am
(1) No, because if your full backup fails, you'll be left with nothing
(2) Yes, that should work. I usually keep 48 hours of transaction logs, though - it gives...
August 4, 2015 at 5:33 am
Something like this?
create view vw_main
as
select colA1, colA2, colA3, colA4, colA5, colB2
from tableA A inner join tableB B
on (A.ColA1 = ColB1 AND colA4 = 'case') OR colA4 = 'ifelse'
John
July 23, 2015 at 7:36 am
Viewing 15 posts - 3,091 through 3,105 (of 7,187 total)