Forum Replies Created

Viewing 15 posts - 11,521 through 11,535 (of 13,460 total)

  • RE: Decision-Making Statement

    SQL has a case statement so you can say exactly that...when somestring then ...

    only caveat is all the values returned by the case statement must be the same data type.

    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: Issues with DCBB CHECKIDNT

    what result are you getting?

    create table #test(

    testid int identity(1,1) not null primary key,

    stuff varchar(30) )

    insert into #test

    select 'one' union all

    select 'two' union all

    select 'three' union all

    select 'four'

    select * from...

    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: Issues with DCBB CHECKIDNT

    yeah, you are mistaken. the reseed value assigns the next value, not next+1.

    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: Issues with DCBB CHECKIDNT

    your command reset the Id to zero...if you want, you could DBCC CHECKIDENT('sometablename', RESEED,-999); and the identi would start at -999, and work it's way towards zero and beyond

    I assume...

    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: Production security for developers - 'emergency' updates

    We had a similar situation...Developers were givien full access because an important project needed to be updated to production as soon as the developers finished a module.

    the problem was, because...

    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: Find the dependents on a column of primary table

    there is no built in, easy way.

    the procedure sp_fkeys [YourTableName] will report all the tables that have a FK relationship with your table, but there is no way to get...

    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: [code] blocks not respecting line feeds all of the sudden

    yes it's fixed...my original posts had only single line that stretched a million characters....Steve's all over it apparently.

    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: Setting up SQL to only accept specific data in a specific field

    it sounds like if Field 2 is supposded to be a part of field 1, it should either be a calculated column instead, or have a check constraint.

    create table #example(exampleId...

    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: CURSOR READ SP_WHO2

    try this from my saved snippets::

    it's a proc someone asked for so they coupd capture sp_who2 throughout the day:

    CREATE PROCEDURE PR_CAPTURESP_WHO

    AS

    BEGIN

    SET NOCOUNT ON

    IF NOT EXISTS (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: select statement....inventory break down.

    i would simply create a view, rather than insert into a new table.

    the view would always be correct, where the table would need to be updated every time table2 got...

    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: First real SQL Server project - report services stuff.

    thre's a difference between "log" files created by some application, and SQL's log files...i think dmc was thinking the log files you are talking about are SQL's.

    if you have an...

    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: Ltrim rtrim no working with UPDATE

    if you declare a char(50), and put a single character in it, because of it's datatype it will add 49 spaces on the end.

    that's the expected behavior.

    Varchar(50), on the other...

    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: Which Data Type to use

    omg Adi great minds think alike. paraphrased but verbatim answers

    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: Which Data Type to use

    use a char1, and simply put a check constraint--

    CREATE TABLE blah(

    GENDER CHAR(1) NULL DEFAULT 'U' CHECK(GENDER IN('M','F','U') --U for undisclosed? some politically correct places require that nowadays

    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: Problem with Stored procedure

    here's my suggestions:

    1. update statistics:

    2: can you show us the procedure? it might be the parameter sniffing issue(search here on SSC)

    3: can you show us the execution plan? that shows...

    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,521 through 11,535 (of 13,460 total)