Viewing 15 posts - 1 through 15 (of 16 total)
A simple mechanism to cater for situations where more than one period (.) can appear in the emailaddress string try the following:
DECLARE @EmailAddress VARCHAR(50)
SET @EmailAddress = 'firstname.lastname@test.org'
SELECT SUBSTRING(@EmailAddress,1,
...
September 23, 2010 at 1:43 am
In your example you reference a column in the source table called "id".
If this is the primary key with new rows getting a sequentialy allocated value then you could...
June 29, 2010 at 7:36 am
In you BCP command line you specify line 2 as the first line but if you look in the sample .txt file the column headers appear on row 2 as...
June 1, 2010 at 4:54 am
To quickly see where SQL Server is going to (if at all) create the maintenance plan log files open up Management Studio and edit the Maintenance Plan.
In the tabbed...
May 4, 2010 at 11:13 am
In you GROUP BY statement you are using the txtName column value but the select performs a CASE statement to turn the different values into 'yes' or 'no' for Group...
April 14, 2010 at 4:27 am
If you can take advantage of VARCHAR(MAX) then the following SQL will remove the need for any kind of manual 'loop':
DECLARE @sql VARCHAR(MAX)
SET @sql = ''
SELECT...
March 31, 2010 at 6:42 am
Entries only appear in the DMV after the index is used for the first time.
March 25, 2010 at 2:49 am
This has a Begin and Rollback transaction.
Are you actually specifying a COMMIT in your code?
March 25, 2010 at 2:42 am
You have not supplied a value for the @Level3 variable so the 2nd IF statement will be false just like the 1st one.
March 24, 2010 at 7:12 am
Restore operations have entires in the msdb.dbo.restorehistory table so you can filter them out of the backupset table based on a join on backup_set_id.
The SQL snippet below is something that...
March 23, 2010 at 10:06 am
I might be missing something here, but I took your SQL and created a test table and populated with the date values you suggested:
CREATE TABLE #data ([datecolumn] datetime)
INSERT INTO #data...
March 12, 2010 at 7:08 am
Not sure this is what you are after but the following syntax will create you a stored procedure taking a table name as input and will output the contents:
CREATE PROC...
March 12, 2010 at 6:46 am
SandyDB (2/26/2010)
February 26, 2010 at 12:40 am
Hi,
I spent a couple of minutes putting together a dynamic SQL solution to your problem. Hopefully I have understood what you are looking for.
What you need to do is set...
January 21, 2010 at 4:05 am
Thanks for information.
I use COPY_ONLY backups if I need to take an ad-hoc copy of a production database for urgent debugging in a development environment without interrupting the current backup...
September 30, 2009 at 1:02 am
Viewing 15 posts - 1 through 15 (of 16 total)