Viewing 15 posts - 10,351 through 10,365 (of 13,469 total)
by using the CHARINDEX2 function below, which returns the nth position of a given string, this worked fine for me:
/*
Example:
SELECT dbo.CHARINDEX2('a', 'abbabba', 3)
returns the location of the third occurrence of...
November 4, 2009 at 10:51 am
good job on giving us the CREATE TABLE; you gave us sample data, but not in an easy-to-use format.
you'll see below, along with the INSERT INTO statements, we are able...
November 4, 2009 at 9:29 am
i'm guessing it's the wrong S?
@filename='\\VCDB02\j$\Microsoft SQL Server\MSSQL.2\MSSQL\Backup\Step_11_xapi_backup.BAK'
should that be
@filename='"\\VCDB02\j$\Microsoft SQL Server\MSSQL.2\MSSQL\Backup\Step_11_xapi_backup.BAK"'
note the path is wrapped in double quotes to allow file names with spaces?
November 4, 2009 at 8:23 am
as far as i know, if the path to the folder does not exist, the backup would fail.
if the path exists, the .BAK file would get created or overwritten...
November 4, 2009 at 8:18 am
don't do this in a trigger.
do it in a schedule job that occurs every X days, which would determine if the filegroup needs to be created yet or not....and if...
November 4, 2009 at 8:03 am
pink.thereisnoif (11/4/2009)
We have a database named 'Track' running on a 64 bit Sql Server 2005 enterprise edition.
Currently the Track DB occupies about 100G space, with 77G data, 16G index,...
November 4, 2009 at 7:55 am
not sure what you mean...inside a TSQL code block, you could use
print object_name(@@PROCID)
or do you mean show me all the sql statements that are currently running...
November 4, 2009 at 7:24 am
Bru Medishetty (11/3/2009)
November 3, 2009 at 7:51 pm
i would still strongly recommend using a view instead of triggers: it will never be wrong.
CREATE VIEW VW_REP
AS
SELECT
Rep.*,MyAlias.CustomerCount
From Rep
Left Outer Join (Select Count(CustomerNum)AS CustomerCount, RepNum From Customer Group...
November 3, 2009 at 7:43 pm
Thanks Bru; i posted my example before the schema got posted, and i edited my examples to use RepNum
November 3, 2009 at 7:25 pm
two things..first, your trigger model is for ORACLE/PLSQL..SQL Server is slightly different.
second it just a logical solution...instead of updating a static table because of an INSERT, you could just replace...
November 3, 2009 at 6:31 pm
george.greiner (11/3/2009)
Yes it does. What is the purpose of having a table with 10000 integers in it?
a Tally/Numbers table lets you leverage the way SQL server uses Set Based...
November 3, 2009 at 12:53 pm
here's one way to do it, i'm sure you'll get other examples to choose from:
select CONVERT(varchar,datepart(hour,getdate()) % 12 ) + ' ' + CASE WHEN datepart(hour,getdate()) > =12 THEN 'PM'...
November 3, 2009 at 12:43 pm
with att for example, i send a plaintext email my attphone: the address is your 10-digit number@txt.att.net.
ie email 9545551212@txt.att.net
November 3, 2009 at 10:51 am
Gail's "it depends" answer is spot on...it depends on how your data gets accessed; indexes help find the data faster.
ok 10 million records, but which columns are actually used for...
November 3, 2009 at 9:07 am
Viewing 15 posts - 10,351 through 10,365 (of 13,469 total)