Viewing 15 posts - 391 through 405 (of 14,953 total)
bitbucket-25253 (12/12/2012)
Create trigger orders_update_inventory on orders
for update
As...
December 12, 2012 at 9:17 am
Yes. You just build your parameters string dynamically.
declare @Params nvarchar(max) = '';
if @Param1 is not null
set @Params += ', @Param1 int';
if @Param2 is not null
set...
December 12, 2012 at 9:15 am
You theoretically could set up a proc that would run indefinitely, which would check the state of the SQL Agent every few seconds, and send an e-mail when it finds...
December 12, 2012 at 9:12 am
In that case, I'd need table definitions, sample data (insert statements, please), and the full create script for the trigger.
Once I can reproduce the error, it should be simple the...
December 12, 2012 at 9:05 am
You're right. I'm so used to using sp_executeSQL (which definitely does nvarchar(max)), that I missed that exec() had been changed. I'm used to getting an error message on...
December 12, 2012 at 9:02 am
Is the actual delete rolled back anywhere in your script?
December 12, 2012 at 8:57 am
Will something like this work for what you need?
USE ProofOfConcept;
IF OBJECT_ID(N'tempdb..#T') IS NOT NULL
DROP TABLE #T;
CREATE TABLE #T
(ID INT IDENTITY
...
December 12, 2012 at 8:12 am
Snargables (12/12/2012)
u should use perameterized dynamic sql to get away from the sql injection
Yes. But when database objects are part of what's dynamic, you can't parameterize those. So...
December 12, 2012 at 8:04 am
jeetsingh.cs (12/12/2012)
My fault butthat was just for an example.
Yep. And it's a valid sample. Only reason I pointed out improvements in it is that the original question was...
December 12, 2012 at 8:02 am
I know of a company that tested its generators every month. Then, when disaster struck, it turned out they had half an hour's worth of fuel left, because they'd...
December 12, 2012 at 7:52 am
Are you actually using SQL 2000 (or 7), as per the forum, or do you have a more recent version available? Which solution to use depends on that.
If it's...
December 12, 2012 at 6:30 am
jeetsingh.cs (12/12/2012)
our query.
For example if we wan to run this command against a database
than
Create procedure...
December 12, 2012 at 6:26 am
The check constraint was simply to make it all numeric. It checks if there are any characters other than numbers, and rejects them. I based that on your...
December 11, 2012 at 2:11 pm
CELKO (12/11/2012)
You have no idea...
December 11, 2012 at 2:08 pm
There are a number of things Try...Catch won't Catch, in T-SQL. Compile-time errors are one of those. That includes lost remote connections, since those have to be compiled...
December 11, 2012 at 12:28 pm
Viewing 15 posts - 391 through 405 (of 14,953 total)