Assinging A variable value Declare @TTranType varchar(2) Case myTable.dbo.Col1 When 'A' then '01' When 'B' Then '02' Else '99' End My question is is there a simple way to assign @TTranType to the result of the case. ie if col1 = A than @TTranType will = '01' ... 14 Jan 2010 14:42
Can I index this kind of view? ALTER view [dbo].[vwIE01] as with tblcte_casoTipo(casoTipoId,origenId,codigoTipoId,codigoId) as ( -- data select a.casoTipoId,b.origenId,c.codigoTipoId,d.codigoId from SISFACBM.dbo.tblcasoTipo a cross join SISFACBM.dbo.tblorigen b cross join SISFACBM.dbo.tblcodigoTipo c cross join SISFACBM.dbo.tbltari... 14 Jan 2010 12:27
Can I do this? invoke function with parameter from join table select b.casoTipoId,b.origenId,b.codigoTipoId,b.codigoId from bma.dbo.tblIEInstruccionItem a join bma.dbo.tblIE01 b on (b.casoTipoId in (select casoTipoId from BMA.dbo.fnCasoTipo(a.casoTipoId)) and (b.origenId COLLATE Latin1_General_CI_AI=a.origen or a.origen is null) and (b.codigoTipoId COLLATE Latin1_Gener... 14 Jan 2010 12:27
WIndows Authentication Connection String I need to be able to connect to a database on a remote SQL Server from a .NET client using ODBC and Windows Authentication. I need to be able to specify a Domain username and password to connect where the domain username may or may not be the my currently logged in Domain username. In other words, let's say I was l... 15 Jan 2010 16:06
Help with sql query Hi All! Here is an example of table: USER DATE AMOUNT Tom 2009-08-11 10 Tom 2008-05-21 15 John 2009-12-02 20 Ben 2009-03-05 5 Ben 2009-08-23 25 Ben 20... 14 Jan 2010 06:52
Diferent times for execution the same code I have stored procedure with 2 parameters. If I execute this stored procedure it takes 9.5 seconds: exec dbo.proc1 'test', '20090115' If I open the stored procedure, set parameters value and execute the query, it takes 1 second: declare @param 1 varchar(10), @dateC datetime SET @param1='test' SET @dateC='2... 13 Jan 2010 12:06
Apply a calculation to all values in a column? Hi, Is it possible to apply a calculation to all the values in a column without using a WHILE loop or a CURSOR? I have the following example values in a column: 0.029000 0.012000 0.038000 0.011000 -0.048000 And I want to perform the following calculation on the values: result = (1 + value1) * (1 + val... 14 Jan 2010 21:25
sql commands for datediff hi i need a sql query for finding the datediff for a week,my problems is i have to automatic send a mail to hr by checking who are the staff coming late more than two days in a week,the mail has to be send last working day of that week. Submitted via EggHeadCafe - Software Developer Portal of Choice Word HTML Cl... 13 Jan 2010 06:33
Is there any function to convert the first letter to upper case? Hi All, Is there any function that converts the first character to upper case? Then the rest of the letters into lower case... Thanks, Eric ... 13 Jan 2010 14:22
Subquery help I am trying to set a value in a variable and am getting the error "Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression." The set line it fails on is below. How can I work around this? Thanks. SET @FedWHAllow ... 13 Jan 2010 09:50 |