Forum Replies Created

Viewing 15 posts - 2,521 through 2,535 (of 13,460 total)

  • RE: SQL Server Function: Cursor or Tally Table; which to use, HELP

    good start Knives;

    so here's my same query, with your updated data in it;

    so if you run this and look at the data, does it produce the desired results?

    code]

    ;WITH

    TENS...

    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 Server Function: Cursor or Tally Table; which to use, HELP

    can you convert that into a CTE or insert statemetns, the way i did?

    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 Server Function: Cursor or Tally Table; which to use, HELP

    Knives85 (2/11/2014)


    Lowell, JamesM said it, that's a brilliant solution, now that I've seen it, I don't know why I didn't think of it 😀 lol

    The code you posted 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: SQL Server Function: Cursor or Tally Table; which to use, HELP

    took me a bit for this one; this seems to do the whole shebang

    ;WITH

    TENS (N) AS (SELECT 0 UNION ALL SELECT 0 UNION 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: Generating CREATE TABLE Scripts for a large number of tables

    i slapped together a TSQL way to script out a table , so something like this might help; you'll run into issues if the generated scripts are not in foreign...

    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 Server Function: Cursor or Tally Table; which to use, HELP

    well i've only done one piece of it...adding the date;

    i have a simple macro i use to dump typical copy/paste data and turn it into a CTE, so coming up...

    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: Query from a list in an excel file

    I agree with Welsh Corgi; this sounds like a one time comparison, so there's no real need to add a linked server.

    I would use the Import wizard, just has Welsh...

    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 Server Function: Cursor or Tally Table; which to use, HELP

    yep , a tally table, combined with a dateadd seems to be what you are after.

    I just put together an example, but you'd use your own tally table, 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: Slow insert into a table

    don't get caught up staring at the percentages; they have to add up to 100, so just because something is 75% doesn't mean it's bad, it just means 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: Index question

    no; since the leading edge of the first index has the same column, you don't need another index;

    if there are WHERE statments on ColumnB only, then an idnex on just...

    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: Slow insert into a table

    one record at a time?!?!

    can you show the code for the procedure? does it have a cursor? are there triggers ont he destination table? does the trigger have cursors?

    lots 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: Selecting Unique record from a table

    rajborntodare (2/10/2014)


    Hi I have a table (Billing Table) having multiple records for

    people having one record per person per each month.

    how to get a list of the guys having record...

    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: find query syntax from fn_dblog

    the log does not save the commands that were executed, only the data that actually changed.

    you'd want to start using a trace or extended events to capture commands in 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: Syntax

    something like this would give you the count that meets your condition, as well as the total count for a total

    does this help?

    SELECT

    SUM(CASE

    ...

    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: Import to MSSql from varying tab delimited text files

    the key for the install of the AccessDatabaseEngine_x64.exe from microsoft is there's a /passive parameter to install the 64 bit regardless of whether the 32 bit was...

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