Forum Replies Created

Viewing 15 posts - 10,036 through 10,050 (of 13,460 total)

  • RE: Copy DB - different name - end of month

    i think this is pretty close; renaming the new db and it's files:

    it gives me this for the print statement:

    RESTORE DATABASE [MSPHXX_ARC_2010_02_01] MOVE N'MSPHXX_ARC' TO N'K:\MSPHXX_ARC_2010_02_01.MDF',

    MOVE N'MSPHXX_ARC_LOG' TO N'L:\MSPHXX_ARC_2010_02_01.LDF'

    FROM...

    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: Copy DB - different name - end of month

    my script just had print @sql; i did not include the final exec(@sql); sorry, i thought that was intuitive;oops!

    just add that to the end of it;

    I assumed that since we...

    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: Copy DB - different name - end of month

    it's all part of the rESTORE command; i just fiddled with a backup command and scripted it;

    i think you mean the MOVE command, right?:

    RESTORE DATABASE [SandBox_2010]

    FROM DISK =...

    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: Copy DB - different name - end of month

    i think the easiest is a full backup, and then a restore with a name that was dynamically created.

    i don't think the backup command takes a variable for the database...

    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: I want to display Custom Error Message!!

    in sql 2000, you cannot do it.

    any error 16 or above, which would be datatype error like you saw, constraint violations for foreign keys/pk/unique constraints cannot be custom captured.

    you 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: Patern Matching

    if your column is varchar or nvarchar, it's fairly easy; you know the exact length of the string to catch, and can use charindex or patindex to find where it...

    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 to break up a single row into multiple rows

    Jason does your string always have exactly two items, or is it a long string where the first five items are SSN/name/address, and comma delimited 6 thru N are items?

    you...

    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 to check all servers on domain to see which ones have sql server installed

    also look into SQLRecon;

    it's free and does a very thorough scan of all IP's on your network, looking for SQL in multiple ways.

    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: Database Design- IS NOT NULL always better choice?

    i think he's asking is it a good practice to make columns NOT NULL and insert default values, vs leaving them nullable.

    as usual, the answer is "It depends"; this is...

    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 and Where is profiler trace file scheduled/coming from?

    starting with the obvious, did you select * from sys.traces? maybe it's a server side trace someone has created?

    select * from sys.traces

    --results

    id status path ...

    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: PK Questions

    Ken for me, what i end up doing is still creating a PK on an identity column, ie "ContractID",

    and having a unique constraint on the columns that make a unique...

    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: UPDATE query taking more time ...

    i think one problem is you are joining the same table 6 times, when it is not necessary:

    SELECT a.ID, RTRIM(LTRIM(a.ID)) as fID,

    a.demID,

    b.mid AS gp,

    c.mid AS op,

    d.mid AS oom,

    e.mid AS...

    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: Multiple Joins with a twist

    there's two concepts you'll want to use here to get the desired results:

    using a CROSS JOIN can give you every possible combination.

    using a LEFT OUTER JOIN can show you...

    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: Is There A Script To List Tables & Number Of Records In Each

    the recommended way is to use the count of the rows in the indexes to get the number of rows; it's already materialized, and much faster than querying each table...

    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: read file names from folder

    yep, since openrowset doesn't accept variables,(?right?) you'll be stuck with a cursor to go thru the table of file names, and dynamic SQL to do the openrowset and shredding of...

    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 - 10,036 through 10,050 (of 13,460 total)