Forum Replies Created

Viewing 15 posts - 6,721 through 6,735 (of 13,460 total)

  • RE: Converting julian time to time

    is the data integer data type or strings?

    so the value 24701 is 2:47:01 (am?)

    152205 would be a valid value and 15:22:05 or 3:22:05 pm?

    something like this may be...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Replace real surnames and forenames with random selections

    a lot depends on your data; that cross join can have a cost.

    if your data is anything like my copies of the US Census to 90% firstnames/lastnames, a cross...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Interview Question

    (: Hakuna Matata 🙂 (9/21/2011)


    Can we rollback if we use truncate command??? I dont think we can rollback since truncate command does not generate any logs.

    try it yourself.

    ALL transactions can...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Interview Question

    hint # 1 the number of rows don't matter...testing it yourself goes a lot farther education-wise than asking and getting an answer....

    hint # 2 when can you use or not...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Need DDL for VIEW to return distinct, single row

    Express12 (9/21/2011)


    Lowell - worked perfectly. thanks!

    you did everything right, thank you! excellent explanation, sample code of what you tried, gave me everything i needed to build a testable, working example.

    good...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Need DDL for VIEW to return distinct, single row

    sounds like row number will give you exactly what you need:

    SELECT

    ACCT,

    ROOM,

    CUST,

    REGION,

    LASTUPDATEDATECORP

    FROM

    (SELECT

    ROW_NUMBER() OVER(PARTITION BY...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Get Column and table name from given Query

    you could get it from the execution plan, if it was in the cache.

    it's not easy, as xQuery's a little difficult, but it's in there.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to write use dbname in a loop

    you could also use three part naming, and not use the USE command at all:

    select * from test.dbo.sysobjects where xtype='u'

    --or

    select * from test.sys.tables

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: New to ASP, getting an error

    Connection.Execute(sqlStatement) optionally returns a dataset. use that to get uthe update and the results in one pass.

    i would use a two statement combo like this:

    dim Conn ' As Object

    set Conn...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: how to store result of 1 sp into sp

    Ninja's_RGR'us (9/20/2011)


    Sean Lange (9/20/2011)


    And don't add an accidental space into Lowells naming convention. (WHORE SULTS). :w00t:

    Which when I first read it i transposed the U and L in the second...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: how to store result of 1 sp into sp

    you have to create a table that mirros teh output of the proc you want to capture...

    here's a basic example, just grabbing sp_who2 results:

    CREATE PROCEDURE PR_CAPTURESP_WHO

    AS

    BEGIN

    SET NOCOUNT ON

    ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: iTVF: Better way to code this?

    17 minutes or 1.5 hours sounds a lot more like a performance issue rather than than an ITVF issue;

    consider updating statistics (UPDATE STATISTICS ON TBLNAME WITH FULLSCAN) for each...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: strings, substring, patterns (or lack of them)

    ok here's an enhanced version of a parsename function, which takes any number of items, and an optional delimiter to boot:

    i think this is from a Jeff Moden post ....

    --usage:

    with...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Replace real surnames and forenames with random selections

    i believe this will do what you want...obviously test this first!

    --random first land last names,

    ;With MyRandomNamePairs AS

    ( SELECT

    ROW_NUMBER() OVER(ORDER BY Surname.ID) AS N,

    ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQL 2008 Datatype-Length Help needed

    hydbadrose (9/20/2011)


    For Project_Item 1.1.A I was thinking to use float.

    [1.1.A]

    it has two periods and the letter "A" in it...it would have to be a varchar.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 6,721 through 6,735 (of 13,460 total)