Viewing 15 posts - 5,881 through 5,895 (of 6,395 total)
if you only need data from one database then you dont need to use sp_msforeachdb.
issue the following and post the results
sp_msforeachdb 'USE [?]; SELECT TOP 1 * FROM sysobjects'
February 21, 2012 at 5:49 am
if you do
select count(*) from sys.databases
does it return 23 rows?
what your seeing is that you have used sp_msforeachdb but telling it to go back to the chapter database so what...
February 21, 2012 at 5:33 am
The T-SQL in my first post used sp_msforeachdb and loops through to get all records from sys.tables in each DB
February 21, 2012 at 5:22 am
feeling helpful today
CREATE TABLE #TEMP
(CustomerID INT,
ServiceType VARCHAR(20),
StartDate DATE,
EndDate DATE)
INSERT INTO #TEMP VALUES (1234, 'ServiceA', '2010-05-25', '2011-07-15')
INSERT INTO #TEMP VALUES (1234, 'ServiceA', '2011-07-16', '2011-09-18')
INSERT INTO #TEMP VALUES (1234, 'ServiceB', '2011-09-19', NULL)
INSERT...
February 21, 2012 at 5:19 am
I take it you want all the tables from each database?
sp_MSForEachDB 'USE [?]; SELECT * FROM sys.tables'
February 21, 2012 at 5:17 am
Loundy (2/21/2012)
I believe you also need to enable mail session in sql agent
Don't think this will be causing your error though - just thought i'd point it out 🙂
this is...
February 21, 2012 at 4:51 am
seems like the smtp server is not accepting your IP as an SMTP client.
are you using Exchange? has the servers IP been granted the nessesary access on the SMTP...
February 21, 2012 at 4:11 am
Does it have to be done in T-SQL?
You could right a few lines of code in powershell which will loop through all the procedures and dump it out to a...
February 21, 2012 at 3:26 am
could also use SSIS with the transfer logins tasks
February 21, 2012 at 12:59 am
Please provide the full DDL and sample data along with your expceted results so we can assit you better.
Please see the first link in my signature for more info.
February 20, 2012 at 8:57 am
Cadavre (2/20/2012)
BEGIN TRAN--Sample data
SELECT X,Y
INTO yourTable
FROM (VALUES('A', 'B'),('A', 'B'),('A', 'C'),('A', 'C'),('A', 'C'))a(X,Y)
--Solution
SELECT X,Y,
ROW_NUMBER() OVER(PARTITION BY X,Y ORDER BY X,Y) AS SEQ
FROM yourTable
ROLLBACK
damn that was fast
February 20, 2012 at 8:52 am
create table #temp (x char(1), y char(1))
insert into #temp values ('a','b')
insert into #temp values ('a','b')
insert into #temp values ('a','c')
insert into #temp values ('a','c')
insert into #temp values ('a','c')
select row_number() over(partition by...
February 20, 2012 at 8:51 am
Steve Jones - SSC Editor (2/20/2012)
I see it's working. Yikes, I hope that's not how you feel most days :w00t:
Nope, thankfully since I have moved on from the old position...
February 20, 2012 at 8:13 am
here is another link as well, this one is a bit more printer friendly
http://www.simple-talk.com/sql/sql-training/ssms-the-query-window-keyboard-shortcuts/
February 20, 2012 at 8:09 am
how do you determin that the session is closed?
are you sure its just not SQL reassigning the SPID to a different connection?
February 20, 2012 at 8:08 am
Viewing 15 posts - 5,881 through 5,895 (of 6,395 total)