Forum Replies Created

Viewing 15 posts - 10,546 through 10,560 (of 13,460 total)

  • RE: Append TO or Update FROM to load new schema with data from existing table?

    ironically it's really easy: the INSERT command combined with a SELECT with no WHERE statement will copy it all for you.

    Insert Into NewTable (ColumnList...)

    Select ColumnList...

    From OldTable

    --Order By OldPK --optional...

    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: Dynamically generate create view statement

    well...yes it is possible, but without more info, you won't have any useful product.

    100 tables? as many as 200 columns per table? an you just want to merge them all...

    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: equivalent for rownum

    that is one of the coolest things I've seen in a long time; Thanks Paul, I learned something,and have a shiny new toy to play with now.

    I added this to...

    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: equivalent for rownum

    Paul i tried your example on SQL2005 Standard, SP3, but i get a syntax error in a 9.0 compatibility database, as well as master. is that a 2008 feature? 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: where is the database 'state' is stored

    Mat gave you the script to read the flags of the status column; that is exact where it is stored/accessible...it might not be exactly what you wanted, but that's where...

    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: Executing unix commands in SSIS

    not even familir with unix by any means, but if the commands you pasted can be copied/pasted to a Windows cmd window, which then does the connection to the remote...

    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: Trigger not firing in SQL Server 2000

    the trigger itself looks ok, but it could still fail if any of the fields you are inserting are not null, but the data is null. That's where i...

    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: Trigger Code

    well, here's an example of a trigger...in this case, my trigger is keeping track of the last time a column was updated.

    for trigger interview questions, I'm afraid I can't help...

    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: alter query problem

    ranganathanmca (9/5/2009)


    thanks for your reply ps

    i want do it on sql query analyzer only if it possible for this plz tell me what is the error and...

    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: Can we schedule a job to generate scripts for objects?

    there's some script contributions here on SSC that call SMO; I've done this all via TSQL, where i stick a current "snapshot" of a database in a versioning table in...

    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: Granting Rights issue

    here's a similar example i did a while back; i was creating a database, and then adding roles, and then adding users, all as EXECUTE AS 'dbo'

    you could picksome 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!

  • RE: Granting Rights issue

    I think this is exactly why they introduced the new EXECUTE AS command;

    you don't REALLY want to give them extra rights, but they need to perform certain functions.

    for #1, 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: Reasons to use PRIMARY KEY?

    Ahh David, yeah, i fell into that SQL trap where i assume all my PK's are also the clustered index...my bad.

    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: Reasons to use PRIMARY KEY?

    Speed.

    the PK determines the actual order of the data, so the any SQL's that use that "PK = somevalue" is very fast...because that PK index is used, and makes...

    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: ANYTHING THAT CAN HELP TRIM THE DATA FOR A GIVEN STRING...

    here's how i would do it with an CTE Tally Table:

    CREATE FUNCTION StripExtraSpaces(@OriginalText VARCHAR(8000))

    RETURNS VARCHAR(8000)

    BEGIN

    DECLARE @CleanedText VARCHAR(8000)

    ;WITH tally (N) as

    (SELECT TOP 1000000 row_number() OVER...

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