Forum Replies Created

Viewing 15 posts - 871 through 885 (of 2,007 total)

  • RE: TSQL that lists all numbers from 1..100

    ThomasGr (2/20/2012)


    Try this one:

    with t as (select 1 x

    union all

    ...

  • RE: geerate businees sequece number

    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...

  • RE: geerate businees sequece number

    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)...

  • RE: SOPA and Censorship

    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...

  • RE: CAN ANY ONE help me i just want create view STORE PROCEDURE FOR table3 by inner joinTABLE

    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:...

  • RE: Listing customers who are not taking advantage of projects

    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...

  • RE: adding years loop

    tcarcieri (2/16/2012)


    Thank you for the clarification.

    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?...

  • RE: adding years loop

    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...

  • RE: adding years loop

    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'),

    ...

  • RE: Count Function

    Jeff Moden (2/15/2012)


    jennigirl (1/18/2012)


    I can get a total count of rows returned, but I am trying to get a count of tickets assigned to each person. I don't work a...

  • RE: Mulitple Saarch Criteria using ONE Column

    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?

  • RE: SELECT wont work using IN()

    soulchyld21 (2/16/2012)


    however I would like to find customers who have bought prod1 and prod2 and not bought prod3 and prod4, I tried using this code

    SELECT distinct Customer_Number, SUM(price) As Total

    FROM...

  • RE: Convert minutes to HH:MM:SS format

    pwalter83 (2/15/2012)


    Hi,

    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) +...

  • RE: Get Time defaulters list

    --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...

Viewing 15 posts - 871 through 885 (of 2,007 total)