Viewing 15 posts - 31 through 45 (of 90 total)
This is because on the first query you have hard coded the date as a constant, then using available table statistics, the optimiser shortcuts the execution plan so that it...
April 23, 2013 at 3:08 pm
Write a query to interrogate the following catalogue views:
sys.databases
http://msdn.microsoft.com/en-us/library/ms178534%28v=sql.100%29.aspx
sys.server_principals
http://msdn.microsoft.com/en-us/library/ms188786%28v=sql.100%29.aspx
April 23, 2013 at 3:03 pm
Can you please resubmit test data in the form of runnable INSERT statements that will demonstrate what you are trying to achieve, like this[/url].
April 22, 2013 at 11:03 pm
A cursor loops through each row of a SELECT statement, and runs some code.
A while loop is a generic loop construct.
However, SQL server works best with set-based queries, so neither...
April 22, 2013 at 10:52 pm
As I said before, for an accurate answer to your specific error we will need the actual CREATE TABLE statement for your student table. (Please see http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url])
Without that we can...
April 22, 2013 at 9:55 pm
Firstly you should audit the IIS application if possible. How does it know the database connection string to use? Common ways to store this are in registry keys...
April 22, 2013 at 9:43 pm
To get a good answer we will need your actual CREATE TABLE statements (obfuscate the column names if you have to) and your actual IF/THEN script.
My guess is two things...
April 22, 2013 at 9:21 pm
CLR = Common Language Runtime, i.e. .Net code
CTE = Common Table Expressions
The previous UPDATE statement was not the entire solution, but just an example on how to modify my original...
April 22, 2013 at 8:58 pm
The SET clause in the UPDATE statement will need to be manually constructed, I'm afraid. e.g.
update @tablelist set new_table_name = '02' + right(table_name, len(table_name) - 2)
where table_name like '0%'
Also consider...
April 22, 2013 at 8:39 pm
Can you give a concrete example or two on how the wildcard should work?
April 22, 2013 at 8:27 pm
Something like this?
-- Set up test data
declare @tablelist table (
table_name sysname primary key,
new_table_name sysname null
);
insert into @tablelist (table_name)
select 'OrderItem' union all select 'OrderItems' union all select 'OrderItemss'
-- Enumerate new table...
April 22, 2013 at 8:16 pm
You need to get the latest date separately from the main query. For example:
-- Set up test data
set language english;
declare @MyTable table (
[ID] int,
[DATE] datetime,
[PID] char(11)
);
insert into @MyTable values...
April 22, 2013 at 8:03 pm
This is a duplicated thread. For those that would like to help please go here. 🙂
April 18, 2013 at 8:09 pm
I'm not sure how exactly the source table and the data is formatted. Can you please provide a runnable example that creates the table and inserts some sample rows...
April 18, 2013 at 7:56 pm
A table DML trigger only works inside the scope of the table it belongs to. Therefore, you'll need two triggers for the A and B tables respectively. I...
April 17, 2013 at 9:56 pm
Viewing 15 posts - 31 through 45 (of 90 total)