Forum Replies Created

Viewing 15 posts - 6,586 through 6,600 (of 13,460 total)

  • RE: Field headers with BCP

    before i discovered CLR functionalities,

    i've done this by doing a normal old BCP that pipe delimits mydata like this:

    EXECUTE master.dbo.xp_cmdshell

    'bcp "SELECT object_name(object_id) As TbLName,name as ColName FROM SandBox.sys.columns...

    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: self Join [Help Required]

    ?

    With mySampleData (id,book_code,price)

    AS

    (

    SELECT 1,30100,0 UNION ALL

    SELECT 2,30200,0 UNION ALL

    SELECT 3,40100,0 UNION ALL

    SELECT 4,40100,100 UNION ALL

    SELECT 5,1000100,85 UNION ALL

    SELECT 6,1000200,180 UNION ALL

    SELECT 7,2000100,45 UNION ALL

    SELECT 8,2000200,85

    )

    SELECT c1.book_code,

    ...

    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: self Join [Help Required]

    i think you want to enhance the join so items in the self join don't find themselves;

    this is just slightly modified from yours:

    SELECT c1.book_code,

    ...

    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: I can t find connection string

    haven't done this myself, but i know you have to use impersonation;

    this should help, straight from Microsoft:

    http://msdn.microsoft.com/en-us/library/89211k9b%28v=vs.80%29.aspx

    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: SSMS Scripting out tables/indexes is useless

    Winston i think it's a scripting option that is turned off by default;

    if you change these settings, do you get the script you are expecting?

    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: Right click (modify / alter / drop and create) correct vs. query on syscomments.text or sp_helptext return in-correct object definition

    i remember that SQL 2000, via enterprise manager, it is possible to use the GUI to change the text of the procedure, but without executing that new definition ,...

    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 script to export tables as insert statements?

    take a look in the script library here on SSC, there are a lot of contributions that do what you are asking;

    I've been using this from http://vyaskn.tripod.com/code.htm for quite 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: Precedence Constarint

    it looks like you are testing the number of records that match...so i'd cosnider changing ti to simply IF EXISTS:

    IF EXISTS(SELECT f.name

    ...

    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 restore/attach DB with alternate mdf file (holds indexes only)

    YSLGuru (10/10/2011)


    I guess what I don't understand about this is that because the file does not contain any data, just index information then I would think you could do something...

    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: Audit 2008 r2

    GSquared (10/10/2011)


    It depends on what you need to audit.

    Are you just auditing the commands, or do you need to audit the actual data changes as well?

    C2 will audit both, 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 Server undocumented commands

    no...I say use the undocumented stuff whenever it's needed.

    technically sp_MSForEachdb and sp_MSForEachTable are undocumented and unsupported, but widely used.

    many times, MS is calling something an "undocumented feature", but added needed...

    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 2008 R2 Full Text search ContainsTable NOT working properly

    maybe i'm oversimplifying, but can't you simply wrap the query results with the RANK function ?

    SELECT RANK() OVER (ORDER BY [MashupMetaInfo_Id], MashupMetaInfo_Title, MashupMetaInfo_Tag) AsTheRank,

    MySubQuery.*

    FROM

    (

    ...your original query goes here....

    ) MySubQuery

    ORDER...

    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: Searching for misspelled keywords.

    yes, Full Text indexing has a thesaurus ; so if you searched for "camero", that's a synonym for "chevy"

    you can do the same for expected misspellings of your search terms,...

    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 Running Slow due to IS NULL in Where Clause.

    reformatted for readability:

    SELECT wooBillingAmount_Cp,

    worIsBillable,

    bcoUserValue1,

    bcoID,

    ...

    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 column alias in my where filter

    Steve Jones - SSC Editor (9/16/2008)


    Which results?

    The alias ones? Use

    where [10%] > 1000

    Jeffry Williams nailed the right techniques;

    you can reference an alias in the ORDER BY clause, but not 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!

Viewing 15 posts - 6,586 through 6,600 (of 13,460 total)