Forum Replies Created

Viewing 15 posts - 10,786 through 10,800 (of 26,489 total)

  • RE: Updating Unique Sequential NUmber

    gerard-593414 (7/11/2012)


    I have a table which holds the next Invoice Number. What SP code should I use to increment it (Cant be self incrementing)

    There are numerous users and want...

  • RE: Get Column name & table name from value

    Probably for the same reason I do, the sysstem views have more information available than the INFORMATION_SCHEMA views. If I was writing something that had to be portable between...

  • RE: TSQL for result DB name, Size and Recovery model

    SQLRNNR (7/11/2012)


    Lynn Pettis (7/11/2012)


    You keep asking the same question. There are two system views that will help you: sys.databases and sys.master_files. Look up these views in Books Online...

  • RE: TSQL for result DB name, Size and Recovery model

    You keep asking the same question. There are two system views that will help you: sys.databases and sys.master_files. Look up these views in Books Online and figure out...

  • RE: Why is my tempdb growing

    mitzyturbo (7/11/2012)


    Tempdb MDF doesn't seem to grow now when I run the query again which seems strange, I'm guessing this is down to the result set getting cached in memory

    Haven't...

  • RE: help to rewrite ugly query

    Mark-101232 (7/11/2012)


    with cte as (

    select row_number() over (partition by identifier, templateid order by CreateDate desc ) as num,

    count(*) over (partition by identifier, templateid)...

  • RE: help to rewrite ugly query

    Here is one way:

    create table #tmp1 (

    formfileid int,

    identifier varchar(100),

    templateid int,

    [status] tinyint,

    createdate datetime

    );

    insert into #tmp1

    select 1, 'xx1', 1, 0, '1/1/2010'

    union select 2, 'xx1', 1, 0, '1/2/2010'

    union select 3, 'xx1', 1,...

  • RE: SQL error on scaler variable

    Sounds like you don't have permissions to create a stored procedure.

  • RE: Loop within a Loop

    ChrisM@Work (7/11/2012)


    Or like this:

    ;WITH Numbers AS (SELECT * FROM (VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20),(21),(22),(23),(24),(25),(26),(27)) d(n))

    SELECT CHAR(a.n+64) + CAST(b.n AS VARCHAR(2))

    FROM Numbers a CROSS JOIN Numbers b

    WHERE a.n < 27

    I like this...

  • RE: Loop within a Loop

    Or you could do it this way:

    WITH e1(n) AS (SELECT n FROM (VALUES(1),(1),(1),(1),(1),(1),(1),(1),(1),(1)) dt(n)),

    e2(n) AS (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) n FROM e1...

  • RE: Why is my tempdb growing

    Since you are running a aggregate query, SQL Server has to sort the data by the group by columns so that it can properly complete the aggregation. This will...

  • RE: Loop within a Loop

    Looking for something like this? Granted, I hardcoded, but if needed I'm sure I could come up with something more generic.

    SELECT

    dt.a + CAST(dt1.n AS VARCHAR)

    FROM

    ...

  • RE: getting leap year and non leap year in report

    I am confused slightly by your initial post. Your procedure takes two dates as input parameters, a start date and an end date. As you did not provide...

  • RE: Split text data type into rows

    Problem I see with your sample data is that ther is no clear seperator between the values. Some of your beaks appear to be the semicolon (;) but others...

  • RE: Fantasy football 2012

    Ray K (7/11/2012)


    I just signed up!!!

    Go Orange Engineers!!!

    The returning champions, the SQL Bolts, have arrived!

    May the best team win, even if it isn't me.

Viewing 15 posts - 10,786 through 10,800 (of 26,489 total)