Forum Replies Created

Viewing 15 posts - 8,641 through 8,655 (of 13,460 total)

  • RE: Mass Update\Replace within Transaction

    you've got to use a counter or a where statement which preventrs teh same row from being processed.

    for example, if your table has an identity column:

    dim @start int

    dim @end int

    SELECT...

    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: changing dependent Stored procedures if table schema changes

    Shekhar this is a very common scenario...table changes are made, and procedures that are dependant on that table's schema may fail;

    I like to use this cursor *gasp* below, which...

    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: Incrementing a field

    sc-w (9/30/2010)


    Thank you for your help but the answer that i needed was this so i help it helps someone else.

    alter table yourtable

    add autonumber int identity(1,1)

    go

    yes that works, but...

    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: asking about virtual field

    not sure by what you mean as a "virtual field"

    are you talking about a column in a view, which does not exist in the underlying 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: Calculating Columns in a View

    yes you can, the syntax is the same as when you select something based on other data, just make sure the column name is assigned;

    ColumnName = [calculation,case statement, formula,etc]

    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: Incrementing a field

    another option is to use the SSMS GUI and design the table;

    if you add the new column, and make sure you select that it has the identity property, the GUI...

    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 TRIGGER.. HOW TO STORE WHERE CONDITION

    Ritesh glad I could help, and thank you very much for the positive feedback. It's nice to know when something works well for someone.

    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 2005 - Permission problem with Database roles

    i think you want to avoid giving the db_datareader role in database 1.

    the two roles are additive..meaning db_datareader can read EVERY view and table...so adding them to a "restricted" role...

    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: Correlated Subqueries

    i hope i can explain this well...

    a correlated sub query is where a column from the OUTER query is referenced in the sub query to limit the results:

    SELECT

    ...

    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 "X" with 0-9

    here's one example using a CTE Tally Table:

    with Tally as (

    SELECT TOP 11000 --only need ten digits for this job, though

    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!

  • RE: Strange issue with a huge SSRS 2008 report (supposed to return 3 million records)

    well, there's a few things going all wrong here;

    the first one is such a large report ....three million rows.you've lost sight of what an HTML report is supposed to do.

    it's...

    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: Create new record using external CSV file

    it's actually pretty easy;

    INSERT INTO Letter_C (list of columns)

    SELECT (same list of columns,same order) FROM #Temp

    EXCEPT

    SELECT same list of columns,same order FROM Letter_C

    this will find all the...

    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: Create new record using external CSV file

    well all you have to do is get the csv file into a table or linked server so you can use a set based operation against it.

    i do not see...

    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't see all the data in a field on my machine but can on another machine

    could it be that one machine is connecting to , say, the PRODUCTION database and the other connecting to a older copy of that same DB, but hosted on a...

    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 CONVERT AN INTERGER TO A STRING THEN USE AS A JOIN TO THE TABLE.

    you've definitely got some data that cannot be converted to int, ie empty string or 'N/a' that someone data entered;

    I'd suggest changing the join and the WHERE statement 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!

Viewing 15 posts - 8,641 through 8,655 (of 13,460 total)