Viewing 15 posts - 11,521 through 11,535 (of 13,460 total)
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
February 24, 2009 at 6:38 pm
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
February 24, 2009 at 6:31 pm
yeah, you are mistaken. the reseed value assigns the next value, not next+1.
Lowell
February 24, 2009 at 6:08 pm
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
February 24, 2009 at 6:02 pm
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
February 24, 2009 at 8:06 am
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
February 24, 2009 at 7:45 am
yes it's fixed...my original posts had only single line that stretched a million characters....Steve's all over it apparently.
Lowell
February 23, 2009 at 12:17 pm
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
February 23, 2009 at 11:40 am
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
February 23, 2009 at 11:11 am
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
February 23, 2009 at 9:09 am
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
February 23, 2009 at 9:02 am
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
February 23, 2009 at 5:31 am
omg Adi great minds think alike. paraphrased but verbatim answers
Lowell
February 22, 2009 at 6:41 am
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
February 22, 2009 at 6:39 am
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
February 22, 2009 at 5:21 am
Viewing 15 posts - 11,521 through 11,535 (of 13,460 total)