Viewing 15 posts - 226 through 240 (of 425 total)
pommguest99:
the bold areas below are incorrect.
CREATE PROCEDURE
CompareTables(
@filefit nvarchar(100),
@(select bb.Vraiid, pc.FLCA
from blueribbon bb
join...
April 7, 2008 at 12:44 pm
rbarryyoung (4/4/2008)
rbarryyoung (4/3/2008)
Select A.*, B.*
From TableA A
Left Outer join TableB B
ON B.CompanyID = Left(A.CompanyID
, (Select MAX(len(B2.CompanyID)) From TableB B2
Where B2.CompanyID = Left(A.CompanyID, Len(B2.companyID))
And (...
April 7, 2008 at 8:04 am
CASE statement isn't necessary, just use ABS(). if you have nulls, wrap both in ISNULL().
"Diff" = ABS( ISNULL(ea.lev1,0) - ISNULL(b.firstline,0) )
April 6, 2008 at 3:25 pm
Sandy: not sure why your view isn't using the clustered index but the group by is not the issue. using your sample data script, here's my sqlcmd results:
2>...
April 6, 2008 at 3:13 pm
you definitely won't get any performance benefit by downgrading to sql server express since
a) express can only utilize 1 CPU core while other versions can use multiple cores
b) express can...
April 4, 2008 at 10:57 am
rbarryyoung (4/3/2008)
Select A.*, B.*
From TableA A
...
April 4, 2008 at 7:41 am
i'm not disagreeing with you matt regrading outer joins. i'm simply pointing that in some complex queries with inner joins, the execution plan (and performance) can be changed by...
April 3, 2008 at 4:33 pm
look for BCP in your SQL Server documentation. it's made for moving data in/out of SQL Server.
from the operating system command line, the basic syntax is like so:
bcp source_database..source_table...
April 3, 2008 at 2:42 pm
vinojsasidharan (4/3/2008)
So if i understand correct the best option is to have it in the FROM clause itself, got confused with the replies.
no, best practice is the JOIN conditions should...
April 3, 2008 at 2:35 pm
i'm confused by this:
Now how do I list out the different data values that are not common to each table & also show what data is there in what table.
if...
April 3, 2008 at 2:31 pm
what about:
bcp out to a file
zip the file (if big)
ftp/copy the file/zip
unzip the file (if necessary)
bcp in from file
if the table has identity columns or computed fields, you'll need a...
April 3, 2008 at 2:26 pm
to add to mark's comment...
ideally, the FROM clause should describe how the tables JOIN together (dept join emp on dept.deptId = emp.deptId) and the WHERE clause should have criteria for...
April 3, 2008 at 2:22 pm
your approach depends on the setting of CONCAT_NULL_YIELDS_NULL.
if CONCAT_NULL_YIELDS_NULL is ON, then you can just do this:
When GCStatus='Redeemed'
Then 'redeemed '+ Convert(varchar(20),RedeemedDate,101)+
...
April 3, 2008 at 2:12 pm
John Doe should only have 2 sales, not 4.
SELECT a.userid,
COUNT(distinct a.salesid) as num_sales,
COUNT(b.amount)...
April 3, 2008 at 2:03 pm
i couldn't figure out how to do it with a CTE, but here's a loop that works.
create table #tableA ( companyId varchar(255) )
create table #tableB ( companyId varchar(255), companyName varchar(255))
;
insert...
April 3, 2008 at 1:54 pm
Viewing 15 posts - 226 through 240 (of 425 total)