Viewing 15 posts - 631 through 645 (of 844 total)
Results after creating table and database:
checkDatenamedatabase_idcreate_datefile_typedb_file_namedb_file_size
2014-11-19 09:42:22.460db_work1152014-11-19 09:41:46.597ROWSdb_work4096
2014-11-19 09:42:22.460db_work1152014-11-19 09:41:46.597LOGdb_work_log1024
Results after insert into:
checkDatenamedatabase_idcreate_datefile_typedb_file_namedb_file_size
2014-11-19 09:43:58.207db_work1152014-11-19 09:41:46.597ROWSdb_work19456
2014-11-19 09:43:58.207db_work1152014-11-19 09:41:46.597LOGdb_work_log76216
I then deleted the table and database, then recreated them. Ran the SQL...
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
November 19, 2014 at 8:11 am
SQL to create the database and table:
DROP DATABASE db_work
;
CREATE DATABASE db_work
;
USE db_work;
CREATE TABLE target_table
(
pNum CHAR(100),
pMod INT
)
;
The Insert Into statement:
INSERT INTO db_work.dbo.target_table
SELECT pNum,
pMod
FROM source_db.dbo.source_table
;
The log file size check SQL:
SELECTGETDATE() AS...
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
November 19, 2014 at 7:38 am
I'm having issues again posting SQL code here.
But thanks for the link. This tells me for most of what we do some logging is still going to occur, tables...
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
November 18, 2014 at 3:06 pm
I got a little more detail on how this was tested today. The first thing that was done was to create a new database and a new empty table...
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
November 12, 2014 at 1:31 pm
Don't feel bad about hating stored procedures, there are others that prefer not to use them. 🙂 That being said they do have a purpose and aren't that much...
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
October 23, 2014 at 7:30 am
I had to attach the SQL in the text file, some reason it wouldn't allow me to post it.
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
October 22, 2014 at 3:01 pm
No I didn't try anything other than the database and what I wanted to search for. Just tried on a real small database, got it back in less than...
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
October 22, 2014 at 2:47 pm
OK this isn't the same SQL, this is something I got back in March, probably from this site, didn't keep who wrote it, sorry about that, I'm trying to do...
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
October 22, 2014 at 2:30 pm
Sean Smith-776614 (10/22/2014)
below86 (10/22/2014)
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
October 22, 2014 at 8:24 am
I like the idea of this but the only issue I have is this, If I want to run this against our production warehouse I'm not going to have rights...
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
October 22, 2014 at 7:49 am
To me it looks like someone was looking to add the code persontype = 'sp', but just put it in the wrong place. I've seen code like that before,...
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
October 21, 2014 at 7:56 am
What I see as another trick question. In your example data you see before answering the question you have values that would give you the rankings of:
CustomerIDRank
4 ...
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
October 1, 2014 at 7:43 am
ross.chang (9/30/2014)
I got a distinct of 6 different values from SQL Server 2012:0.713591993212924
0.713591993212924
0.713591993212924
0.713647892126698
0.713647892126698
0.713647892126698
0.713647892126698
0.713722424011731
0.713722424011731
0.713722424011731
0.713722424011731
0.713722424011731
0.713722424011731
0.713722424011731
0.713852854810538
0.713871487781797
0.713871487781797
0.713908753724313
0.713908753724313
0.713908753724313
I got the same thing.
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
September 30, 2014 at 7:58 am
pietlinden (9/28/2014)
@lastDayMonth INT
SET @currMonthNum = DATEPART(MM, GETDATE())
IF @currMonthNum IN (1, 3, 5, 7, 8, 10, 12)
SET @lastDayMonth = 31
IF @currMonthNum = 2
SET @lastDayMonth = 28
IF @currMonthNum IN (4,...
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
September 30, 2014 at 7:25 am
How about one more version?
SELECT DATEPART(DD, DATEADD(DD, -1, DATEADD(MM, 1, DATEADD(DD, -(DATEPART(DD, GETDATE()) -1), GETDATE()))))
-------------------------------------------------------------
we travel not to escape life but for life not to escape us
Don't fear failure, fear regret.
September 29, 2014 at 7:31 am
Viewing 15 posts - 631 through 645 (of 844 total)