Viewing 15 posts - 2,011 through 2,025 (of 13,462 total)
carrieathomer (2/11/2015)
i need to create random alphanumeric characters as primary key values when inserting a record.
eg: cmSbXsFE3l8
it can start from 4 digit characters and can grow to...
February 11, 2015 at 10:00 am
openquery is not an obbject you can insert into. its a command that can RETURN a table like structure, but not insert into one.
i think you can use a four...
February 10, 2015 at 1:55 pm
start a transaction with tablockX? that would lock everyone out, right?
begin tran
select * from MyPrimaryTable with (tablockX) WHERE 1 = 2
February 10, 2015 at 12:52 pm
you could query the dmv's and shred the xml of the actual execution plans and get the actual number of rows returned for anything still in cache.
after that, it gets...
February 10, 2015 at 11:46 am
educated guess, since the all those values dates of arrivals are tied to the ship itself, it's not appropriate to arbitrarily grab the max.
you need to use row number...
February 10, 2015 at 10:47 am
must be missing something int he question... you can limit the results by using top, but top should have an order by; do you want the first member, last member,...
February 10, 2015 at 8:40 am
a quick example adapted form my snippets:
declare @filename varchar(255),
@path varchar(255),
@sql...
February 10, 2015 at 8:37 am
so, what is the pattern then? any file that ends in [_A.csv] goes into the [A] table, for example?
February 10, 2015 at 8:30 am
well, what is the pattern that you can use to find the file/filepath if it's dynamic? is it int he same folder + different file name?
you can use xp_cmdshell...
February 10, 2015 at 8:15 am
if you want to find the changes, no matter what they were, and not on a specific field use this:
/*--results
ItemNumber Item ItemNumber Item seq_no
44 ...
February 10, 2015 at 6:17 am
neat problem.
find the DelimitedSplit8k function here, and it's a peice of cake.
the set up for testing:
CREATE TABLE [#co_audit_trail](
[seq_no] [bigint] IDENTITY(1,1) NOT NULL,
[create_complete] [tinyint] NULL,
[user_name] [varchar](60) NULL,
[db_event] [varchar](16) NULL,
[date_of_change] [datetime] NULL,
[time_of_change]...
February 10, 2015 at 6:13 am
ahh, the pain of linked servers.
linked servers don't belong in views; i'd consider finding out how much wiggle room you have on latency, and pull the data from the linked...
February 9, 2015 at 11:02 am
check how your calculations are performed,and see if there could be integer division involved!
in SQL, an integer divided by an integer is an integer, that ramification means truncation .
SELECT...
February 9, 2015 at 10:50 am
like this, i think?
with MyCTE
AS
(
with MyCTE
AS
(
select row_number() over(
partition by Job_ID,run_date,step_id
order by run_date desc,run_time desc,step_id) As RW,
* from msdb.dbo.sysjobhistory
)
delete FROM MyCTE WHERE RW >1
February 9, 2015 at 10:07 am
the users themselves are contained in the databases themselves,
if you are migrating, maybe you mean migrating logins to a new server via the ms proc sp_help_revlogins?
for an existing instance,...
February 9, 2015 at 9:52 am
Viewing 15 posts - 2,011 through 2,025 (of 13,462 total)