Forum Replies Created

Viewing 15 posts - 9,856 through 9,870 (of 13,459 total)

  • RE: sql server stored procedure

    --for users who are too lazy to type "SELECT * FROM TABLENAME"

    CREATE procedure sp_show ...

    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: Converting entire column's datatype from string to float

    shouldn't orderAmt be a money or decimal(19,4) datatype instead of float?

    I'm thinking that because it's an approximate value for a float, some value does nto convert well to float,...

    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 a stored procedure to create a database

    Dan it's fairly simple, you just need to use dynamic SQL;

    I followed up on a similar thread where the user wanted a database and some specific roles to be created...

    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 to change all CAPS to Caps

    there are several script contributions of functions you can grab; look for "Propercase" in the scripts section;

    that way you get "Raccoon City" instead of "Raccoon city" for multi-word locations.

    here's one...

    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: Convert Varchar to time

    ==edit== nice job hunterwood! you posted right when i did, yours is more elegant.==end edit==

    yeah non-standard formats are going to be tough to convert. you have to substring the parts...

    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: parse a TEXT string

    it looks like the data consistently has a dbl quote ending the last comment, followed by a three char monthly abbreviation that starts the next comment.;

    if you did a repetitive...

    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: Scalar-valued Functions in Where clause

    Jeff Moden is the resident king of the Tally Table, and has contributed a number of articles on it here on SSC; you can find them in the search for...

    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: Trigger Security with Linked Server

    can we see the trigger itself? it might not be written correctly, or not using the INSERTED table correctly and causing an error.

    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: Scalar-valued Functions in Where clause

    your problem is your function; to do a split you must return a TABLE, not a nvarchar string.

    try this instead:

    select *

    from Loss_Mit.DM_ER_Portal_Usage_TBL

    where Loan_Num in (select Item from dbo.DelimitedSplit ('1100123408,1100226532,1127116374',','))

    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: Need to empty my database?

    Angela S. (3/9/2010)


    I don't want to delete ANY tables, I just want to create a copy of the database and remove the data. I need the tables, intact 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: Need to empty my database?

    here's a script that generates the DELETE FROM / TRUNCATE TABLE statements in foreign key hierarchy order; like i said before, i've found it's rare you want to delete 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: Compare 2 Tables

    My question is similar to Paul's; what is it you want to see;

    if you look at the data, which changes do you want to track? if you ignore 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: Determining if a substring is a number...with variable substring lengths

    huston you can use something like this:

    select

    case

    when myvalue like '%[^0-9]%'

    then 'has chars'

    else ;is numeric'

    ...

    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: SYSTEM_USER returns old username

    you can use the ALTER LOGIN command, i believe.

    --name change due to marriage

    ALTER LOGIN [DOMAIN_NAME\gallan] WITH NAME = [DOMAIN_NAME\gshepherd];

    --domain name change?

    ALTER LOGIN [DOMAIN_NAME\lowell] WITH NAME = [NEW_DOMAIN\lowell];

    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: Poor Performance in function AFTER Updating Stats

    Ben have you ruled out parameter sniffing?

    if your procedures have default values for some of the parameters, no matter whether you updated statistics or not, parameter sniffing could occur,...

    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 - 9,856 through 9,870 (of 13,459 total)