Viewing 15 posts - 661 through 675 (of 2,647 total)
Can you please give the DDL for the table (CREATE TABLE .... )?
Jared
CE - Microsoft
June 14, 2012 at 1:02 pm
So... You want to GROUP BY ref and then compute the difference (DATEDIFF()) between the two dates when the data is ordered by the date? What does template have...
Jared
CE - Microsoft
June 14, 2012 at 12:56 pm
SQL_NuB (6/14/2012)
Jared
CE - Microsoft
June 14, 2012 at 12:51 pm
Well, without DDL my only suggestion is to place them in a blender and hit puree. 🙂 Please provide us with DDL and sample data with sample expected output.
Jared
CE - Microsoft
June 14, 2012 at 12:49 pm
I think that the best way to learn it is to use it with some free online tutorials. tart here.[/code] Then visit the forums and try to figure...
Jared
CE - Microsoft
June 14, 2012 at 10:56 am
Ok. Try this for the numbers:
SELECT APUserID, CAST(TypeId AS INT) AS TypeId, Something
FROM
(SELECT APUserID, FirstName AS '1', Surname AS '2', UserName AS '3', Identifier AS...
Jared
CE - Microsoft
June 14, 2012 at 9:26 am
anthony.green (6/14/2012)
Think I'm just having one of them days today and cant get my head around this.
What I need to do is unpivot the following data into multiple rows.
DECLARE...
Jared
CE - Microsoft
June 14, 2012 at 9:22 am
Lowell (6/14/2012)
it's just a proc that cursors thru all the spids for a given database name;
sp_kill SandBox would kill all spids attached to the database,...
Jared
CE - Microsoft
June 14, 2012 at 9:05 am
I'm not sure I understand... If it is a job, how will you optionally pass the parameter? Based on a condition?
Jared
CE - Microsoft
June 14, 2012 at 6:02 am
Again, you're not giving me enough information. Please post the entire proc and describe in detail what you want to do with it.
Jared
CE - Microsoft
June 14, 2012 at 5:15 am
Like this?
INSERT INTO #Backups
([CalendarDate], [ServerName], [DBName], [RecoveryModel], [IsTlogShipped])
SELECT TOP
(DATEDIFF(DAY,CONVERT(VARCHAR,@FirstBackupDate,102),GETDATE()) + 1) DATEADD(DAY,ROW_NUMBER() OVER (ORDER BY [CalendarDate]) -1, @FirstBackupDate) AS [CalendarDate]
,@ServerName
,@DBName
,'D'
,@IsTlogShipped
FROM [dbo].[Calendar]
UNION ALL
INSERT INTO #Backups
([CalendarDate], [ServerName], [DBName], [RecoveryModel], [IsTlogShipped])
SELECT TOP...
Jared
CE - Microsoft
June 13, 2012 at 2:19 pm
What column is the 'D' or 'L' getting inserted to?
Jared
CE - Microsoft
June 13, 2012 at 2:17 pm
What url? If you can get access to http://server/reports, but not to actual reports... It is a different issue than not being able to get to http://server/reports.
Jared
CE - Microsoft
June 13, 2012 at 1:48 pm
Well don't leave us hanging! How did you solve the @@rowcount issue and what setting was disabled?
Jared
CE - Microsoft
June 13, 2012 at 1:43 pm
What happens if you run this?
CREATE TABLE #temp1 (fghf int identity(1,1), something varchar(25))
INSERT INTO #temp1
SELECT 'dfsahjkfdh'
UNION ALL
SELECT 'fdsg'
UNION ALL
SELECT 'jtyhgkd'
UNION ALL
SELECT 'jgddgjdj'
declare @table_id int
declare @schema_name varchar(128)
declare @table_name varchar(128)
declare @str varchar(4000)
declare...
Jared
CE - Microsoft
June 13, 2012 at 1:30 pm
Viewing 15 posts - 661 through 675 (of 2,647 total)