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.
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.
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...
May 7, 2006 at 11:39 pm
You MUST have clustered index on MasterId,TypeID columns in Details table.
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'
May 5, 2006 at 2:57 am
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...
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
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
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...
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 >=...
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...
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.
April 27, 2006 at 9:18 pm
I did not get the question.
April 27, 2006 at 8:27 pm
Type "CREATE FUNCTION" in BOL, there is a lot of explanatons over there.
April 27, 2006 at 7:43 pm
Viewing 15 posts - 5,356 through 5,370 (of 6,036 total)