Viewing 15 posts - 1 through 15 (of 64 total)
Thanks for your input everybody!
I should probably write my initial question something like this:
I have a totaly theoretical question regarding merge statement. It can be used for 'upsert' functionality where...
September 15, 2015 at 4:34 am
Wow, such negative comments... As I wrote before, it was purely curiosity that made me ask the question how to convert my if exists update ... else insert ...
into...
September 14, 2015 at 10:41 pm
@SeanLange: in reality it is a normal table, I just used temp table in the example script, sorry about that.
My way of doing it now is like this:
create...
September 14, 2015 at 7:32 am
@luis Cazares:
Thank you guys.
No no, thank you 🙂
@Eirikur Eiriksson: I learned a lot from your solution (never saw 'LAG' and 'ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW'...
May 26, 2015 at 1:20 am
@scottpletcher - I tried it now and it seems that both clustered and nonclustered indexes are running for about the same time.
December 30, 2014 at 2:04 am
I wrote a CLR function instead:
public static class FingerPrint
{
[SqlFunction(DataAccess = DataAccessKind.Read,SystemDataAccess=SystemDataAccessKind.Read)]
...
December 4, 2014 at 7:46 am
Well the point is, that my application is under frequend audits by our client and the random number generator is an important part of it (i am creating lottery games)...
February 20, 2013 at 4:13 am
Thanks everybody for reply!
I'm pretty sure my c# method is ok (code taken from here: http://msdn.microsoft.com/en-us/magazine/cc163367.aspx), so I just deployed it to Sql:
[SqlFunction]
public static int RndBetween(int minValue, int maxValue)
{
if (minValue...
February 18, 2013 at 4:59 am
Jeff, your solution works better, thanks.
I am using Microsoft SQL Server Management Studio 10.50.2500.0, @@version:
Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)
Jun 17 2011 00:54:03
Copyright (c) Microsoft...
February 5, 2013 at 5:22 am
You should probably use pivot operation (I hope somebody will post an example), but this should also work:
use tempdb
declare @t table (
Skill varchar(10) not null,
BU1 int not null,
BU2 int not...
December 19, 2012 at 12:56 am
Can you describe what you are trying to do here?
December 14, 2012 at 6:39 am
A little side note - to drop all tables you can also use sp_msforeachtable procedure, like:
sp_msforeachtable 'drop table ?'
If your tables are connected with foreign keys, then you would have...
December 14, 2012 at 5:58 am
I would suggest that you never test for such an inequality in such a manner. Always test for the equality and if that test "fails", then it must be...
December 4, 2012 at 11:35 pm
Viewing 15 posts - 1 through 15 (of 64 total)