Viewing 15 posts - 871 through 885 (of 2,007 total)
ThomasGr (2/20/2012)
with t as (select 1 x
union all
...
February 20, 2012 at 6:12 am
Better way: -
UPDATE #temp SET buss_seqno=new.buss_seqno
FROM (SELECT ID, name, start_seqo*10+rem_val AS buss_seqno
FROM (SELECT ID, name, buss_seqno, ROW_NUMBER() OVER (ORDER BY ID) - 1...
February 20, 2012 at 4:50 am
Something like this?
DECLARE @start_seqno INT
SET @start_seqno='12789';
WITH t1(N) AS (SELECT 1 UNION ALL SELECT 1),
t2(N) AS (SELECT 1 FROM t1 x, t1 y),
t3(N) AS (SELECT 1 FROM t2 x, t2 y),
t4(N)...
February 20, 2012 at 3:05 am
The same as Tom, I've said "You would have voted "NO" for SOPA no matter how it was written" because I don't believe there is a realistic chance of ever...
February 20, 2012 at 2:17 am
Hello and welcome to SSC!
First, when you ask a question you get more responses when you provide us with DDL and sample data. This time, I've done it for you:...
February 17, 2012 at 8:50 am
BEGIN TRAN
--Sample Data
CREATE TABLE Projects (projectID INT IDENTITY, projectName CHAR(5))
INSERT INTO Projects
SELECT projectName
FROM (VALUES('ProjA'),('ProjB'),('ProjC'),('ProjD')) a(projectName)
--Sample Data
CREATE TABLE Customers (customersID INT IDENTITY, customerName CHAR(9))
INSERT INTO Customers
SELECT customerName
FROM (VALUES('CustomerA'),('CustomerB'),('CustomerC'))a(customerName)
--Sample Data
CREATE TABLE Data...
February 17, 2012 at 8:11 am
tcarcieri (2/16/2012)
So if I remove the t4(N) line, would I reduce the number of years by a factor of 10? Thereby limiting to just 6K years?...
February 16, 2012 at 10:27 am
WITH t1(N) AS (SELECT 1 UNION ALL SELECT 1),
t2(N) AS (SELECT 1 FROM t1 x, t1 y),
t3(N) AS (SELECT 1 FROM t2 x, t2 y),
t4(N) AS (SELECT 1 FROM t3...
February 16, 2012 at 8:50 am
BEGIN TRAN
--Sample data
CREATE TABLE #yourTable (FirstYear INT, LastYear INT, Make CHAR(2), Model CHAR(6))
INSERT INTO #yourTable
SELECT FirstYear, LastYear, Make, Model
FROM (VALUES(1950, 1951, 'VW', 'Beetle'),(1950, 1960, 'VW', 'Beetle'),
...
February 16, 2012 at 8:17 am
Jeff Moden (2/15/2012)
jennigirl (1/18/2012)
February 16, 2012 at 3:28 am
Jeff Moden (2/15/2012)
🙂I did say that I've tested this before. :hehe:
Ah, but where would I be if I didn't insist on writing test-scripts to test everything?
February 16, 2012 at 3:17 am
soulchyld21 (2/16/2012)
SELECT distinct Customer_Number, SUM(price) As Total
FROM...
February 16, 2012 at 3:13 am
pwalter83 (2/15/2012)
I have a requirement to convert minutes to HH:MM:SS format. However, the minutes to be converted are calculated through this query:
(sum(datepart(hour,Timenetin) * 60) + sum(datepart(minute,Timenetin) * 1) +...
February 15, 2012 at 4:25 am
--Build some sample data and DDL script
CREATE TABLE time_tbl (time_id INT IDENTITY(1,1), employee_id INT, time_date DATETIME,
time_start DATETIME, time_end DATETIME, time_details VARCHAR(MAX))
CREATE TABLE employee_tbl (employee_id INT IDENTITY(1,1), employee_name VARCHAR(200),
employee_join_date DATETIME)
--Generate 500...
February 15, 2012 at 4:07 am
Viewing 15 posts - 871 through 885 (of 2,007 total)