Viewing 15 posts - 3,601 through 3,615 (of 8,416 total)
For anyone reading this thread in future that would prefer range results (as below) here's another method.
customer product from_date ...
April 29, 2010 at 7:44 am
alicia-694427 (4/28/2010)
April 29, 2010 at 6:15 am
USE tempdb;
GO
-- *Inline* table-valued function
-- Deterministic, system verified, not precise
GO
CREATE FUNCTION dbo.NaturalRound
(
@Value DOUBLE...
April 29, 2010 at 6:04 am
DECLARE @DatabaseName SYSNAME;
SET @DatabaseName = QUOTENAME(N'AdventureWorks');
DECLARE @data
TABLE (
table_name SYSNAME PRIMARY KEY,
...
April 29, 2010 at 5:17 am
Another option is to use the OUTPUT clause:
SET XACT_ABORT OFF;
DECLARE @test-2
TABLE (
row_id INTEGER IDENTITY PRIMARY KEY,
...
April 29, 2010 at 4:36 am
USE tempdb;
GO
CREATE TABLE dbo.Class
(
ClassID INTEGER...
April 29, 2010 at 4:11 am
SELECT name
FROM sys.types;
April 29, 2010 at 3:34 am
Atif Sheikh (4/29/2010)
Sorry. forgot to replace the table names in the cte.
You changed rather more than that!
"Forgot" :laugh: must remember that one. Funny.
April 29, 2010 at 3:30 am
This doesn't really add much value to Peter's version, but just for my own amusement:
DECLARE @MissingNumbers
TABLE (n INTEGER NOT NULL);
INSERT @MissingNumbers (n)
VALUES (1),(2),(4),(5),(7),(8),(11),(12),(13),(15),(17),(19),(20);
SELECT N.n
FROM...
April 29, 2010 at 3:05 am
Lots of alternatives here (triggers, stored procedures...).
Here's one of the more interesting ones:
USE tempdb;
GO
CREATE TABLE [dbo].[TALK]
(
...
April 29, 2010 at 2:55 am
DECLARE @list VARCHAR(50) = '1,2,4,5,7,8,11,12,13,15,17,19,20',
@Delimiter CHAR(1) = ',';
SELECT Numbers.n
FROM dbo.Numbers(REVERSE(LEFT(REVERSE(@list), CHARINDEX(@Delimiter, REVERSE(@list)) - 1))) Numbers
WHERE CHARINDEX(@Delimiter...
April 29, 2010 at 1:42 am
kinzent (4/28/2010)
April 28, 2010 at 10:15 pm
SwePeso (4/28/2010)
Paul White NZ (4/28/2010)
For giggles, here's an extension to my previous code that supports sequnces up to 146,813,779,479,510 (way beyond INT32) - which gives ZZZZZZZZZZ (ten of them!)
Paul, what...
April 28, 2010 at 7:15 pm
For giggles, here's an extension to my previous code that supports sequnces up to 146,813,779,479,510 (way beyond INT32) - which gives ZZZZZZZZZZ (ten of them!)
SELECT N.n,
...
April 28, 2010 at 9:52 am
Hugo Kornelis (4/28/2010)
* The date format. Not all locale settings recognise "Dec" as december. (Try adding "SET LANGUAGE German;" as the first line -...
April 28, 2010 at 7:31 am
Viewing 15 posts - 3,601 through 3,615 (of 8,416 total)