Viewing 15 posts - 6,451 through 6,465 (of 7,597 total)
The code uses LIKE to compare the string, so just construct your string accordingly.
For example, you could use 'ls-' as the search string. Or, if you want a closer...
August 14, 2013 at 12:56 pm
EXEC Stored_procedure1 ('abc')
EXEC Stored_procedure1 ('123')
EXEC Stored_procedure1 ('abc112')
Yes. The core of the logic is this:
CASE WHEN <string_value> LIKE '%[^0-9]%' THEN <string> ELSE <int> END
For example:
SELECT
data,
...
August 14, 2013 at 11:36 am
cdl_9009 (8/14/2013)
We have the trigger in place...
August 14, 2013 at 11:33 am
Assuming the account running "JobA" has the authority to start jobB, the command in JobA would be:
EXEC msdb.dbo.sp_start_job 'JobB'
August 13, 2013 at 3:18 pm
That code's written for SQL 2000; I suggest completely ignoring it.
Instead, the code below should give you a list of object names and their full text reasonably quickly.
If you want...
August 13, 2013 at 3:13 pm
Extremely vague, but perhaps:
DATEDIFF function
DATEADD function
might help you.
August 13, 2013 at 2:36 pm
Typically:
.dif = differential backup
.fil = filegroup backup
.trn = tranlog backup
as most people follow MS's lead, as they did with .bak, .mdf, .ndf (silly, imo, why not .mdf also???), etc..
August 13, 2013 at 2:32 pm
garyh2k3 (8/13/2013)
August 13, 2013 at 1:47 pm
seshu67 (8/7/2012)
Can a table have two primary keys
Absolutely no, period. The fact that separate unique constraints can be defined does not make them primary keys as well.
Similarly, a table...
August 12, 2013 at 12:31 pm
Stefan_G (8/9/2013)
Easy enough to change the WHERE on the date to an OR with the two specific date ranges.
If the @StartDate is the start of the current period -- which...
August 9, 2013 at 3:16 pm
You can't do it as part of the restore. You could do it after it was restored, but it would involve some serious effort though.
Maybe you could instead restore...
August 9, 2013 at 3:12 pm
SQL has a command to do that directly:
DBCC CHECKIDENT ( <table_name>, RESEED, <new_reseed_value> ) --WITH NO_INFOMSGS
August 9, 2013 at 3:08 pm
Hmm, interesting. SQL's still "dumber" than I thought :-).
We'll need to UNION the query results instead of using "OR".
Also, as always, we want the variable to be exactly the...
August 9, 2013 at 12:24 pm
You might want to allow for no comma being in the string (just in case).
And you can remove some unnecessary elements from the code:
SELECT CAST(LEFT(@buyer, CHARINDEX(',', @buyer + ',') -...
August 9, 2013 at 9:54 am
You don't need separate indexes on StartDateTime and EndDateTime, you need them in the same index.
SQL will only be able to do a seek on that index if it's headed...
August 9, 2013 at 9:26 am
Viewing 15 posts - 6,451 through 6,465 (of 7,597 total)