Viewing 15 posts - 1 through 15 (of 81 total)
SET NOCOUNT ON
GO
DROP TABLE #tblHold
GO
DECLARE @tblA TABLE (RowId INT IDENTITY(1,1),SchemaName VARCHAR(65),TableName VARCHAR(65),TotalRows BIGINT)
INSERTINTO @tblA
SELECTS.[name] AS SchemaName,
ST.[name] AS TableName,
SUM(p.[rows]) AS TotalRows
FROM[sys].[tables] AS ST WITH (NOLOCK)
INNER JOIN [sys].[schemas] AS S WITH (NOLOCK)
ONST.[schema_id]...
April 15, 2015 at 1:07 pm
select Dataonfilegroup = s.groupname
from sysfilegroups s, sysindexes i
where i.id = object_ID('oRDERS')
and i.indid < 2
and i.groupid = s.groupid
November 20, 2007 at 4:21 am
USE below to get the desired (Does not matter collation)
SELECT CASE WHEN BINARY_CHECKSUM('###À#') > BINARY_CHECKSUM('###AÞ') THEN 'Greater' ELSE 'Less' END
Ram
April 9, 2007 at 6:55 pm
Try this
SELECT A.PartnerLeadTypeID,
A.PartnerID,
A.LeadTypeID,
A.isActive,
A.AllowedStates,
A.RestrictedStates,
A.CreditHistory,
A.LoanAmount,
A.PropertyValue,
A.LoanToValue,
A.PropertyType,
A.RestrictedCityState,
A.SoftCap,
A.HardCap,
A.HasLender,
A.HasAgent,
A.FoundHome,
A.Bankruptcy,
A.ProdPostURL,
B.RowNumber
FROM dbo.PartnerLeadTypes AS E
LEFT JOIN (SELECT PartnerLeadTypeID,COUNT(1) AS RowNumber FROM dbo.PartnerLeadTypes GROUP BY PartnerLeadTypeID) AS B
ON E.PartnerLeadTypeID <= B.PartnerLeadTypeID
WHERE B.RowNumber BETWEEN 0 AND 10
-Ram
April 6, 2007 at 3:08 pm
Midan1-
Simple way of getting the desired
DECLARE @demo TABLE (id INT, f1 INT, f2 INT, f3 INT, f4 INT, f5 INT)
INSERT INTO @demo (id, f1, f2, f3,...
March 16, 2007 at 10:14 pm
You may try like this if you know the filename for eg "C:\Text.xls"
declare @string varchar(50)
set
@string =
January 16, 2007 at 9:45 am
Oops
Try this
SELECT [Name] FROM SysDataBases
WHERE DatabasePropertyEx([Name],'Updateability') <> 'READ_ONLY'
November 29, 2006 at 8:39 pm
Hi,
You may try like this
SELECT [Name] FROM SysDataBases
WHERE DatabasePropertyEx([Name],'Updateability') = 'READ_ONLY'
Ram
November 29, 2006 at 8:37 pm
May be you can try this for OnLine..
USE [DBName]
GO
SELECT OBJECT_NAME(X.[Id]) AS TableName,
X.[Name] AS IndexName,
'DBCC INDEXDEFRAG('+DB_NAME()+','+RTRIM(X.[Id])+','+RTRIM(X.IndId)+')' AS OnLineMaintenance
FROM SysIndexes AS X
LEFT JOIN sysobjects SO ON X.[id] = SO.[id]
WHERE xtype = 'U'
AND X.INDID >...
November 21, 2006 at 9:54 am
Hi
Try this out
SELECT RIGHT('0'+DATENAME(MINUTE,GETDATE()),2)
Ram
November 20, 2006 at 6:59 am
Hi
Just try this query and you get everything you wanted.
USE Pubs
GO
SELECT OBJECT_NAME(X.[Id]) AS TableName,
X.[Name] AS IndexName,
INDEXPROPERTY (X.[Id],X.[Name],'IndexFillFactor') AS IndexFillFactor,
REPLACE(((CASE WHEN INDEX_COL(OBJECT_NAME(X.[Id]),X.IndId,1) IS NOT NULL THEN ''+INDEX_COL(OBJECT_NAME(X.[Id]),X.IndId,1)+',' ELSE '' END +
CASE...
November 7, 2006 at 12:29 pm
Hi
Try this out (No Split/ No Parse)
DECLARE @col VARCHAR(2000)
DECLARE @FF VARCHAR(10)
SELECT @FF = '7104'
SELECT @col ='7104 7106 7112 7107 7132 7108 7150 7105 7110 7109 7111 7104 7106 7112 7107 7132 7108...
November 2, 2006 at 5:55 pm
This might help you (SQL Server)
DECLARE @tbl TABLE (C VARCHAR(10))
INSERT INTO @tbl VALUES ('zzz')
INSERT INTO @tbl VALUES ('abc')
INSERT INTO @tbl VALUES ('abc')
INSERT INTO @tbl VALUES ('xxx')
INSERT INTO @tbl VALUES ('rtt')
INSERT INTO @tbl...
November 1, 2006 at 2:29 pm
Try this out
SELECT T1.EmployeeId AS EmployeeId,
COALESCE(T2.EditedInDate,T1.InDate) AS InDate,
COALESCE(T2.EditedInTime,T1.InTime) AS InTime,
COALESCE(T2.EditedOutDate,T1.OutDate) AS OutDate,
COALESCE(T2.EditedOutTime,T1.OutTime) AS OutTime
FROM Table1 AS T1
LEFT JOIN Table2 AS T2
ON T1.EmployeeId = T2.EmployeeId
November 1, 2006 at 7:43 am
I do not know this is what u r looking for
SELECT TOP 1 *
FROM (
SELECT 'A' AS COL1, 'B' AS COL2 UNION
SELECT 'AA' AS COL1, 'BB' AS COL2 UNION
SELECT 'AAA' AS COL1, 'BBB' AS COL2...
October 30, 2006 at 11:00 am
Viewing 15 posts - 1 through 15 (of 81 total)