Viewing 15 posts - 121 through 135 (of 5,393 total)
CHARINDEX is in fact the correct tool for the job.
Here is one way to do it:
DECLARE @sampleData TABLE (
email varchar(255)
);
INSERT INTO @sampleData
VALUES
('abc@someemail.com')
,('def@someotheremail.co.uk')
,('xyz@adifferentemail.org');
UPDATE @sampleData
SET email = LEFT(email,CHARINDEX('@',email,1)) +...
-- Gianluca Sartori
March 10, 2016 at 4:52 am
ind_name1 contains just the ID, which is the only column you're filtering on and the only column you're returning, so it makes sense to use the smallest possible index to...
-- Gianluca Sartori
March 10, 2016 at 3:24 am
No, I'm sorry. The log file is not enough to restore a database.
You need the data + log files to attach them (might or might not work depending on how...
-- Gianluca Sartori
March 10, 2016 at 1:11 am
It's a very broad topic. Google it first and read some documentation about the topic, then, if you still have specific questions, come back here and post them.
-- Gianluca Sartori
March 10, 2016 at 1:09 am
Duplicate post.
Replies here please: http://www.sqlservercentral.com/Forums/FindPost1768157.aspx
-- Gianluca Sartori
March 10, 2016 at 1:05 am
While this approach certainly works, it doesn't help the optimizer come up with a decent plan.
I would go with dynamic SQL instead.
-- Gianluca Sartori
March 9, 2016 at 9:02 am
Would this work?
SELECT 1264, isnull(col1+' - ', '') +isnull(col2+' - ', '')
+isnull(col3 +' - ', '') + isnull(col4+' - ', '')
+isnull(col5 +' - ', '') + isnull(col6, '')
FROM unify...
-- Gianluca Sartori
March 9, 2016 at 3:27 am
I infer from your description of the problem that you need a copy of the client's data at your site, without the need to synchronize changes.
In this case what I...
-- Gianluca Sartori
March 9, 2016 at 2:38 am
Might work as long as:
1) You wipe your local database and import all the data from the remote database, without trying to syncronize only the changes
2) The scripts are small...
-- Gianluca Sartori
March 9, 2016 at 1:44 am
Not with SSMS. You can cange the connection of a query window, but the new connection will always be to a single server.
If you want to do that with multi-server...
-- Gianluca Sartori
March 8, 2016 at 1:55 pm
sp_change_users_login can be used to extract orphaned users.
sp_send_dbmail can be used to send a report via email.
Do you have specific issue with those stoed procedures? How can we help you?...
-- Gianluca Sartori
March 8, 2016 at 1:53 pm
Dynamic SQL is the preferred solution for this kind of problems:
DECLARE @selection tinyint = 1 -- or 0 or 2
DECLARE @sql nvarchar(max) = N'
SELECT Items, Qty
FROM Table1
'
IF @selection...
-- Gianluca Sartori
March 8, 2016 at 1:50 pm
There is no hard limit on the number of items you can specify in the IN list, but there's some considerations regardin the size of the batch, which could increase...
-- Gianluca Sartori
March 8, 2016 at 1:46 pm
Databases are for free, there's no cost associated with a new database, except the cost of the storage you're saving it to. If 50GB of disk space is too expensive,...
-- Gianluca Sartori
March 8, 2016 at 1:39 pm
Some problems with that approach:
A script file would be much bigger than the data in the database. How are you planning to send that via email?
How are dealing with updates,...
-- Gianluca Sartori
March 8, 2016 at 1:36 pm
Viewing 15 posts - 121 through 135 (of 5,393 total)