Viewing 15 posts - 361 through 375 (of 2,038 total)
Hi
Try this (untested)
UPDATE m SET
m.Project_ID = 22
FROM TEMPTABLE t
JOIN MYDATA m ON t.ERRORNUM = ERRORRECORD
Greets
Flo
September 1, 2009 at 2:05 pm
Hi x198yn
x198yn (8/29/2009)
September 1, 2009 at 1:48 pm
Hi florim
With new O/R-Mappers (like LINQ2SQL, EF, nHibernate, ...) I don't think the pro or contra procedures is based on security issues any more. They use parametrized statements which avoid...
September 1, 2009 at 1:39 pm
Use CONVERT to convert ColX and ColY to VARCHAR in your "THEN"-parts
August 28, 2009 at 8:17 am
You can use DATEPART on SQL Server 2000:
CREATE TABLE #Sales (SalesDT datetime, SalesAmt money)
INSERT INTO #Sales (SalesDT, SalesAmt) VALUES ('2009-08-28 14:15:42', 100)
INSERT INTO #Sales (SalesDT, SalesAmt) VALUES ('2009-08-28 14:16:55', 50)
INSERT...
August 28, 2009 at 8:07 am
You don't need a loop to handle this. Use a JOINed UPDATE statement which only handles rows with same key in both tables:
UPDATE A SET
...
August 28, 2009 at 8:00 am
Usually you should provide dates in ISO or ODBC style in TSQL. If you want to use British date format you have to use CONVERT with style information or SET...
August 28, 2009 at 7:55 am
Static/shared contexts can be used for tasks where they are useful for but are not required within a function/procedure.
Sample:
Compiled Regex is much faster than a not compiled, but the compilation...
August 27, 2009 at 12:09 pm
Hi Jonathan
Sure, my sample is not thread safe. It was just a sample how to add static fields into a CLR function. To get it thread safe you can use...
August 27, 2009 at 9:51 am
The error:
You have to use aliases for your tables or use a complete qualified column name like "SELECT TXBTESTDTA.CLMMSTP.CIENT".
BTW:
Try to get rid of the old JOIN syntax as combination of...
August 27, 2009 at 7:51 am
Great article! Thanks!
Little hint for .NET developers:
New .NET wrapper types SqlHierarcyId, SqlGeography, SqlGeometry are not stored in System.Data.dll but in "Microsoft.SqlServer.Types.dll" in "c:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\" directory. After adding the...
August 27, 2009 at 7:17 am
It depends...
You should work with chunks of data (e.g. 100,000 rows in one chunk).
Would it be okay if your tables are locked while insertion? It defines the possible count of...
August 27, 2009 at 2:15 am
Hi
You can handle your complete work within one statement:
DECLARE @WorkingDays decimal(18,0),
@LWOP decimal(5,2),
@Absent decimal(5,2),
@CasualLeave decimal(5,2),
@CompensatoryLeave decimal (5,2),
@DutyLeave decimal (5,2),
@VacationLeave decimal(5,2),
@MonthDays int
UPDATE EmployeeSalarySheetNew SET
@LWOP = ISNULL(LWOP,0)
...
August 27, 2009 at 2:09 am
If both databases have same structure you can use replication. If not, what about a usual ETL scenario?
August 26, 2009 at 9:43 am
Hi Barry!
Thanks for the tip. Another way to handle this is a "static readonly" field which represents a wrapper for the real object ;-).
Here's a little sample:
class...
August 26, 2009 at 9:37 am
Viewing 15 posts - 361 through 375 (of 2,038 total)