Viewing 15 posts - 5,356 through 5,370 (of 6,036 total)
Don't use dynamic SQL.
But if you really need to use dynamic SQL learn how to use parameters with sp_executesql.
_____________
Code for TallyGenerator
May 9, 2006 at 6:17 pm
Did you or anybody around heard something about data normalisation, some normal forms?
Difficulties with queries are just indicators of wrong design.
_____________
Code for TallyGenerator
May 8, 2006 at 6:49 pm
It's not clear what are you trying to do, but anyway CustomerId you are applying in TableB must be RETRIEVED from TableA.
If you are trying to update TableA with some...
_____________
Code for TallyGenerator
May 7, 2006 at 11:39 pm
You MUST have clustered index on MasterId,TypeID columns in Details table.
_____________
Code for TallyGenerator
May 5, 2006 at 3:00 am
Try simple UPDATE, without joins:
UPDATE LinkedServerName.DBName.dbo.TblName
SET [LinkCol_1] = LocalSQLTbl.[LocalCol_1]
FROM LocalSQLTbl
WHERE LocalSQLTbl.[LocalCol_2]='XYZ'
AND LocalSQLTbl.[LocalCol_ID] = LinkedServerName.DBName.dbo.TblName.[LinkCol_ID]
AND LinkedServerName.DBName.dbo.TblName.[LinkCol_3]='ABC'
_____________
Code for TallyGenerator
May 5, 2006 at 2:57 am
Use UNION of 2 queries with proper ORDER BY.
_____________
Code for TallyGenerator
May 4, 2006 at 4:48 pm
Did you think about having computed columns in your table with UDF as a formula?
This UDF may perform all calculations from your SP. And you supply values from your columns as...
_____________
Code for TallyGenerator
May 3, 2006 at 12:05 am
CREATE TABLE #TableUsage (
Name sysname,
Rows int,
reserved nvarchar(50),
Data nvarchar(50),
Index_Size nvarchar(50),
unused nvarchar(50)
 ![]()
EXEC sp_msforeachtable @command1= 'INSERT INTO #TableUsage exec sp_spaceused ''?'''
SELECT * FROM #TableUsage
_____________
Code for TallyGenerator
May 2, 2006 at 6:04 pm
Select T1.Date as [Current], MAX(T2.Date) as [Previous], DATEDIFF(dd, MAX(T2.Date), T1.Date ) as [Delta]
FROM Table T1
LEFT JOIN Table T2 on T2.Date < T1.Date
_____________
Code for TallyGenerator
May 1, 2006 at 6:42 pm
Check the execution plan.
SQL Server cannot use indexes on linked server, that's why it downloads the whole table to local server, applies updates and uploads modified table back to the...
_____________
Code for TallyGenerator
May 1, 2006 at 5:50 pm
... AND
(convert(numeric(5,2),
convert(float, lbd.total_training_seconds) /
NULLIF(convert(float, tit.tit_wfm), 0)) >= .80)
This will make NULL from the whole expression when it's going to divide by zero and NULL is not >=...
_____________
Code for TallyGenerator
May 1, 2006 at 3:48 pm
You really mean you want to have different data types in one column???
You must be kidding...
But if what you realy need is rounding, then functions ROUND is there for your...
_____________
Code for TallyGenerator
April 28, 2006 at 5:57 am
decimal(p,s) is not a function.
It's a type definition. You cannot insert any value inside type definition.
_____________
Code for TallyGenerator
April 27, 2006 at 9:18 pm
I did not get the question.
_____________
Code for TallyGenerator
April 27, 2006 at 8:27 pm
Type "CREATE FUNCTION" in BOL, there is a lot of explanatons over there.
_____________
Code for TallyGenerator
April 27, 2006 at 7:43 pm
Viewing 15 posts - 5,356 through 5,370 (of 6,036 total)