Viewing 15 posts - 2,446 through 2,460 (of 2,462 total)
sqluser_8119 (7/11/2012)
How do you make this:yyyy/mm/dd hh:mm:ss
Look like this:
mm/dd/yyyy hh:mm --hh:mm needs to be in military time
DECLARE @date datetime = '2012/06/20'
SELECT CONVERT(CHAR(10), CONVERT(datetime, @date,103),101)
-- Itzik Ben-Gan 2001
July 11, 2012 at 12:18 pm
SGT_squeequal (7/11/2012)
what i want to do is...
-- Itzik Ben-Gan 2001
July 11, 2012 at 9:24 am
SQLSeTTeR (7/11/2012)
Alan - Thank you very much. This did the trick.
No problem.:cool:
-- Itzik Ben-Gan 2001
July 11, 2012 at 8:36 am
Sony Francis @EY (7/11/2012)
select @v-2 =case when t1.col2 like '%*%' then t2.col2 else t1.col2 end
from @table1 t1,...
-- Itzik Ben-Gan 2001
July 11, 2012 at 8:35 am
I think this is what you are looking for:
DECLARE @d1int = 1,
@v-2 varchar(2);
DECLARE @table1 TABLE
(
idint,
col2varchar(2)
);
DECLARE @table2 TABLE
(
idint,
col2varchar(2)
);
INSERT INTO @table1
VALUES (1,'aa'),(2,'bb'),(3,'d*')
INSERT INTO @table2
VALUES (1,'xx'),(2,'yy'),(3,'zz')
SELECT @v-2 = col2 FROM @table1 WHERE...
-- Itzik Ben-Gan 2001
July 10, 2012 at 4:54 pm
You mean 128. Yes, that is correct. Thanks!
-- Itzik Ben-Gan 2001
July 10, 2012 at 3:49 pm
To get the number in MB:
value * 8 / 1024
Example:
Selectname,
size*8/1024
from sys.master_files
-- Itzik Ben-Gan 2001
July 10, 2012 at 3:03 pm
Everything except for the DB name can be found in sys.database_files. You can get db name with DB_NAME(). The procedure below will get you all this information for every DB...
-- Itzik Ben-Gan 2001
July 10, 2012 at 2:49 pm
Beginning with SQL Server 2005, they included the INFORMATION_SCHEMA which is a better way to access this kind of information.
For columns you can use INFORMATION_SCHEMA.COLUMNS which, unlike sys.columns, provides the...
-- Itzik Ben-Gan 2001
July 10, 2012 at 12:56 pm
I also concur with Richard Warr's post. Redgate has a great tool for searching databases and the contents of databases (something worth noting, especially on SQLServerCentral.)
-- Itzik Ben-Gan 2001
July 10, 2012 at 11:53 am
If we are talking about searching for tables specifically here then you could use these:
The first one, usp_findColumn_thisDB, takes a parameter and searches all tables with a column matching that...
-- Itzik Ben-Gan 2001
July 10, 2012 at 11:47 am
With a couple very rare exceptions (not relevant for this conversation) I have never had any issues with disabling indexes.
-- Itzik Ben-Gan 2001
July 10, 2012 at 8:43 am
Based on what you've said I cannot see any use for them but I would I would disable them first for a little while to be on the safe side...
-- Itzik Ben-Gan 2001
July 9, 2012 at 10:37 am
Determining the performance impact of removing these unused indexes is important; understanding the impact of leaving them there is also important. In the past 14 years I cannot recall a...
-- Itzik Ben-Gan 2001
July 9, 2012 at 8:10 am
I started with the first few:
Create Sample Data:
CREATE table x(Value varchar(20))
INSERT INTO x VALUES
('a'),
('A'),
('NULL'),
('NULL xxx'),
('113Y'),
('111Y'),
('1')
-- 1. string starts with 3 digit same number Example 111Y,333Y, 555 H etc
-- a....
-- Itzik Ben-Gan 2001
July 6, 2012 at 5:01 pm
Viewing 15 posts - 2,446 through 2,460 (of 2,462 total)