I have a stored procedure that runs nightly, called by a batch command on my database server. The procedure logs everything it does into a log table:
create table log_tab
(
logdate smalldatetime
,logevent varchar(200)
)
both fields are populated through the procedure as such:
insert...
Hello,
I am adding a trigger for a table that updates a "status" field on the table being updated, as well as the update ID and update date.
In addition, I need to log the updates in a separate table to track all changes, not just the most recent. Here is what I have. This works, however I...
I am trying to import a flat file into a new table and I need the records to insert into the table in the same order they appear in the file. There are about 30,000 records total, and I think they start getting out of order in the 20,000 or so. I am importing the file into a 1 column table...
I am trying to run the below cursor to sequentially number the records for each "rectype" in a transaction each starting at 1. The problem is this took 35 minutes to run on my sample of 46,000 records. I could potentially have over a million at a time in production.
Thank You in advance for...
I have a table that has approx 14,000 records in it. 2 of the fields are image fields. The table takes up more than 8 gigabytes, and the database has only been in production for 3 months. Data will be retained in the table for close to 5 years. I am trying to identify which records have the...
does anyone know of a way to identify the size of a or each record in a table?
I have a table that is used as a central storage place for different types of files. There are 2 fields in the table that are image datatype.
I am able to identify the size of the table, I would like to go into...
I am trying to perform a count distinct, however I would like to count a distinct grouping of columns like so:
select
count(distinct field1)
,count( distinct field1, field2)
from x
anyone have any ideas?
thank you,
cfw2
I am running a query similar to the one below, and it is not providing the information that is needed.
select
tdate
,store
,register
,cashier
from table1
where exists (select 'x'
from table2
where table2.tdate = table1.tdate
and table2.cashier = table1.cashier
and...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.