Forum Replies Created

Viewing 15 posts - 2,536 through 2,550 (of 13,460 total)

  • RE: Import to MSSql from varying tab delimited text files

    if you want to go the all TSQL route, then Openrowset of a single file,or linked server for a folder full of files is probably the answer.

    with an linked server/openrowset...

    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: Extend size of default trace to be more than 100 MB, Is it possible?

    you cannot change the default trace, but you can create your own trace, with the exact same settings, and have it use more rollover files, larger files, etc.

    another issue...

    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 conditions in one trigger

    Igor Micev (2/10/2014)


    Lowell (2/10/2014)

    INSERT INTO TableB(a,b,c)

    SELECT a,b,c FROM INSERTED

    WHERE ConditionA=1

    INSERT INTO TableB(a,c,d)

    SELECT a,c,d FROM INSERTED

    WHERE ConditionB=1

    [/code]

    Be careful. What if the first INSERT extends the ConditionB set?!

    exactly why i said 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: Multiple conditions in one trigger

    gautham.gn (2/10/2014)


    Hi,

    I have a requirement that two update conditions may happen for a table A. And we need to store the updated records in table B in such a way...

    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: Including the filename in a bcp load.

    David, where would you put the data reference to the file? is there an additional column at the end of the table, that you can use to update right after...

    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: Comparing 2 Columns until the 1st "."

    since what he pasted was almost, but not quite, tab delmited, i rant it through my macro to cleanup;

    MAYBE the data is two columns, but here's what i think he...

    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: An error occurred while executing batch. Error message is: Exception of type 'System.OutOfMemoryException' was thrown.

    pretty sure that error is client-side error from ssms, and not a sql server error.

    is your script pretty large? does it not have GO statements between some of the blocks...

    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: Website Link that allows testing of SQL script

    have you seen sqlfiddle.com/ yet?

    it's a nifty web based site that puts you in a sandbox for testing;

    in the long run, it's much better to add a sql express or...

    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 do i get usernames for everydatabase including the admins

    for sql users or windows users, you need to UNION ALL something like this to explicitly show the sysadmins, since they inherit the permissions via their server role

    SELECT r.name,'sysadmin',dbs.DatabaseName

    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: Maintenance Plan

    something to help you visualize:

    anything with rows modified<5% don't really need to be touched, anything with rows modified < 30 % can take advantage of the REORGANIZE command; anything...

    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: Maintenance Plan

    the answer is the maintenance plan is "good enough";

    the maintenance plan is good, but not great; that's the sole difference.

    the maintenance plan rebuilds everything, which is often not necessary; an...

    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: Bit of a "Newbie" question. Compare and join databases.

    stefan 97267 (2/7/2014)


    Hello all, greetings from a cold-winter Sweden.

    I have a problem that i need help with, tried to seach the forum posts but got too many hits.

    A customer has...

    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: INSERT INTO, EXCLUDING ONE COLUMN

    is this a subset of a larger script? why the dynamic SQL?

    also, since you drop and recreate the table every time, why not a temp table?

    why create the 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: INSERT INTO, EXCLUDING ONE COLUMN

    hoseam (2/7/2014)


    Without listing the columns??

    nope. it's actually a best practice to name the columns every single time, because as soon as you add a column to either table, any existing...

    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: INSERT INTO, EXCLUDING ONE COLUMN

    hoseam (2/7/2014)


    Hi

    Is there a way I can:

    INSERT INTO TableA

    SELECT * FROM TableB

    but exclude one column from TableB?

    My TableB has ID which is IDENTITY(1,1), I want to select everything to TableA...

    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 - 2,536 through 2,550 (of 13,460 total)