|
First
|
Prev |
Next
|
Last
Pages: 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
Case construct in function There is something wrong with this function. I am struggling with syntax with the case construct. CREATE FUNCTION GetPlannedDate ( @Date_expedition datetime @Time_expedition varchar(30) ) RETURNS datetime AS BEGIN DECLARE @ResultVar datetime DECLARE @Hours int DECLARE @Minutes int set @Hours = ... 22 Jul 2008 09:35
Using Case condition in the WHERE clause Hi, I have a below query. Select * from Employees(NOLOCK) Where HomeCountry = 'USA' AND HostCountry = 'JAPAN' In some places i want to use 'OR' in place of 'AND' in the WHERE Clause based on one Flag ANDORFLAG. IF ANDORFLAG = 1 THen i want to use 'AND' in the WHERE CLAUSE. IF ANDORFLAG = 0, THEN i want t... 21 Jul 2008 04:51
Round Function ROUND Returns a numeric expression, rounded to the specified length or precision. Syntax ROUND ( numeric_expression , length [ , function ] ) Arguments numeric_expression Is an expression of the exact numeric or approximate numeric data type category, except for the bit data type. length Is the prec... 21 Jul 2008 03:49
For Plamen Ratchev Plamen, Back in May you helped me by posting the code below to create records into a groups table. Now I want to create a new indexed table field called GroupNameUpOneLevel. I would like it to store: SalesPersonName GroupName GroupNameUpOneLevel --------------------- -------------- ... 22 Jul 2008 09:35
'Having' question If I use: HAVING (GroupName LIKE @EnterMasterGroupName + N'%') I get: GroupName: ========= Earth.New Zealand.Auckland Earth.New Zealand.Auckland.Henderson Earth.New Zealand.Auckland.Epsom Earth.New Zealand.Wellington Earth.New Zealand.Wellington.Upper Hutt Earth.New Zealand.Wellington.City Center W... 21 Jul 2008 13:04
Upsert Proc using IF logic Here is the sample code: CREATE PROCEDURE [dbo].[WDSHE_CATEGORIES_INSERTUPDATE] @cat_name varchar(50), @status char(1), @na_only char(1) AS declare @msgcnt int, @msg_ok varchar(100), @msg_invalid varchar(100) set @msg_ok = 'Value Added Successfully' set @msg_invalid = 'Value Already ... 23 Jul 2008 02:02
Iterating XML in SQL Server 2005 (or 2008) stored procedure I need to update add rows in a table from the UI. Rather that call my AddData stored proc 3 times to save 3 rows of data, I'd rather wrap the data in XML and pass this to the stored proc. Then, I'd like to iterate the XML block and perform 3 INSERTs. How can this be accomplished? Does anyone have a sample stored pr... 23 Jul 2008 14:20
SQL Server 2000 SP4 Becomes clogged!!! I have a SQL Server 2000 SP4 Enterprise Edition with Build 8.00.2039. OS: Microsoft Windows Server 2003 Ent. SP2. 6GB Ram and AWE is enabled for SQL Server to use more than 4 GB. The server hosts some reporting databases where Business Objects execute stored procedures to pull data for these reports. All of a... 20 Jul 2008 21:42
Normalization Techniques Aaron Bertrand [SQL Server MVP] wrote: Is performance during data population really an issue? This seems like a one-time cost that you can process in the off-hours. Here is a simple example that will show how to use the countries table to populate the new items, and then join against it to populate the "r... 21 Jul 2008 06:53
DECLARE @myTable TABLE - Usage INSERT INTO @ProductTotals SELECT item FROM dbo.fnSplit( ... ) "Gene Berger" wrote: The following line works: SELECT * from fnSplit('test1~test2','~') WHY DOESN'T THE FOLLOWING WORK? DECLARE @ProductTotals TABLE ( item VARCHAR(8000) ) --SELECT @ProductTotals = dbo.fnSplit('tes... 22 Jul 2008 10:37 |