Viewing 15 posts - 5,791 through 5,805 (of 7,608 total)
If there's always at least one decimal place:
SELECT
value AS original_value,
SUBSTRING(value, 1, CHARINDEX('.', value) + 1) + '%' AS new_value
FROM (
...
September 16, 2014 at 4:45 pm
The more disorganized the index, the more work space will be needed. Hopefully once you get the tables back in shape, the future runs won't be as bad.
Also, look...
September 16, 2014 at 4:41 pm
PhilipC (9/16/2014)
ScottPletcher (9/16/2014)
September 16, 2014 at 2:36 pm
ramana3327 (9/16/2014)
Hi,I can't provide the execution plan but the query is
select serialnumber from sampletable where id in (1,2,3)
CREATE NONCLUSTERED INDEX sampletable__IX_id ON sampletable ( id ) INCLUDE ( serialnumber...
September 16, 2014 at 1:19 pm
Another option is to rename the column(s) then use "SELECT *" for output:
--CREATE TABLER #temp ...
--INSERT INTO #temp ... ...
DECLARE @sql varchar(8000)
SET @sql = 'EXEC tempdb.sys.sp_rename ''#temp.sale'', ''Sales' + CAST(YEAR(GETDATE())...
September 16, 2014 at 1:06 pm
I first look at SQL's usage stats (incl. row counts), operational stats and missing index info. Be aware they get reset when SQL stops and restarts, so you get...
September 16, 2014 at 12:57 pm
You could start with a url summary table and add a details table later if you need to.
I'd still strongly urge you to use an int to represent the url,...
September 16, 2014 at 12:51 pm
Create an index::
keyed on : id
INCLUDE : serialnumber
Use quotes in the WHERE:
WHERE id IN ('1', '2', '3')
September 16, 2014 at 12:47 pm
You can really get around that error directly, as SQL has control of master.
Back up the master db and restore it to a different name.
RESTORE DATABASE master_dbcc_checkdb
FROM DISK = 'x:\full\path\to\master.BAK'
Then...
September 16, 2014 at 11:09 am
You can have odd errors occur in that situation.
You're better off having a fixed, permanent owner for dbs and granting permissions as needed to other users, up to and including...
September 16, 2014 at 11:03 am
The second style would at least have a chance of being fully optimized, particularly if you force a recompile of the query. Stick with it.
I'd avoid the first style...
September 16, 2014 at 11:01 am
The problem with a table is that one option must apply to everyone. Parameter or other methods allow customized runs, so that your own special cases can still run...
September 15, 2014 at 4:10 pm
Eirikur Eiriksson (9/15/2014)
ScottPletcher (9/15/2014)
Two quick possibilities:
1) Add an optional parameter to the proc which requires a certain value or the proc just...
September 15, 2014 at 3:01 pm
That GROUP BY is gonna kill your performance. See if the code below is close to what you need.
I've added clustered indexes on the temp tables prior to loading...
September 15, 2014 at 2:56 pm
You can't consider missing index info in isolation. At the very least, you also need to look at index usage stats. Both of those are the minimum needed...
September 15, 2014 at 12:27 pm
Viewing 15 posts - 5,791 through 5,805 (of 7,608 total)