Viewing 15 posts - 1 through 15 (of 17 total)
if the data of underlying table changed and when we update statistics then plan should use that index.
Am I right?
January 29, 2015 at 2:49 am
indexes which are never used by any plan and Gail is right that by last restart of server.
January 29, 2015 at 2:21 am
DECLARE @dbid INT
SELECT @dbid = DB_ID(DB_NAME())
SELECT OBJECTNAME = OBJECT_NAME(I.OBJECT_ID),
INDEXNAME = I.NAME,
I.INDEX_ID
FROM SYS.INDEXES I
JOIN SYS.OBJECTS O
ON I.OBJECT_ID = O.OBJECT_ID
WHERE OBJECTPROPERTY(O.OBJECT_ID,'IsUserTable') = 1
AND I.INDEX_ID NOT IN (
SELECT S.INDEX_ID
FROM SYS.DM_DB_INDEX_USAGE_STATS S
WHERE S.OBJECT_ID =...
January 28, 2015 at 11:57 pm
WE CAN SHRINK LOG FILE IN SIMPLE RECOVERY MODEL WHEN THERE IS NO NEED OF IN TIME RECOVERY.
IF THAT IS TEST SERVER THEN OK.
IF PRODUCTION THEN THIS PRACTICE IS...
January 28, 2015 at 11:48 pm
SELECT
Main.OrderID,
Main.SalesRegion,
Main.OrderType,
Main.Projectid,
Main.ProductID,
Main.FormatID,
Main.MEdiaTypeID,
LEFT(Main.COMMENTS, LEN(Main.COMMENTS) - 1) AS 'ProductComment',
MAIN.UOM,
MAIN.FormatName,
MAIN.Media INTO #A
FROM...
January 28, 2015 at 11:21 pm
a simple solution to your problem.
just convert that field to varchar in your query like this
select convert(varchar,colname) from table.
when report will be exported to excel leading 0s will not...
January 28, 2015 at 10:27 pm
you mentioned that 3 of databases are part of replication. then there may be a publisher and distributer.
when you move these databases then you need to generate new publications and...
August 1, 2014 at 11:07 am
you can schedule a job to run each hour.
go on schedules and create new schedule.
schedule type should be recurring.
in frequency bar under occurs tab select daily.
in daily frequency select occurs...
August 1, 2014 at 9:02 am
issue is with varchar value 'z' in data ('2013-10-29 22:59:00Z) and you are converting it to datetime or datetime2.
you can convert it after removing that value from data.
use this.
SELECT TOP...
April 2, 2013 at 10:03 am
use this.
SELECT TOP 10 key_value
,convert(datetime2,BPK.key_value) as DT2
,convert(datetime,CONVERT(DATETIME2, PV.key_value)) AS DT
FROM parameter_value PV
WHERE PV.datatype = 'D'
and convert(datetime2,replace(PV.key_value,right(PV.key_value,4),'')) BETWEEN GETDATE() and DATEADD(d, 10, GETDATE())
April 2, 2013 at 6:11 am
SELECT DISTINCT V.CERTYEAR,
(SELECT SUM(QUATITY) FROM VCERTS WHERE CERTYEAR=V.CERTYEAR AND CERTCODE='HI-MASTER')QTYMASTER,
(SELECT SUM(QUATITY) FROM VCERTS WHERE CERTYEAR=V.CERTYEAR AND CERTCODE='HI-INSTR')QTYINSTR,
(SELECT SUM(QUATITY) FROM VCERTS WHERE CERTYEAR=V.CERTYEAR AND CERTCODE='HI-TRAIN')QTYTRAIN
FROM DBO.VCERTS V
ORDER BY 1
April 1, 2013 at 6:17 am
select 'select mfg from'+convert(varchar,ApplianceTypeTableName)+'
union'
from
ApplianceTypes
check you query editor to result to text
and execute above.
copy result in another query editor window and execute.
March 29, 2013 at 6:09 pm
one easy solution, using xml path.
SELECT P.PRODUCTID,P.PRODUCTNAME,C.CategoryID,C.CATEGORYNAME,
STUFF((SELECT ',' + convert(varchar,PP.ProductQuantity)
FROM ProductPricing PP
WHERE PP.PRODUCTID=P.PRODUCTID
FOR XML PATH('')),1,1,'') AS ProductQuantity,
STUFF((SELECT ',' + convert(varchar,PP.ProductCost)
FROM ProductPricing PP
WHERE PP.PRODUCTID=P.PRODUCTID
FOR XML PATH('')),1,1,'') AS ProductCost
FROM ...
March 29, 2013 at 5:47 pm
use bar brackets for column name for 'week-2013' it will be [week-2013]
that is what I understand,
😀
March 29, 2013 at 4:32 pm
SELECT obj.Name SPName, sc.TEXT SPText
FROM sys.syscomments sc
INNER JOIN sys.objects obj ON sc.Id = obj.OBJECT_ID
WHERE sc.TEXT LIKE '%' + 'Name Your Column Here' + '%'
AND TYPE = 'P'
March 29, 2013 at 4:21 pm
Viewing 15 posts - 1 through 15 (of 17 total)