Forum Replies Created

Viewing 15 posts - 11,011 through 11,025 (of 13,460 total)

  • RE: SQL Count Statement

    add these columns to your SQL:

    SUM(CASE WHEN A.destroyed = 0 AND A.Retrieved = 0 THEN 1 ELSE 0 END) AS INCOUNT,

    SUM(CASE WHEN A.destroyed = 0 AND A.Retrieved = 1 THEN...

    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: Updating Null Values In A Table

    you'll want to use the metadata to generate the scripts for you;

    something like this:

    SELECT

    'UPDATE ' + SYSOBJECTS.NAME + ' SET ' + SYSCOLUMNS.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: Copy a table from a DB to another DB

    brennendeliebe05 (6/9/2009)


    Hello everybody;

    I am here again, I want to copy a table Time.dbo from my DB WorksBI to a DB BusinessIntelligence, both are int he same machine and server.

    can help...

    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: Search for one string inside another.

    i believe you might be looking for the behavior of a full text index.

    With a full text index, you can do WHERE CONTAINS(columnname,'AB'), and it only does "whole word" matching,...

    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: SQL2005 database creation script

    there's a lot of ways to do this;

    the most basic is simply 3 words: CREATE DATABASE [WHATEVER], where whatever is the database name. when you do that, a copy 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: buld a rule with Numeric chars only

    thanks everyone; RBarryYoung made the light go on when he said "escape" the second minus sign.

    Lynn's example works, as well as using a different rule, which in turn uses...

    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: buld a rule with Numeric chars only

    the exact error i got was this:

    Msg 513, Level 16, State 0, Line 1

    A column insert or update conflicts with a rule imposed by a previous CREATE RULE statement. 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: buld a rule with Numeric chars only

    ok, it looks like two wrongs make a right...NOT combined with [^0-9] ALMOST looks like it works:

    CREATE RULE [dbo].[NumericCharsOnly]

    AS

    @value NOT LIKE '%[^0-9,-+]%'

    but the - and + , when...

    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 case statement to evaluate 3 different conditions

    you didn't give any details, so here's an example that may help you.

    a case statement can evaluate more than one item:

    SELECT

    CASE

    WHEN Column1 = 'Approved' 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: Finding Duplicate Columns in set of Tables

    there's gotta be a better way, but this is all i could come up with...it works, but seems overly complicated..i need a nap or something:

    select object_name(syscolumns.id) as TableName,syscolumns.name As ColumnName...

    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: sp_ AppendToFile does not create a file

    no no no...

    i mean your procedure sp_AppendToFile. the procedure that calls sp_AppendToFile is not the issue.

    sp_AppendTo is incomplete.

    your sp_AppendTo is an exact copy of the function i posted, except it...

    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: No Import/Export option in sqlserver2005

    you are using SQLExpress, which does not come with SS Integration Services.

    SLQ Express with Advanced Services, just comes with the management GUI and reporting services.

    SQL Server Developer , which is...

    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: What is the column naming convention when creating columns in a table?

    good point Wayne; we do the same...when we get multiple FK's in a table as well.

    One of the things to point out is how standards like this can help 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: query optimizer issue

    as I understand it, the LIKE '%pattern%' will always require a tablescan, since parts of the string are not indexed.

    if the pattern is 'pattern%', so the value always starts...

    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: What is the column naming convention when creating columns in a table?

    duplicate post.

    no need to ask the same question in multiple forums, as the Recent Posts>>Posts Added Today

    shows everything.

    follow the thread and the answers already posted here:http://www.sqlservercentral.com/Forums/Topic728604-146-1.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!

Viewing 15 posts - 11,011 through 11,025 (of 13,460 total)