Viewing 15 posts - 106 through 120 (of 210 total)
Check out the ROW_NUMBER ranking function in BOL: http://msdn.microsoft.com/en-us/library/ms186734.aspx
January 24, 2011 at 1:48 pm
Seems like there is a command line option for SQL Compare that might work. Couldn't dig too far into it - kept running into 404 errors.
January 24, 2011 at 1:25 pm
You can define an output parameter using sp_executesql which might work for you.
Check it out in BOL: http://msdn.microsoft.com/en-us/library/ms188001.aspx
January 24, 2011 at 1:08 pm
try it this way:
Select o.location, o.boardnumber, o.secs, o.amount
from tbl_outdoor o
inner join tbl_boardsize as b on o.secs = b.boardsizeid and o.fk_stateid = b.fk_stateid
where b.fk_stateid = case when o.fk_stateid = 'LA' then...
January 24, 2011 at 1:02 pm
You could use a sub-query that groups on Person-Ref and Priority.
SELECTPERS.[PERSON-REF]
,PERSCONT.[CONTACT-DETAILS]
,PERSCONT.[PRIORITY] AS Priority
FROMdbo.[CORE_CO-PERSON] AS PERS
INNER JOIN dbo.[CORE_CO-PERSON-CONTACT] AS PERSCONT
ON PERS.[PERSON-REF] = PERSCONT.[PERSON-REF]
INNER JOIN (SELECT[PERSON-REF]
, MIN([PRIORITY]) AS [PRIORITY]
FROMdbo.[CORE_CO-PERSON-CONTACT]
GROUP BY [PERSON-REF]) x
ON...
January 20, 2011 at 9:30 am
Agree with using integrated security instead of sql logins.
As far as roles, we usually grant our developers dbcreator (server role) and db_owner (database role) in dev.
January 20, 2011 at 9:03 am
Unless I'm misreading it, it seems like you only want to go back 11 months when filtering on DateTimeIn.
DECLARE @StartDate DATETIME
SET @StartDate = CAST(CAST(Month(GETDATE()) AS CHAR(2)) + '/1/' + CAST(YEAR(GETDATE())...
January 19, 2011 at 7:57 am
We back up and copy our beta environment to a local NAS. If there are problems, it's quicker to recover this way than pulling down a prod copy from the...
January 19, 2011 at 7:47 am
Try granting SELECT on the schema instead of using the db_datareader role.
DROP USER remote_reader_2
go
CREATE USER remote_reader_2 FOR LOGIN remote_reader_2 WITH DEFAULT_SCHEMA = Sales
go
GRANT SELECT ON SCHEMA::Sales TO remote_reader_2
go
January 19, 2011 at 7:34 am
pjl0808 (1/14/2011)
I added the db in the alter index to see if that worked.
Right you need to alter the select statement not the index statement...
Stored Proc:
USE [master]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER...
January 14, 2011 at 12:25 pm
Kind of hard and fast but might give you a path forward.
Declare @Attendence table
( [Date] [datetime] NULL,
[Time] [datetime] NULL,
[CardNumber] [int] NULL,
[Name] [nvarchar](100) NULL,
[StaffNumber] [nvarchar](50) NULL,
[Transaction] [nvarchar](50) NULL,
[TranCode] [nvarchar](50) NULL
)
INSERT INTO...
January 13, 2011 at 8:01 am
Your ALTER INDEX statement references a specific databases but your SELECT does not.
Instead of
SELECT OBJECT_SCHEMA_NAME([object_id]) + '.' + name AS TableName
FROM sys.tables
order by name
Try something like
SELECT OBJECT_SCHEMA_NAME([object_id], 4) + '.'...
January 13, 2011 at 7:39 am
This might help get you started...
USE TempDb
GO
DECLARE @sql NVARCHAR(MAX)
, @name NVARCHAR(255)
CREATE TABLE #temp (
name NVARCHAR(255)
, fileid SMALLINT
, filename NCHAR(260)
, filegroup NVARCHAR(255)
, size NVARCHAR(15)
, maxsize NVARCHAR(15)
,...
January 11, 2011 at 9:12 am
I have a facebook account that I update very infrequently. Use it mainly to share pics and kid news with friends and family.
January 6, 2011 at 8:25 am
DECLARE @STR VARCHAR(25)
SET @STR = '1, 2, 3, 4'
SELECT STUFF(@STR, (LEN(@STR) + 1 - CHARINDEX(',', REVERSE(@STR))), 1, ' and')
Here's a good site explaining and demonstrating string...
January 5, 2011 at 12:01 pm
Viewing 15 posts - 106 through 120 (of 210 total)