Viewing 15 posts - 181 through 195 (of 368 total)
Check the initial value before the insert:
DBCC CHECKIDENT('myTable',NORESEED)
If it is not 1, your creation script has initial value that is not 1.
To reset identity to start from 1 use this:
DBCC...
November 5, 2012 at 6:04 pm
Check the logical reads with profiler, it's a good chance that it is the same for all three examples.
Check the execution plan and see the differences (if any).
The methods you...
November 5, 2012 at 5:48 pm
You could read about windowing function and learn how ti use them.
Your example can be solved like this:
SELECT ss.*
FROM
(
Select s.PropertyStatusDate
,s.comments
,s.rmVvlPropertyStatus
,s.rvlPropertyStatus.rvlpropertyid
,s.rvlPropertyStatusID
,rnum = ROW_NUMBER() OVER(PARTITION BY s.rvlPropertyID ORDER BY s.PropertyStatusDate DESC)
From dbo.rvlPropertyStatus...
November 5, 2012 at 5:32 pm
You could use a simpler method than cte: subquery. This basic technique exists from sql2000 (and probably even earlier)
and is worth to be learned:
SELECT *
FROM
(
SELECT A.COMPKEY, B.HYDR_ID, B.DATE, B.hydr_gpm,...
November 2, 2012 at 7:26 pm
Cte or while loop. Why you can't use cte? You have sql 2000?
October 15, 2012 at 11:26 pm
Your profile table and result do not match at Branch2 and Branch3 on field Grp2_V1.
I'm not sure what are you trying to achieve, but here is how to go through...
October 14, 2012 at 4:20 pm
If you don't mind trailing zeroes, and you really want such an odd format (it's not a typo in your desired result) here is your solution.
Prepare the data:
create table #numbers(q...
October 14, 2012 at 3:51 pm
Use a CTE to scan hierarchy in a single tsql command. You need only one function or procedure.
If you provide a sample data (TSQL script) and expected results, you might...
October 13, 2012 at 6:26 pm
If dynamic pivot will solve your case, here it is: http://sqlwithmanoj.wordpress.com/2011/01/25/dynamic-pivot/%5B/url%5D
But I think you should rethink your concept.
-- users with object-level permissions in current db
sp_helprotect NULL, NULL, NULL, 'o'
-- users...
October 13, 2012 at 6:16 pm
Maybe "NT Authority\NetworkService" does not have windows privilege that allows impersonation? Privilege "Impersonate a client after authentication".
Start->Run-> secpol.msc
Find it under Local Policies -> User Rights Assignment.
You can first try with...
October 12, 2012 at 2:33 pm
Check for STR, CONVERT, and REPLACE functions to additionally format the numbers as string.
October 12, 2012 at 2:20 pm
Yes, sys.sql_modules is all you need.
October 12, 2012 at 2:11 pm
If by "reindex" you mean defragment or rebuild, than you can use Ola Hallengren's procedure.
[/url] Put it in a job.
If you want to find indexes that are not used, and...
October 12, 2012 at 2:09 pm
Is that FK in enabled or disabled state? Maybe on some version it is possible to create initially disabled FK's but I didn't tried.
October 12, 2012 at 1:56 pm
Does account used for linked server has right to see the view definition (not just SELECT permission) ?
Permission is "VIEW DEFINITION".
October 12, 2012 at 1:53 pm
Viewing 15 posts - 181 through 195 (of 368 total)