Forum Replies Created

Viewing 15 posts - 8,956 through 8,970 (of 13,460 total)

  • RE: Inverse of my Query Results?

    i think this is what you want...a LEFT OUTER JOIN will help identify the ID's not int he realtionship table:

    SELECT se.* FROM dbo.TB__Employees se

    LEFT OUTER JOIN dbo.TB__EmpCourse sec

    ON se.EmployeeID...

    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: substring

    here's an example using a cvustom function CHARINDEX2, which finds the nth occurrance of a string...in your case a space...

    /*

    Example:

    SELECT dbo.CHARINDEX2('a', 'abbabba', 3)

    returns the location of the third occurrence 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: date time diff

    here's an example that chops up the peices for you to concatenate:

    /*

    --results

    Years Months Days Hours Minutes ...

    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: Select Update

    i think the UPDATE FROM syntax would help in this case; i took a wild guess and hoped there was a relationship between a column named entityID?!?! and your two...

    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: Tracing SQL statements and number of records affected

    if you need the total, you;ll need to declare a variable, and add them together:

    declare @TotalRows int

    SET @TotalRows = 0

    Select top 10 * from Employee

    SET @TotalRows = @TotalRows...

    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: Apply WHERE criteria to a view based on a linked server

    For Openquery to filter the results on the Linked server side, I believe the where statement needs to be inside the openquery to avoid the performance issue where 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: generate insert statements with data

    i actually keep the correct link to that script to generate insert statements in my signature on the hopes it gets someone to post their data in the forum:

    http://vyaskn.tripod.com/code/generate_inserts_2005.txt

    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: compression ratio of litespeed

    well it's not a fixed ratio; a database with lots of varbinary/image/blob type data will have a less effective compression ratio than one that is mostly just text and numbers.

    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: Getting data/rows to line up after running query

    based on his latest description, i think the issue has nothing to do with formatting...it's the master data is on row 1 of the results, but he wants rows 2/3/etc...

    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: Using a Linked server name as a variable

    just make it easier on yourself...

    create 5 views, one for each group of statements you will need to gather....

    yeah the view will have the 12 statements for each synonym, 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: Sql Agent Job doesn't populate data but executing tsql does?

    i'm guessing permissions maybe? the job when run under the SQL Agent might not have permissions to some shared resource or not? what is the job doing?

    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 to Write automatic trigger on a specified time in sql server 2005 Express

    don't forget that the Express edition does not include the SQL Agent;

    you should spend the $49 dolalrs and get the Developer Edition, which includes the SQL Agentand so much...

    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: Using a Linked server name as a variable

    i think synonyms might be a good fit for what you are trying to do.

    a synonym can point to an object..table,view,procedure, etc.

    so you could make a suite of 12 synonyms...

    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: Getting data/rows to line up after running query

    formatting shouldn't really be done in the SQL if at all possible, but you can still do it.

    one easy way is to convert the results to the right CHAR size:

    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: DATEDIFF function resulted in an overflow on one instance not the other

    doh i should have tested that: wrapped the datediff evaluation with the convert first, sorry:

    select ABS(CONVERT(BIGINT,(DateDiff(minute, getdate(), '1900-01-01'))) * 60),

    ABS(CONVERT(BIGINT,(DateDiff(minute,...

    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,956 through 8,970 (of 13,460 total)