Viewing 15 posts - 31 through 45 (of 49 total)
Hi
You must do a left join and pull out all the records where there is no match. When you select form Master table and do a left join on StartDate...
November 2, 2007 at 1:16 am
Do you want to list the output of exec(@DSNo) as column data in the last select statement?
Select(@Filename),(exec(@DSNo)), ................
That wont make sens because exec(@DSNo) may return multiple results.
If you want @Filename...
November 1, 2007 at 2:38 am
How about creating an indexed view that has the calculated column.
Then create an index on that column and use the view in your query?
When the column is updated SQL should...
October 31, 2007 at 10:15 am
Yes, using dbo also works
It may be a better choice, so no new users needs to be created?
Thanks again
October 31, 2007 at 9:10 am
Great!! Thanks, now it definitely works
October 31, 2007 at 8:56 am
Sorry, I lied. sys.sqlmodules did not work. I tested with an admin login
When using a login who is only part of the public role it returns NULL
here is the query...
October 31, 2007 at 8:41 am
no code needed as sys.sql_modules did the trick 😛 . Thanks a lot.
Do EXECUTE AS only work for windows logins? I even tried DOMAIN\Administrator that has access to the database,...
October 31, 2007 at 8:37 am
Won't you get the desired result if you only run the query of the derived table?
Because you joining that back to Accounts it repeats for each account that starts with...
October 31, 2007 at 7:19 am
Have a look at how to use a Numbers table
You can extract the comma delimeted values and insert them into a table variable then use the table variable throughout...
October 31, 2007 at 5:16 am
You should compare it to 1 or 0
but the better way of doing it is to convert the 1 and 0 to a BIT type as they are INT values
so...
October 30, 2007 at 2:29 pm
I see references to an IIF function
IIF(expression, truevalue, falsevalue)
where if the expression is true, the true value will be returned, else it returns the false value.
you can acheive the same...
October 30, 2007 at 11:53 am
Declare your parameter once before the first IF statement
I dont think IIF is a valid SQL keyword.
October 30, 2007 at 11:44 am
Here is a simple example of adding a 4 digit year to the end of a table:
CREATE TABLE testing(ID INT)
DECLARE @Q VARCHAR(100)
SELECT @Q = 'sp_rename ''testing'', ''testing_' + CONVERT(VARCHAR, DATEPART(YEAR,...
October 30, 2007 at 10:48 am
Have you tried doing it with dynamic SQL?
October 30, 2007 at 10:39 am
Thanks Andras, I did not know about the XML PATH way. It seems to be working a lot better.
I tested it on a small set of data to compare the...
October 30, 2007 at 5:31 am
Viewing 15 posts - 31 through 45 (of 49 total)