Viewing 15 posts - 1,996 through 2,010 (of 2,894 total)
Not very representable setup. May be if you supply exact result you are expecting from your setup, it will be easeier to answer...
March 7, 2012 at 8:38 am
There is "The One" here:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 7, 2012 at 8:02 am
Cadavre (3/7/2012)
... The original question was reasonably interesting and the dynamic SQL for any table was an entertaining intellectual challenge.
Have you heard about solving SUDOKU in T-SQL?
http://www.sqlservercentral.com/scripts/67539/
I guess...
March 7, 2012 at 7:59 am
Fasterst possible insert in T-SQL can be achieved when using SELECT INTO...
You will need to drop your table before doing so.
The next option is to batch your insert. Could you...
March 7, 2012 at 7:46 am
Stephen Grimshaw (3/7/2012)
When I select a number of...
March 7, 2012 at 7:43 am
Gentlemen, looks like you have a lot of free time...
Can some one come up with the reasonable idea for doing it in the first place?
I do not beleive it's a...
March 7, 2012 at 7:37 am
That is exactly what I was asking for!
Here we are:
I guess your setup should be changed to:
CREATE TABLE #ReportingToPerson
(
Staff_ID INT,
Staff_Name VARCHAR(50),
Reporting_To_ID INT,
Department_Head BIT
)
INSERT INTO #ReportingToPerson VALUES (1, 'Kumaran', NULL,...
March 7, 2012 at 7:24 am
I don't understand the whole of your question, but I can see that the one of main problem for you is how to list previous four quarters for each of...
March 7, 2012 at 7:13 am
May be my question wasn't clear...
How the record for 'Senthil' is different to record for 'Karthik'?
Both have Id's, Name's and Report_To_Id's?
What identifies Karthik being the user but Senthil -...
March 7, 2012 at 6:38 am
MuraliKrishnan1980 (3/7/2012)
March 7, 2012 at 6:30 am
jcb (3/7/2012)
But I want to know if there any way to trick SP_ExecSQL to pass a object name as a varible do a dynamic SQL as...
March 7, 2012 at 5:50 am
What problem your team has with triggers? They don't like the name?
Loading INSERT into history will be easy without a trigger, as it will need just copy into history...
March 7, 2012 at 5:44 am
elect c.name, ic.*
from sys.index_columns ic
join sys.indexes i
on i.object_id = ic.object_id
and i.index_id = ic.index_id
join sys.columns c
on c.object_id = i.object_id
and c.column_id = ic.column_id
where i.name = '[IndexName]'
and i.object_id = object_id('[TableName]')
and...
March 7, 2012 at 5:39 am
mohanbvs (3/7/2012)
Hi,I need a query or function which returns number of months for the present quarter...
Strange, I always thought that any quarter contains 3 months. You kind of need no...
March 7, 2012 at 5:29 am
jcb (3/7/2012)
...Is it possible to use the @tableName and @columnName in a safe way with sp_executeSQL?
...
Simples:
IF NOT EXISTS(SELECT 1 FROM sys.tables WHERE name = @tableName )
BEGIN
RAISERROR ...
END
IF...
March 7, 2012 at 5:23 am
Viewing 15 posts - 1,996 through 2,010 (of 2,894 total)