Viewing 15 posts - 736 through 750 (of 2,007 total)
Vedran Kesegic (4/19/2012)
April 20, 2012 at 2:30 am
This is quicker: -
SELECT DATEADD(DD,N,GETDATE())
FROM (SELECT N
FROM (VALUES(0),(10),(20),(30),(40),(50),(60),
...
April 17, 2012 at 4:13 am
Hello and welcome to SSC!
There's no need to use a cursor for this, which is great because a cursor solution would be slow! 🙂
I'd like to be able to help...
April 17, 2012 at 3:32 am
aaa-322853 (4/16/2012)
I have a query which selects several columns from a table and exports to a csv file ready to be loaded into a...
April 16, 2012 at 5:06 am
ColdCoffee (4/16/2012)
Try this:
SELECT *FROM @TABLE T
WHERE ISNULL(T.fldID, '') = CASE WHEN @ID IS NULL THEN ISNULL(T.fldID, '') ELSE @ID END
Be very very careful with this sort of approach. ...
April 16, 2012 at 3:38 am
NOLOCK is equivalent of READ UNCOMMITTED.
The very least of your worries is the possibility of reading "dirty" data (data that was inserted or updated then subsequently rolled-back). ...
April 16, 2012 at 1:44 am
Nice Lowell 😀
I did a quick test to compare, as I normally do when I see something different.
IF object_id('tempdb..#testEnvironment') IS NOT NULL
BEGIN
DROP TABLE #testEnvironment;
END;
SET NOCOUNT ON;
--1,000,000...
April 11, 2012 at 9:15 am
AndrewSQLDBA (4/11/2012)
I know this is simple to most, but I cannot seem to get this correct. I am having issues with the minutes and seconds.
I need a string format...
April 11, 2012 at 9:04 am
GilaMonster (4/11/2012)
Semicolons are statement terminators, as such they should terminate statements, not start them. We don't start sentences in English with fullstops.
Exactly.
When I started using CTEs (and didn't really understand...
April 11, 2012 at 7:59 am
Spotted a bug in what I wrote.
Should be like this: -
DECLARE @p1SQL NVARCHAR(MAX), @p2SQL NVARCHAR(MAX), @sql NVARCHAR(MAX);
SELECT @p1SQL = COALESCE(@p1SQL,'') + ',' + CHAR(13) + CHAR(10) +
CHAR(39) + PARAMETER_NAME +...
April 11, 2012 at 7:49 am
C# Screw (4/11/2012)
can I ask for some SQL query help ..
How would I return all parameter names for stored procedure in first row, parameter datatype in the second row...
April 11, 2012 at 7:40 am
Plenty of ways. . .
Here's one: -
DECLARE @test-2 DATETIME;
SELECT @test-2 = ISNULL(b.EffectiveDate,a.EffectiveDate)
FROM (VALUES (GETDATE())) a(EffectiveDate)
OUTER APPLY (SELECT *
...
April 11, 2012 at 5:27 am
Why would you downgrade from 2008 to 2005?
I guess you could do a constraint. . .
CREATE TABLE test (ourTime CHAR(8));
ALTER TABLE test ADD CONSTRAINT chkTime CHECK(ourTime LIKE '[0-9][0-9]:[0-9][0-9]:[0-9][0-9]'
...
April 11, 2012 at 5:20 am
EXEC xp_cmdshell 'c:\whatever.bat'
By default, xpcmdshell is disabled because inproper use is often a massive security hole. If you're going to use it, make sure no-one has access to run...
April 11, 2012 at 5:07 am
Wallertown (4/11/2012)
Thanks a lot for the more than quick soultion :w00t:
No problem. Do you understand how it works?
April 11, 2012 at 4:43 am
Viewing 15 posts - 736 through 750 (of 2,007 total)