Viewing 15 posts - 16,276 through 16,290 (of 59,067 total)
Here's an example of what I'm talking about with respect to the execution plan. See the attached "Actual Execution Plan" and look at the % of Batch listings for...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 17, 2016 at 11:57 am
Stewart "Arturius" Campbell (11/17/2016)
Laurie Dunn (11/17/2016)
This would also work and keep the code simple...SELECT *
FROM dbo.MyData
WHERE Left(mychar,1)='[';
To further illustrate Luis' point, try this out:
set nocount on;
INSERT #MyData
(mychar)
VALUES
('This is...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 17, 2016 at 11:33 am
funbi (11/17/2016)
Luis Cazares (11/17/2016)
funbi (11/17/2016)
The table has 7 rows.
Real world tables don't have 7 rows. A small row count is not a valid excuse for bad code.
It's only bad code...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 17, 2016 at 11:27 am
drew.allen (11/17/2016)
I agree with most of what Jeff said, but I would TRUNCATE the tables rather than scripting, dropping, and recreating them.Drew
Don't forget... If they have FKs on them, TRUNCATE...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 17, 2016 at 11:14 am
IMHO, cleaner code if you take the shortcut.
SELECT mychar FROM mydata WHERE mychar LIKE '[[]%'
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2016 at 8:39 pm
kevaburg (11/16/2016)
Hi,
exec xp_fixeddrives;This returns the amount of free space on your local drives. It is a good place to start....
Regards,
Kev
It's really not. It only shows free space. ...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2016 at 7:47 pm
tnnelzo (6/20/2013)
Everyday i run a querry in sqlserver 2008 to get a report to sent to my boss, but i want to automate this, so that the email will...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2016 at 7:41 pm
whitesql (11/16/2016)
* I need to delete all rows of all tables.
It would be easier on you and the system to create the scripts for all the tables, drop the tables,...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2016 at 7:30 pm
Why on Earth do you need to run such a thing once per minute?
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2016 at 9:33 am
To be honest, I find that such automation is frequently much more complex than certain manual methods and frequently does little to prevent people from overwriting each other's changes...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2016 at 8:14 am
If the input string is limited to less than 24 hours, the following makes life pretty easy and will also produce an error if someone entered improper information that result...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2016 at 8:02 am
Heh... if it's a problem where people shouldn't be doing the deletes, you can always add an INSTEAD OF DELETE trick that records the work station name, the session name,...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2016 at 7:47 am
krypto69 (11/16/2016)
Here is the scenario - I have 6 very large 'staging' tables that hold very old and very new staging data.
I need to create a new database on a...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2016 at 7:26 am
Eirikur Eiriksson (11/15/2016)
😎
DECLARE @pString VARCHAR(8000) = 'Chlu' + CHAR(30) + CHAR(2) + CHAR(0) + CHAR(13) + CHAR(10) + CHAR(20)...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 15, 2016 at 11:12 am
Eirikur Eiriksson (11/15/2016)
--Jeff Moden
Change is inevitable... Change for the better is not.
November 15, 2016 at 9:04 am
Viewing 15 posts - 16,276 through 16,290 (of 59,067 total)