I'm running some scripts on a database programmatically. The script produces 'light' errors like so:
RAISERROR (N'[dbo].[TheTableName]: Inserted ACME information: 1.....Done!'
, 10, 1) WITH NOWAIT;
Redgate-generated scripts seem to generate a lot of these. They're actually helpful with what I'm doing, so I'd like to capture them a...
I created a trigger on a table for updates. If any update happens, I want to store the old value in separate table. I am trying to get the old value from "inserted" table, but this table is not populated with old values after update.
Here is the sample code:
CREATE TRIGGER [dbo].[Logs_Update]
ON [dbo].[Logs] AFTER UPDATE
AS
DE...
This should really be allowed - I do not understand why it is not.
SELECT *
FROM (
SELECT *
FROM MyTable
)
...
I am trying to insert thousands of rows into a table and performance is not acceptable. Rows on a particular table take 300ms per row to insert.
I know that tools exist to profile queries run against SQL Server (SQL Server Profile, Database Tuning Advisor), but how would I profile insert and update statements to determine slow runnin...
Hello,
I am missing this DLL reference in c:\program files\SQL Server\90\Tools\Binn. I'm assuming that this is because I didn't install the 2005 client. I installed all of the services for 2005, the database instance, reporting services instance, SSAS and SSIS. I installed the 2008 client though, not the 2005 client, and 2008 databas...
I need to display a list of dates, which I have in a table
SELECT mydate AS MyDate, 1 AS DateType
FROM myTable
WHERE myTable.fkId = @MyFkId;
Jan 1, 2010 - 1
Jan 2, 2010 - 1
Jan 10, 2010 - 1
No problem. However, I now need to display the date before and the date after as well with a different DateType.
Dec 31, 2009 - 2...
Hi,
what determins the timeout value for XMLHTTPRequest (msxml version) send method? I'm calling it from MS Sql server and the server profiler shows me 'completed' after 30 seconds, the same happens when calling it through client programm calling stored proc. I set the client connection timeout to 120 sec. So im thinking it must be msxm...
Hello All,
In one of the ASP .Net site we are currently working we have a bulk load of SSRS reports. We have forms authentication for the site and reports have already been created and deployed in the report server. We are having so many problems with authentication when we set the report viewer control to access the server report.
I...
In SSMS 2008, when I expand the tables folder, all i see is the "System Tables" folder.
In SSMS 2005, when I connect to the exact same database with same account, I expand the tables folder and see all my tables. Has something changed with which tables are displayed by default? Does it only show tables in the default schema by defau...
I am having difficulties when trying to insert files into a SQL Server database. I'll try to break this down as best as I can:
What data type should I be using to store image files (jpeg/png/gif/etc)? Right now my table is using the image data type, but I am curious if varbinary would be a better option.
How would I go about inserting ...
Hello,
I'm getting the error "Invalid URI: The format of the URI could not be determined" when customizing it. I've made several changes to the configuration files and UI, but I keep getting this error. It isn't logging it too in the event log nor the log files, which makes it very annoying to debug. So how do I figure out where the ...
Can I have an "identity" (unique, non-repeating) column span multiple tables?
For example, let's say I have two tables: Books and Authors.
Authors
AuthorID
AuthorName
Books
BookID
BookTitle
The BookID column and the AuthorID column are identity columns.
I want the identity part to span both columns.
So, if there is an AuthorI...
Hi, I've recently done a migration from a really old version of some application to the current version and i faced some problems while migrating databases.
I need a query that could help me to compare columns in two tables. I mean not the data in rows, I need to compare the columns itself to figure out, what changes in table structure ...
DECLARE @table table(XYZ VARCHAR(8) , id int)
INSERT INTO @table
SELECT '4000', 1
UNION ALL
SELECT '3.123', 2
UNION ALL
SELECT '7.0', 3
UNION ALL
SELECT '80000', 4
UNION ALL
SELECT NULL, 5
Query:
SELECT CASE
WHEN PATINDEX('^[0-9]{1,5}[\.][0-9]{1,3}$', XYZ) = 0 THEN XYZ
WHEN PATINDEX('^[0-9]{1,8}$',XYZ) = 0 THEN CAS...
How do I return the everything in a string from a sql query before a certain character?
My data looks like this:
HD TV HM45VM - HDTV widescreen television set with 45" lcd
I want to limit or truncate the string to include everything before the dash.
So the final result would be "HD TV HM45VM"
...
I would like to automate SchemaSpy as part of a nightly build against a SQL Server database.
I am unsure exactly how to go about this as there seems to be java sql server drivers missing when I go to generate.
Could anyone give me a step by step run through of how to run schemaspy in this context please?
...
I have a table with a collection of orders. The fields are:
customerName (text)
DateOfOrder (datetime).
I would like to show totals of orders per week per customer. I would like to have it arranged for the Friday of each week so that it looks like this:
all dates follow mm/dd/yyyy
"bobs pizza", 3/5/2010, 10
"the phone co",3/5/2010...
Hi all,
I have a fulltext index which doesn't need to be immediately up-to-date, I'd like to spare myself the I/O (when I do bulk updates, I see a ton of I/O related to the index) and do the index updates during low usage times (nightly, perhaps even weekly). It seems there are two ways to go about this:
Turn off change tracking (SET...
Is there a way to copy View output column headers along with the data? There is a setting in Options to include column headers with query results, but that only works with "New Query" and Stored Procedure output.
Looks like SSMS 2008 has this functionality built in to the contextual menu when you right click on results, but I only have...
Could anyone tell me how to bulk insert data from a ref cursor to a temporary table in PL/SQL? I have a procedure that one of its parameters stores a result set, this result set will be inserted to a temporary table in another stored procedure.
This is my sample code.
CREATE OR REPLACE PROCEDURE get_account_list
(
type_id in account_t...