Viewing 15 posts - 2,761 through 2,775 (of 2,894 total)
Friend, next time please test your setup code before posting it.
Here we are, in first attempt (it may require some tuning):
-- SETUP:
/*
CREATE TABLE USER_SESSION(
USER_NUM int NOT NULL,
LOGIN_DT datetime NOT...
June 15, 2010 at 8:11 am
Please test your code before posting it. USER is not very good name for the object.
June 15, 2010 at 7:09 am
Sorry man, The case should be presented as:
CREATE TABLE #TestTable (Col1, Col2, ...)
INSERT #TestTable SELECT Val1, Val2, ...
...
Please work a bit to help minimize time required to help you.
June 15, 2010 at 5:20 am
Please provide ctreate table and sample data population script for your case!
June 15, 2010 at 4:57 am
Sorry, I have edited the previous post as well:
SELECT dateadd(hour, datepart(hour,GETDATE()),CAST(convert(varchar(20),getdate(),112) as datetime))
June 15, 2010 at 4:53 am
SELECT dateadd(hour, datepart(hour,GETDATE()),CAST(convert(varchar(20),getdate(),112) as datetime))
June 15, 2010 at 4:50 am
Do:
sp_helptext sp_rename
and you will see how sp_rename does it...
June 15, 2010 at 4:21 am
Why not just use
INSERT INTO Mehregan2_Report.dbo.tblActiveUsers ....
Or use OPENROWSET instead of OPENQUERY
June 15, 2010 at 4:09 am
I agree with Jeff. This sort of challenges, instead of teaching right tecniques and deep understanding of their mechanisms, might lead to the habit of writing code noodles.
I would...
June 15, 2010 at 3:55 am
AndrewSQLDBA (6/14/2010)
Hello Everyone...
So please tell me, why you think that one should use or not use dynamic SQL in a sproc.
...
If one knows what Dynamic SQL is for and how...
June 14, 2010 at 1:36 pm
Good article, I've seen it before.
But where it said that the Dynamic SQL cannot be optimised?
June 14, 2010 at 1:28 pm
Almost right. Required data was only available on Monday morning but senior BA manager required that it should be the Friday report. So, the report is generated on Monday but...
June 14, 2010 at 1:18 pm
You can optimise dynamic sql as everything else.
Dynamic sql is absolutely legitimate way of coding and it has own place in design and development of SQLServer based systems.
As...
June 14, 2010 at 12:55 pm
Do you want the real challenge?
How to get End-Of-Business Day Friday report that includes the data which will be inserted into the database only on the following Monday?
:w00t:
June 14, 2010 at 10:23 am
The most challenging part of your challenge was trying to understand given written requirements in the same way as you (and that is reall life challenge working with BA's :-D):
scott.pletcher...
June 14, 2010 at 10:13 am
Viewing 15 posts - 2,761 through 2,775 (of 2,894 total)