Viewing 15 posts - 4,081 through 4,095 (of 7,597 total)
Alaster07 (10/12/2016)
Is there an alternative to what I am trying to do?
Not really. Keep in mind that a function must consistently return the same value for the same input...
October 12, 2016 at 2:23 pm
What you're asking to do really isn't logical. Walk through this.
You're telling SQL, with the FK: "Do not let me add a row to this table unless a matching...
October 12, 2016 at 11:01 am
No need to shrink below a certain minimum size, even if you can. I've used 1GB below, but adjust it as needed for your environment.
EXEC sp_MSforeachdb '
IF ''?'' IN...
October 11, 2016 at 12:53 pm
The IDENTITY property can't be added to an existing column nor removed from a column.
You could add an identity column to the table, if it doesn't have one, and then...
October 11, 2016 at 10:15 am
As long as the file name is the only YYYYMMDDHHMMSS string in the file, I think you can just check for that pattern:
SELECT input, SUBSTRING(input, PATINDEX('%[2][01][0-9][0-9][01][0-9][012][0-9][0-5][0-9][0-5][0-9]%', input), 14) AS extract
FROM...
October 11, 2016 at 8:41 am
I assume you mean "sys.dm_exec_procedure_stats" although you never really stated that.
I suspect it has something to do with SSRS. Maybe the proc is being called from the SSRS web...
October 10, 2016 at 1:43 pm
Prior to updating the table, put the username in a known place, and the trigger can retrieve it from there and use it.
October 7, 2016 at 11:33 am
Sean Lange (10/6/2016)
ScottPletcher (10/5/2016)
Sean Lange (10/5/2016)
Thom A (10/5/2016)
Sean Lange (10/5/2016)
October 6, 2016 at 11:23 am
Just in case you want to touch it up a bit:
CREATE Trigger [dbo].[Test_UpdateTrigger_1]
ON [dbo].[Department]
AFTER UPDATE
AS
SET NOCOUNT ON;
IF UPDATE(Department)
BEGIN
INSERT into Department_Audit (
...
October 6, 2016 at 10:34 am
John Mitchell-245523 (10/6/2016)
Or create a unique filtered index to avoid the need for a trigger:CREATE UNIQUE INDEX UQ_CustomStudent_personID_value_attributeID
ON dbo.CustomStudent (personID,value,attributeID)
WHERE value = '17'
AND attributeID = '9875'
John
I didn't go that route...
October 6, 2016 at 8:52 am
I interpreted the OP's requirement differently, i.e., a given personID cannot have more than one row with a value of '17' and an attributeID of '9875'. If so, then...
October 5, 2016 at 3:56 pm
Sean Lange (10/5/2016)
Thom A (10/5/2016)
Sean Lange (10/5/2016)
October 5, 2016 at 3:46 pm
I assumed a physical tally table, column name "N" (ugh!, but most common I guess), to avoid having to use an inline CTE:
DECLARE @start_date datetime
DECLARE @end_date datetime
SET @start_date = '20160101'
SET...
October 5, 2016 at 3:26 pm
My best guess is something like this:
UPDATE sc
SET column_x = ISNULL(sot1.value, '') + ISNULL(sot2.value, '') + ISNULL(sot3.value, '')
FROM dbo.SaltoCardholders sc
LEFT OUTER JOIN dbo.some_other_table1 sot1 ON sot1.lookup_col = sc.loc
LEFT OUTER JOIN...
October 5, 2016 at 2:48 pm
Viewing 15 posts - 4,081 through 4,095 (of 7,597 total)