Viewing 15 posts - 1,831 through 1,845 (of 2,171 total)
What is the CONCAT function?
N 56°04'39.16"
E 12°55'05.25"
SET NOCOUNT ON
DECLARE @TableName VARCHAR(200),
@TotalRows INT,
@SQL VARCHAR(1000),
@ColIndex INT,
@ColName VARCHAR(200)
SELECT @TableName = 'vwToday'
CREATE TABLE #Columns
(
ID INT IDENTITY(0, 1),
ColName VARCHAR(200),
TotalRows INT,
NoDataRows INT
)
INSERT #Columns
(
ColName
)
SELECT column_name
FROM information_schema.columns
WHERE table_name =...
N 56°04'39.16"
E 12°55'05.25"
You are selecting DISTINCT over INFO columns. And that info is not equal for the same person and same building. That's why you get two rows for Contact 8.
N 56°04'39.16"
E 12°55'05.25"
Both incoming and outgoing traffic?
N 56°04'39.16"
E 12°55'05.25"
SELECTPSQuery.System_Name,
PSQuery.FO_Name,
PSQuery.FO_Order,
PSQuery.FS_Name,
PSQuery.Purpose,
ProjectQuery.Project_Name,
ProjectQuery.[Project Code],
ProjectQuery.[2005/6],
ProjectQuery.[2006/7],
ProjectQuery.[2007/8],
ProjectQuery.Reason_Code,
ProjectQuery.Completion_Date,
[Framework Outline].Objective,
[Framework Outline].Reference,
PSQuery.PN_ID
FROMProjectQuery
INNER JOINPSQuery ON PSQuery.PS_ID = ProjectQuery.PS_ID
INNER JOIN[Framework Outline] ON [Framework Outline].FO_ID = PSQuery.FO_ID
WHERE ProjectQuery.[Project Code] IN ('C', 'c', 'O', 'o')
AND ProjectQuery.Reason_Code = 'E'
ORDER BYPSQuery.System_Name,
PSQuery.FO_Order
N 56°04'39.16"
E 12°55'05.25"
You normally can't decide which in which order an UPDATE is executed, but there are workarounds such as UPDATING the table in chunks.
N 56°04'39.16"
E 12°55'05.25"
http://www.sommarskog.se/dynamic_sql.html
N 56°04'39.16"
E 12°55'05.25"
What about an inner join?
select f.year_id,
f.line_id,
f.ver_id,
f.cust1_id
from epm02.finloc_base
inner join dbo.conc_table00 a on a.mem_id = f.unit_id
where f.year_id = 80000003
and f.line_id in (80000908, 80001733, 80000957)
and f.ver_id = 80000007
N 56°04'39.16"
E 12°55'05.25"
Try this one!
UPDATE FTable
SET FTable.var18754 = d.Var518,
FTable.var18752 = d.Var524,
FTable.var18753 = d.Var6428
FROM #Table1 FTable
INNER JOIN #FactTable FT ON FT.Comp_ID = FTable.comp_ID AND FT.var1 = FTable.var1
INNER JOIN [Table2] d ON d.Component = FT.Comp_ID AND d.var2...
N 56°04'39.16"
E 12°55'05.25"
To start with, remove the ORDER BY clause!
N 56°04'39.16"
E 12°55'05.25"
Or just
use Northwind
declare @SortBy char(10)
select @sortBy = 'Name'
SELECT ASCII(FirstName) AS ASCIIValue, FirstName, LastName,
Years = CASE WHEN DateDiff(mm, HireDate, GetDate()) < 12 THEN...
N 56°04'39.16"
E 12°55'05.25"
If you prefer not to have a space as first character in the concatenated string, use this
Also prevents for concatenating too long strings.
DECLARE @a VARCHAR(8000)
SELECT @A = left(ISNULL(@A + ' ',...
N 56°04'39.16"
E 12°55'05.25"
Yes, use SQL profiler and log all TSQL/SP queries.
N 56°04'39.16"
E 12°55'05.25"
I am happy you filled in the blanks, Jeff ![]()
N 56°04'39.16"
E 12°55'05.25"
Viewing 15 posts - 1,831 through 1,845 (of 2,171 total)