Viewing 15 posts - 2,266 through 2,280 (of 2,458 total)
Please don't double post.
I inlcuded a better script for handling this
in your original post that does not include any cursors or loops.
P.S. if you search online for a way...
March 15, 2013 at 3:48 pm
something like this...
DECLARE @sql VARCHAR(8000);
--Set your threshold here
DECLARE @big int=1000--mb
;WITH dbs([dbid],size) AS
(SELECT database_id,
SUM(size)/128
FROM sys.master_files
GROUP BY database_id )
SELECT @sql = COALESCE(@sql,'')+
CASE
WHEN size < @big
THEN 'BACKUP DATABASE '+d2.name+'...
March 15, 2013 at 3:03 pm
Based on what I can make of your post I think you are looking for this:
--sample data
DECLARE @x TABLE (id int not null, value char(1) not null, primary key(id,value));
INSERT INTO...
March 15, 2013 at 12:37 pm
Jeff Moden (3/15/2013)
I suppose you could take what was said two ways. I may have taken it the wrong way.
I was not 100% clear in what I said. I...
March 15, 2013 at 12:00 pm
Jeff Moden (3/14/2013)
Alan.B (3/7/2013)
For tables you would do this:
EXEC sp_MSforeachtable'SELECT TOP 1...
March 15, 2013 at 9:24 am
Well, Eugene beat me to it and with something better than what I put together.
--Next time provide some DDL like so....
--1) Lets setup that test data
IF OBJECT_ID('tempdb..#classes') IS NOT...
March 14, 2013 at 11:52 am
kevaburg (3/14/2013)
What about using:exec sp_MSforeachview 'select top 1 from ?'
That is not a stored proc that comes from SQL Server. If you can run this:
exec sp_MSforeachview 'select top 1 from...
March 14, 2013 at 11:05 am
Mick Opalak (3/13/2013)
March 13, 2013 at 4:26 pm
Eugene Elutin (3/13/2013)
Alan.B (3/13/2013)
Eugene Elutin (3/13/2013)
declare @filename varchar(100)
set @filename = 'Notes_20130204_003015.txt';
select PARSENAME(replace(@filename,'_','.'),4)
select PARSENAME(replace(@filename,'_','.'),3)
select PARSENAME(replace(@filename,'_','.'),2)
select PARSENAME(replace(@filename,'_','.'),1)
Fantastic use of PARSENAME! Wow!
Not really. Quite slow one, actually. But will suite to...
March 13, 2013 at 4:01 pm
Eugene Elutin (3/13/2013)
declare @filename varchar(100)
set @filename = 'Notes_20130204_003015.txt';
select PARSENAME(replace(@filename,'_','.'),4)
select PARSENAME(replace(@filename,'_','.'),3)
select PARSENAME(replace(@filename,'_','.'),2)
select PARSENAME(replace(@filename,'_','.'),1)
Fantastic use of PARSENAME! Wow!
March 13, 2013 at 2:56 pm
First, welcome to SSC.
I suggest you re-post this under the programming - general forum and be prepared to provide a little extra detail; you will have better luck. What...
March 12, 2013 at 10:20 pm
This should get you started...
IF OBJECT_ID('tempdb..#table1') IS NOT NULL
DROP TABLE #table1;
IF OBJECT_ID('tempdb..#table2') IS NOT NULL
DROP TABLE #table2;
CREATE TABLE #table1 (sno int unique NOT NULL, [sid] int NULL, sname varchar(2) unique...
March 12, 2013 at 3:06 pm
dsrapid (3/11/2013)
I have below table:
ID URL
I am trying to create a procedure where I take the input...
March 12, 2013 at 2:33 pm
Its worth noting that, if you do not assign a value to @EndUserDel it will return NULL value. See my comments in the code below
IF OBJECT_ID('tempdb..#service') IS NOT NULL
DROP TABLE...
March 11, 2013 at 2:03 pm
rummings (3/11/2013)
Alan,Thank you for the code.... it worked great!
Charlie
Any time.
March 11, 2013 at 9:04 am
Viewing 15 posts - 2,266 through 2,280 (of 2,458 total)