Forum Replies Created

Viewing 15 posts - 12,436 through 12,450 (of 13,460 total)

  • RE: String Manipulation

    lookjs like you are assuming a specific date format and preceeding zeros that you did not mention previously:

    well this will work, but I agree with Ray that this isn't 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: Performance of Joins Vs Functions

    I agree with Lynn no value to using a function in this case; also, I'd suggest creating an index on those 7 columns; it would most likely help on performance...

    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: String Manipulation

    you'll want to use the convert function most likely...

    assume a db has three int or other numeric columns:

    SELECT * from sometable

    WHERE CONVERT(VARCHAR,MAJORVERSION) + '.' + CONVERT(VARCHAR,MINORVERSION) + '.'...

    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: smart headers

    look at this script from the contributions, which opens a file and appends to the end of it:

    you could BCP to a file, and then use the script to append...

    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: Database Creation Date - Screwy Results

    interesting; other than a restore of the data, everything i tried so far left the CRDATE in master.dbo.sysdatabases intact:

    stopping/starting server. also tried rebooting the server.

    backup full database, then backup transaction...

    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 you secure SQL against everyone?

    yep use a snapshot: a developer doing SELECT * FROM THE800MILLIONROWTABLE will kill usability, and he might have done it just to remind himself of column names.

    keep developers off production.

    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: Dynamic DDLs

    ok it looks like you want to keep track of multiple results, but you wanted separate tables...

    rethink the logic a bit;

    why not create ONE table, and add one column CalledResultSet,...

    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 get the particular value in the String which has delimeters

     

    --sql doesnt have an instrRev function, but separate functions you can combine to do the same thing:

    --so you have to use substring and reverse:

    declare @str varchar(1024)

    set @str = '/pna/v3/pg/product/manual/display/0,,2076_15221_49434,00.HTML....

    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: Field name search

    i use this to find tables or columns that contain some string all the time;

    usage: sp_find Customer

     

    CREATE procedure sp_find       

    @findcolumn varchar(50)       

    as       

    begin       

     set nocount on       

     select sysobjects.name as TableFound,syscolumns.name 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!

  • RE: SQL SERVER RECOVERY TOOLS

    Here's my take:

    no backups are a sign of an in-experienced DBA, or a developer who happens to have to wear the DBA hat. Unfortunately, he's been lucky up till now hiding...

    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: identifying instance/installation

    As i understand it, the database is it's own self contained unit, and doesn't have info about other instances that exist;

    There's a few metadata functions, like  SELECT @@SERVERNAME,@@SERVICENAME,@@VERSION ,...

    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: Update System tables

    I'm curious as to why you think you need to update the system tables directly anyway. What are you trying to accomplish? there might be a better way to do...

    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: identifying instance/installation

    because there is no central source which captures which servers exist, you can't really query it.

    you can ask the operating system to poll all the servers that are advertising...

    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 Tuning - Approaches

    OK, if you look at the procedure, it's pretty much getting two values for each companyId: the sum(moneyamount) and the sum(number of shares)

    you can get the same information from 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: Extended ascii to HTML when using select ... for XML

    the original function did not encode <> symbols as well as quotes and ampersands;

    this is a little better; someone critque this function please:

    ALTER FUNCTION HTMLEncode(@OriginalText VARCHAR(8000))

    RETURNS VARCHAR(8000) 

    BEGIN

    DECLARE...

    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 - 12,436 through 12,450 (of 13,460 total)