HELP-Create Sample Data By Microsofst Spoil And Grow My Mdf Ldf -from 5 MB TO 6 GB

May 21, 2008

help i run this
from this link
http://code.msdn.microsoft.com/SQLExamples/Wiki/View.aspx?title=NumbersTable&referringTitle=Home
and it stuck my sql server!!!!!

and after i run this
my my mdf ldf is 6 GB




Code Snippet-- Suppress data loading messages
SET NOCOUNT ON

-- Create Sample Data using a Table Varable
SELECT TOP 2147483647 IDENTITY(INT,0,1) AS N
INTO Numbers
FROM sysobjects a, sysobjects b, sysobjects c, sysobjects d, sysobjects e


before i was 6 mb
help
now how to fix this problem and shrinking my data



View 8 Replies


ADVERTISEMENT

Auto Grow Enabled But DB Won't Grow

Jan 15, 2005

I've been through the forum and read a number of threads on people's DBs not growing and the answer usually is they don't have auotmatically grow data file. Unfortunately I have this on, but when I look at the properties of the database it reports the space available is 0.00 MB? Up until about two weeks ago I was showing appx 48% space utilization. When I ran an SP to show growth, it tells me that it was expanded by 20% yesterday, but SQL Server is still telling me the space available is zero.

The log file is also set for auto growth. The DB is 14.5 GB in size and the drives still have around 92 GB of space.

Has anyone experienced this before? Any ideas? Does anyone know of an SPs that can give me detailed info on internal data file size compared to stated size (i.e. wasted space in data file)? Is SQL Server doing something funny in the way it is seeing the database or data files individually? Any help is appreciated.

View 6 Replies View Related

How Data/log Files Grow

Dec 4, 2007

Hi All
i am bit confused about how data and log files grow in databases. suppose i turn off the auto grow and restrict the maxsize upto some limit but size of data/log file is less then maxsize at some stage because what i understand is size of data/log file keep changing depends upon the activities going on the database. in future if data/log file need to grow can it grow upto the maxsize without turing on the auto grow.

regards

View 4 Replies View Related

How To Create Sample Database?

Nov 12, 2007

This question is for SQL Server 2000, SQL Server 2005, and SQL Server 2008.



I want to provide users a sample database with data and a database template which new databases created in an application will be based on. However, I don't want to use scripts to create database and other database objects and also don't want the data to be contained in other data store such as access database. I think about providing users with operating system files(mdf, ndf, log). My understanding is that database created thru attaching will follow the collation of the source. Is that a way to control the attaching so the database created thru attaching will follow the collation of the destination server?


If attaching is not a good way to handle my case, what are other possibilities?

View 6 Replies View Related

Proactively Grow Data File Size

Jan 9, 2008

My primary (and only) data file has reached the point where it is auto growing. I would like to grow this file in one big chunk at an off peak time. I can't seem to find the code I need to make the file grow when I want it to?

View 1 Replies View Related

XML Sample Gets Error: CREATE ENDPOINT Not Supported

Jul 14, 2006

I installed the latest version of SQLX and tried to run the XML sample.

C:Program FilesMicrosoft SQL Server90SamplesEnginexmlXmlManuInstructionsReadMe_OnlineManuInstr.htm

The first part of the install.sql ran ok, but it chokes on the CREATE ENDPOINT line: is this really a limitation on the Express edition or did I miss something on installation or configuration?

Msg 7878, Level 16, State 1, Line 3

This "CREATE ENDPOINT" statement is not supported on this edition of SQL Server.

View 3 Replies View Related

SQL Server 2012 :: Dynamically Grow A Data File?

Dec 5, 2014

Is it possible to dynamically grow a data file for TempDB?

I have some TSQL that I want to execute (this is raw tsql, not something I'd typically share) when I get an alert that TempDB is growing.

SET NOCOUNT ON;
DECLARE @TempDB TABLE (FileID tinyint, name varchar(50), size bigint)
DECLARE @TotalSize decimal(19,4), @TotalFiles int, @CurrentTempDBSize bigint, @SQL varchar(1000), @DBName varchar(50)
SET @SQL = ''
INSERT INTO @TempDB

[code]....

ENDThe code runs fine, but doesn't actually increase the size of the file.

View 7 Replies View Related

SQL Server Admin 2014 :: How Do Physical Data Files Grow When Rebuilding Indexes

Feb 2, 2015

I've been trying to get a definitive answer to this question but alas I have conflicting and patchy answers so far from other sources. I have an index that, lets say, requires 10GB of data space to rebuild..This index resides on a filegroup that spans 2 files on two seperate drives (i.e. a mdf and ndf)

When I rebuild this index how will each of these datafiles grow as the rebuild proceeds to completion? Lets for the time being remove the caveats of any other activity hitting the example index/database in question.My tests seem to show that only the mdf will grows (or the file with the lowest id in the that filegroup) provided there is enough space available in that particular file to complete the operation. The secondary ndf dat file doesnt grow at all if the mdf has enough space.

Is expected behavior? i.e. the index will be rebuilt in a contiguous manner relative to the files contained with the filegroup i.e. fileid 1 will grow till limit reached then next fileid grows etc?

View 0 Replies View Related

Sample Code - Custom Increment Task Sample

Mar 28, 2006

Hi

Books online mention the existence of sample code for several custom tasks, including the one mentioned in the title. But, when I try to find this code in the location mentioned it is nowhere to be found.

I have run a search on the rest of my drive and come up empty.

Can anyone tell me where to find this?

Thanks

View 3 Replies View Related

Are There Any Sample VB Projects That Use A Sample Sql Server Express DB?

Feb 29, 2008

Im trying to use VB.net 2005 to write a sample app to access a DB. Are there any samples for this and any samples of how I go about making the DB in the first place?

View 1 Replies View Related

Sample Data Required

Feb 13, 2007

Hello.

Though this is not directly a SQL related question but I could not think of some other forum to post this request. <y apologies if I should have posted elsewhere...


I need some sample data for a departmental store (like WalMart of KMart) which sell a wide variety of things and probably everything under the sun :)

I need data in such a manner that we have 4-5 levels of data hierarchy. For example we can have a data hierarchy like follows:

Classification
Category
Sub Category
Product Group
Item


The above is just an example but I hope that most of you already know what I neeed. An example of data based on the following hierarchy can be as follows (shown in a tabular manner)


Classification | Category | Sub Category | Product Group | Item
---------------------------------------------------------------
Household Items| Electronics| Entertainment| Audio| SONY Room entertainment box, 2 speakers 300 W each, ....
Household Items| Electronics| Entertainment| Audio| Phillips Boom Box, ...specifications....
Household Items| Electronics| Entertainment| Video| SAMSUNG DVD Player model SG-17X5 ...
Household Items| Electronics| Entertainment| T.V | SONG TRINTORN 51" .....
...
...

Groceries | Drinks | Colas| Coke | COke 12-Pack Cans ....
Groceries | Drinks | Colas| Coke | COke 2.25 Litre Jumbo Pack..
Groceries | Drinks | Colas| PEPSI| PEPSI 2.25 Litre Jumbo Pack..
.....
...

Toys | Girls | Dolls| Barbie | Barbie princees model A21 ..
...
..



I hope the above provides you with a clear understanding of my requirement.

I'll be extremely grateful for your help.

Thanks & Regards.

View 4 Replies View Related

Generate Sample Data

Sep 18, 2005

I am needing to o exactly what Zippygoose says (with ordered ID numbers). How do yo make an insert statement that will make a loop until let's say the ID reaches 8000??

Thanks in advanced,

Edit:
User needs to fill his tables with sample data.
(Sorry for the edit, but I prefer to split this thread instead of continuing an old one (2003!!)).

View 1 Replies View Related

Sample Data Required

Feb 13, 2007

Sample data required


Hello.

Though this is not directly a SQL related question but I could not think of some other forum to post this request. <y

apologies if I should have posted elsewhere...


I need some sample data for a departmental store (like WalMart of KMart) which sell a wide variety of things and probably

everything under the sun :)

I need data in such a manner that we have 4-5 levels of data hierarchy. For example we can have a data hierarchy like

follows:

Classification
Category
Sub Category
Product Group
Item


The above is just an example but I hope that most of you already know what I neeed. An example of data based on the following

hierarchy can be as follows (shown in a tabular manner)


Classification | Category | Sub Category | Product Group | Item
---------------------------------------------------------------
Household Items| Electronics| Entertainment| Audio| SONY Room entertainment box, 2 speakers 300 W each, ....
Household Items| Electronics| Entertainment| Audio| Phillips Boom Box, ...specifications....
Household Items| Electronics| Entertainment| Video| SAMSUNG DVD Player model SG-17X5 ...
Household Items| Electronics| Entertainment| T.V | SONG TRINTORN 51" .....
...
...

Groceries | Drinks | Colas| Coke | COke 12-Pack Cans ....
Groceries | Drinks | Colas| Coke | COke 2.25 Litre Jumbo Pack..
Groceries | Drinks | Colas| PEPSI| PEPSI 2.25 Litre Jumbo Pack..
.....
...

Toys | Girls | Dolls| Barbie | Barbie princees model A21 ..
...
..



I hope the above provides you with a clear understanding of my requirement.

I'll be extremely grateful for your help.

Thanks & Regards.

View 3 Replies View Related

Sample Data Required

Feb 13, 2007

Hello.

Though this is not directly a SQL related question but I could not think of some other forum to post this request. <y

apologies if I should have posted elsewhere...


I need some sample data for a departmental store (like WalMart of KMart) which sell a wide variety of things and probably

everything under the sun :)

I need data in such a manner that we have 4-5 levels of data hierarchy. For example we can have a data hierarchy like

follows:

Classification
Category
Sub Category
Product Group
Item


The above is just an example but I hope that most of you already know what I neeed. An example of data based on the following

hierarchy can be as follows (shown in a tabular manner)


Classification | Category | Sub Category | Product Group | Item
---------------------------------------------------------------
Household Items| Electronics| Entertainment| Audio| SONY Room entertainment box, 2 speakers 300 W each, ....
Household Items| Electronics| Entertainment| Audio| Phillips Boom Box, ...specifications....
Household Items| Electronics| Entertainment| Video| SAMSUNG DVD Player model SG-17X5 ...
Household Items| Electronics| Entertainment| T.V | SONG TRINTORN 51" .....
...
...

Groceries | Drinks | Colas| Coke | COke 12-Pack Cans ....
Groceries | Drinks | Colas| Coke | COke 2.25 Litre Jumbo Pack..
Groceries | Drinks | Colas| PEPSI| PEPSI 2.25 Litre Jumbo Pack..
.....
...

Toys | Girls | Dolls| Barbie | Barbie princees model A21 ..
...
..



I hope the above provides you with a clear understanding of my requirement.

I'll be extremely grateful for your help.

Thanks & Regards.


Thanks & Regards.

-J

View 4 Replies View Related

Repost Along With DDL's And Sample Data.

Mar 6, 2007

Here’s a more in depth breakdown of my problem:

We have 4 regions, currently we only have 3 servers in the field, and therefore only 3 regional id’s are being used to store the actual data of the pbx. The central server (RegionalID = 0) is holding the data for itself and the 4th region until the new server is deployed.
It now has to be deployed and therefore the data migration for this region has to take place.
I am trying to extract all the data for this 4th region (RegionalID= 1) from the central server database from all the relevant tables.
When doing this I will firstly, have to check that the CallerID is valid, if it is, send that entry along with the result set, if it is not valid, Check that the dongle area code is valid, if dongle area is valid select with the result set, and if it is not valid, then check that RegionalDialup = ‘0800003554’ which is the dialup number for this 4th region (RegionalID = 1).

I have a table named lnkPBXUser which contains the following:

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[lnkPBXUser]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[lnkPBXUser]
GO

DDL:
CREATE TABLE [dbo].[lnkPBXUser] (
[RegionalID] [int] NOT NULL ,
[pbxID] [decimal](18, 0) NOT NULL ,
[userID] [decimal](18, 0) NOT NULL
) ON [PRIMARY]
GO

Sample data:
INSERT INTO lnkPBXUser(RegionalID, pbxID, userID)
SELECT 0, 543, 2 UNION ALL
SELECT 0, 10961, 6 UNION ALL
SELECT 0, 1012, 17 UNION ALL
SELECT 0, 16499, 26 UNION ALL
SELECT 0, 14061, 36 UNION ALL
SELECT 0, 16499, 2

I have a table named tblDialupLog which has 20 columns, I have selected only the columns I am interested in (below):

PBXID DailupDT DongleAccessNum CLI RegionalID RegionalDialup
83 8/8/2006 8:58:11 AM T2 UQ 28924 0132493700 0 0800003554
543 8/8/2006 8:55:44 AM T0 UA 33902 0123623500 0 0800003554
1219 8/8/2006 8:59:03 AM T3 ZD 02031 0152958095 0 0800003554
1012 8/8/2006 9:02:54 AM T0 UA 41261 0173011050 0 0800003554
1331 8/8/2006 8:59:57 AM T0 UA 01938 0124604627 0 0800003554
1979 8/8/2006 9:02:52 AM T0 UA 09836 0163751210 0 0800003554
1903 8/8/2006 8:58:41 AM T0 UA 26009 0147175356 0 0800003554
1522 8/8/2006 8:58:54 AM T3 MB 94595 0573912871 0 0800004249
319 8/8/2006 8:51:28 AM T2 ZD 32892 0543375100 0 0800004249
3270 8/8/2006 9:04:26 AM T2 MB 87331 0 0800004249

DDL:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblDialupLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tblDialupLog]
GO

CREATE TABLE [dbo].[tblDialupLog] (
[RegionalID] [int] NOT NULL ,
[PBXID] [int] NULL ,
[DialupDT] [datetime] NULL ,
[DongleAccessNum] [varchar] (64) NULL ,
[CLI] [varchar] (64) NULL ,
[RegionalDialup] [varchar] (50) NULL
) ON [PRIMARY]
GO

Sample data:
INSERT INTO tblDialupLog(PBXID,DailupDT ,DongleAccessNum,CLI,RegionalID,RegionalDialup )
SELECT 83,'8/8/2006 8:58:11 AM' ,'T2 UQ 28924','0132493700',0 , '0800003554' UNION ALL
SELECT 543,'8/8/2006 8:55:44 AM','T0 UA 33902','0123623500',0,'0800003554' UNION ALL
SELECT 1012, '8/8/2006 9:02:54 AM', 'T0 UA 41261', '0173011050', 0 ,'0800003554' UNION ALL
SELECT 1219, '8/8/2006 8:59:03 AM' ,'T3 ZD 02031', '0152958095', 0,'0800003554' UNION ALL
SELECT 16499, '8/8/2006 8:51:28 AM', 'T2 ZD 32892', '0543375100', 0, '0800004249'

You see that the DongleAccessNumber is actually made up of three parts, and it is the middle part (ie.UQ) which i will use to check that the tbldongleArea.DongleAreaCode is valid for that region


I have a table named tblCodes, it contains all regions but I only need to select the codes for RegionalID 1 :

CodeID RegionalID ExtName SubsNDCD LocCD UpdateStatus RegionDesc
7973 1 PRETORIA 012 362 0 NORTH EASTERN REGION
7974 1 HARTEBEESHOEK 012 3012 0 NORTH EASTERN REGION
7975 1 HARTEBEESHOEK 012 3013 0 NORTH EASTERN REGION
7976 1 PRETORIA 017 3014 0 NORTH EASTERN REGION
7977 1 PRETORIA 012 3015 0 NORTH EASTERN REGION


DDL:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblCodes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tblCodes]
GO

CREATE TABLE [dbo].[tblCodes] (
[CodeID] [int] NOT NULL ,
[RegionalID] [int] NULL ,
[ExtName] [varchar] (64) NULL ,
[SubsNDCD] [varchar] (10) NULL ,
[LocCD] [varchar] (64) NULL ,
[UpdateStatus] [int] NULL ,
[RegionDesc] [varchar] (255) NULL
) ON [PRIMARY]
GO

Sample Data:

INSERT INTO tblCodes(CodeID ,RegionalID ,ExtName , SubsNDCD ,LocCD ,UpdateStatus,RegionDesc)
SELECT 7973,1, 'PRETORIA', '012', '362', 0 ,'NORTH EASTERN REGION' UNION ALL
SELECT 7974,1, 'HARTEBEESHOEK ', '012', '3012', 0,'NORTH EASTERN REGION' UNION ALL
SELECT 7975,1, 'HARTEBEESHOEK ', '012', '3013', 0,'NORTH EASTERN REGION' UNION ALL
SELECT 7976,1, 'PRETORIA', '012', '3014', 0,'NORTH EASTERN REGION' UNION ALL
SELECT 7977,1, 'PRETORIA', '017', '3015', 0,'NORTH EASTERN REGION'

I have a table named tblDongleArea which contains the following (below only shows dongle area codes for the fourth region( RegionalID = 1):

AreaID RegionalID DongleAreaCode AreaDesc UpdateStatus
12 1 UA Oumashoop 0
13 1 UB Pietersburg 0
14 1 UC Warmbad 0 1
15 1 UD Nylstroom 0
16 1 UE Potgietersrus 0
27 1 UF Louis Trichardt 0
28 1 UG Messina 0

DDL:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblDongleArea]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tblDongleArea]
GO

CREATE TABLE [dbo].[tblDongleArea] (
[AreaID] [int] NOT NULL ,
[RegionalID] [int] NULL ,
[DongleAreaCode] [varchar] (5) NULL ,
[AreaDesc] [varchar] (64) NULL ,
[UpdateStatus] [int] NULL
) ON [PRIMARY]
GO

Sample Data:
INSERT INTO tblDongleArea(AreaID,RegionalID,DongleAreaCode,AreaDesc,UpdateStatus)
SELECT 12,1, 'UA', Oumashoop, 0 UNION ALL
SELECT 13, 1, 'UB', 'Pietersburg', 0 UNION ALL
SELECT 14, 1 ,'UC' ,'Warmbad', 0 UNION ALL
SELECT 15, 1, 'UD', 'Nylstroom', 0 UNION ALL
SELECT 16, 1, 'UE', 'Potgietersrus', 0 UNION ALL
SELECT 27, 1, 'UF', 'Louis Trichardt', 0 UNION ALL
SELECT 28, 1, 'UG', 'Messina', 0


I have a table named tblRegionalNumbers which contains the following, as you can see the RegionalDialup for the fourth region = 0800003554:

RegionalID RegionalDialup Region UpdateStatus RegionCode LocalRegion
1 0800003554 North Eastern 0 1 0
2 0800005027 Gauteng 0 2 0
3 0800006194 Eastern 0 3 0
4 0800004249 Central 0 4 0
5 0800201859 Southern 0 5 0
6 0800201989 Western 0 6 0
7 0800113515 HO 1 0 1
8 0800222204 Tellumat 0 7 0


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblRegionNumbers]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tblRegionNumbers]
GO

CREATE TABLE [dbo].[tblRegionNumbers] (
[RegionalID] [int] NOT NULL ,
[RegionalDialup] [varchar] (255) NULL ,
[Region] [varchar] (64) NULL ,
[UpdateStatus] [int] NULL ,
[RegionCode] [int] NULL ,
[LocalRegion] [int] NULL ,
) ON [PRIMARY]
GO

INSERT INTO tblRegionNumbers(RegionalID ,RegionalDialup,Region,UpdateStatus,RegionCode,LocalRegion)
SELECT 1,'0800003554', 'North Eastern', 0, 1, 0 UNION ALL
SELECT 2, '0800005027' ,'Gauteng', 0 ,2, 0 UNION ALL
SELECT 3, '0800006194','Eastern', 0, 3, 0 UNION ALL
SELECT 4, '0800004249' ,'Central', 0, 4, 0 UNION ALL
SELECT 5, '0800201859','Southern', 0 ,5, 0 UNION ALL
SELECT 6, '0800201989' ,'Western' 0, 6, 0 UNION ALL
SELECT 0, '0800113515', 'HO', 1, 0, 1 UNION ALL
SELECT 8, '0800222204', 'Tellumat', 0, 7, 0


Ok, I am dealing with the lnkPBXUser table at the moment,

I need to be able to join lnkPBXUser and tblDialupLog, then compare tblDialupLog.CLI to tblCodes.SubsNDCD + tblCodes.LocCD (when these two columns are concatenated the result will only be a substring of tblDialupLog.CLI. (this is to make sure that the CLI exists in tblCodes.)

If it does exist, then it is part of the fourth region and should be returned in the result set.

If it does not exist, I then need to check that tblDongle.DongleAreaCode is a substring of tblDialupLog.DongleAccessNumber.

If it is a valid DongleAreaCode for that region, then it is part of the fourth region and should be returned in the result set.

If it does not exist, I then need to check that tblDialupLog.RegionalNumber = ‘080003554’.

So from the above tables an expected result would be:


RegionalID pbxID userID
0 1012 17
0 543 2


Please assist, it would be greatly appreciated.
Regards
SQLJunior

View 20 Replies View Related

Here's The Problem Again With Sample Data

Jul 20, 2005

I want the sum of the last payments (amount) for all customers. The lastpayment is with one with most recent date. And if there are more than onepayment on the most recent date then the one with the higher paymentid isthe last payment. for example in the given data the insert statement thatstarts with capital I is the last payment of that customer. The correctanswer should be 2100 as given below. both queries by Erland and Anith givethe result 100 ( I removed the "WHERE p1.date <= '20030301' " Clause fromboth queries since right now I want current sum (not till some date). Sowhat should be the right query.Thanks again for the help.create table payments (paymentid int,customerid int,amount int,date datetime)insert payments values (1, 1, 100, '1/1/03')insert payments values (2, 1, 200, '2/28/03')Insert payments values (3, 1, 500, '5/15/03')insert payments values (4, 2, 400, '1/16/03')insert payments values (9, 2, 800, '4/30/03')insert payments values (5, 2, 200, '6/15/03')Insert payments values (6, 2, 900, '6/15/03')insert payments values (7, 3, 700, '3/1/03')insert payments values (10,3, 300, '7/10/03')Insert payments values (8, 3, 600, '9/1/03')insert payments values (11,4, 300, '8/1/03')insert payments values (12,4, 400, '9/10/03')Insert payments values (13,4, 100, '9/10/03')customerid lastpayment amount1 3 (on 5/15/03) 5002 6 (on 6/15/03) 9003 8 (on 9/1/03) 6004 13 (on 9/10/03) 100========Result => 2100

View 4 Replies View Related

Sample Data For Mining

Jun 8, 2006

hi, i am bit new in the field of data warehousing and data mining but catching up fast. I am in the last year of BS(Computer Science) and intend to do a project on a Business Intelligence but i was wondering can i get a sample dummy data for my work is that any way possible??

View 1 Replies View Related

Sample RFP For A Data Warehouse Project

Jun 26, 2003

Does anyone have a sample RFP for a Data Warehousing project?

My manager hired an outside consultant to draw up a proposal for our company. But it is getting stuck in details and we are way behind schedule.

It will help me greatly if there is an outline of a DW RFP.

View 4 Replies View Related

Adding Sample Data To New Database

Jun 11, 2008

I created a database using SSMS, now I want to add sample data.

What are the methods of adding sample data from the server?

Do I need to use the SQL Server client or can I use the SQL command line or query window?

Thank you,

Goldmember

View 1 Replies View Related

Creating A Script Out Of Sample Data

Jul 20, 2005

SQL Server 2000Is there any way to take sample data in my database and create an INSERT INTO script?I have a commercial application that I would like to include sample data, and instead of restoring a backup like I am doing now, I would like to first run a script that creates the database, stored procedures, etc, then run a script that inserts sample data if the customer so chooses.I know I can do this manually, but is there any way to create the script based on exisiting data?TIA-- Tim Morrison--------------------------------------------------------------------------------Vehicle Web Studio - The easiest way to create and maintain your vehicle related website.http://www.vehiclewebstudio.com

View 4 Replies View Related

Sample Databases For Data Mining

May 9, 2007

Hello

I'm looking for sample database for data mining in SQL Server 2005. In my project I need to use all algorithms provided by SQL Server 2005. I know that we have "SQL Server 2005 Samples and Sample Databases" on microsoft.com site, but there are only AdventureWorks data sets. I need sth less popular, but similar.

I have found http://www.kdnuggets.com/datasets/index.html and others, but I don't see data sets good for multidimensional analysis.

The origin of data may be natural or artificial, it doesn't matter.
I don't have to generate my own data, because I had to discover new knowledge, that will be surprising to me.

Any help would be appreciated.
Thanks in advance.

(sorry for my English)

View 1 Replies View Related

Sample Code To Importing Data From ODBC

Mar 26, 2007

Hi, there;
I try to import data from ODBC using C# programmatically. Is there any sample code we can have a look. Like how to read schema from ODBC source table and then create source column...

Thanks

View 3 Replies View Related

AdventureWorks Sample Database &&amp; Data Consistency

Oct 17, 2007

Hi,

I'm working with the sample database called Adventure Works and I'm encountering data consistency issues :
If I sum the TotalDue for one particular territory, for one particular time window from the Sales. SalesOrderHeader table and if I try to compare the result to the LastYearSales and YTDSales from the Sales.SalesTerritory table, I don't get the same number, whatever I try. So did I miss something ?
How are the LastYearSales and YTDSales fields from Sales.SalesTerritory calculated ?

Thx,

Anissa

View 3 Replies View Related

SP To Determine Layout, Population And Sample Data In Table(s)

Nov 1, 2007

Hi! I am new to SQL Server... looking for some veteran assistance.

"Data Integrity Report"

I need a Stored Procedure that takes a table name as a parameter and returns a cursor suitable as a data source for a pre-built Report Services report (I guess Report Services would call the SP?).

The cursor/report needs to have the following columns:



Ordinal_Position (I.E. Column number)
Column_Name
Number Of Blank Rows (how many missing values for this column in this table)
Difference (Between total rowcount and population of this column)

Data_Type

Column_Length (either Character_Maximum_Length or the numeric widths rolled up with COALESCE?)
Sample Data (The contents of the "first" row in the table, based on a TOP(1) and ORDER BY xxx)
The report should look like this (for a table with 100 rows):

Col Num Col Name # Blanks Difference Data Type Col Length Sample Data
1 Name 12 88 varchar 30 Sally Smith
2 Address 34 66 varchar 45 123 Main St Apt 45
3 Acct_ID 0 100 varchar 4 AB12345

Using the "Information_Schema.Columns" I can get everything I need except for #3 (blanks count) and #7 (Sample data).

Is it possible to do this as 1 query, with a CTE or APPLY or something, or do I need to do a table variable based on the Information_Schema and then use dynamic SQL and row-by-row COUNT(*) for each column? And the same for the Sample Data.

Sorry for the long post, and thanks in advance!
John

View 1 Replies View Related

Conditional Joins? (table Structure And Sample Data Provided)

Nov 13, 2007

Hello, can anyone tell me if it is possible to conditionally join tables? If so, how could it be done?

What I would like to do is create a query similar to the one below but include the rows in the Asset table where the corresponding Alert field is NULL.


SELECT A.AssetId, A.IndustryId, A.RegionId, A.RevenueId, AL.AlertId

FROM Alerts AS AL INNER JOIN

Assets AS A ON AL.IndustryId = A.IndustryId AND AL.RegionId = A.RegionId AND AL.RevenueId = A.RevenueId
WHERE AlertId = 1

The output I am after would be the first row in the Assets table. But since the RevenueId column is NULL, I get nothing. The only time the above query will work is if all three Id columns are populated. That is not always going to be the case. Please don't suggest changing table structures or adding data. That is not an option.

Below are the table structures and sample data.

CREATE TABLE [dbo].[Alerts](
[AlertId] [int] NOT NULL,
[IndustryId] [int] NULL,
[RegionId] [int] NULL,
[RevenueId] [int] NULL,
CONSTRAINT [PK_Alert] PRIMARY KEY CLUSTERED
(
[AlertId] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

CREATE TABLE [dbo].[Assets](
[AssetId] [int] NOT NULL,
[IndustryId] [int] NOT NULL,
[RegionId] [int] NOT NULL,
[RevenueId] [int] NOT NULL,
CONSTRAINT [PK_Assets] PRIMARY KEY CLUSTERED
(
[AssetId] ASC,
[IndustryId] ASC,
[RegionId] ASC,
[RevenueId] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]




INSERT INTO Alerts (AlertId, IndustryId, RegionId, RevenueId)

VALUES (1, 2, 5, NULL)

INSERT INTO Alerts (AlertId, IndustryId, RegionId, RevenueId)

VALUES (2, 2, 5, 1)

INSERT INTO Alerts (AlertId, IndustryId, RegionId, RevenueId)

VALUES (3, 2, NULL, NULL)

INSERT INTO Alerts (AlertId, IndustryId, RegionId, RevenueId)

VALUES (4, NULL, 5, NULL)

INSERT INTO Alerts (AlertId, IndustryId, RegionId, RevenueId)

VALUES (5, 3, NULL, 4)

INSERT INTO Alerts (AlertId, IndustryId, RegionId, RevenueId)

VALUES (6, NULL, 4, NULL)

INSERT INTO Alerts (AlertId, IndustryId, RegionId, RevenueId)

VALUES (7, 3, 4, 1)


INSERT INTO Assets (AssetId, IndustryId, RegionId, RevenueId)

VALUES (1, 2, 4, 3)

INSERT INTO Assets (AssetId, IndustryId, RegionId, RevenueId)

VALUES (1, 2, 5, 1)

INSERT INTO Assets (AssetId, IndustryId, RegionId, RevenueId)

VALUES (2, 2, 5, 5)

INSERT INTO Assets (AssetId, IndustryId, RegionId, RevenueId)

VALUES (2, 3, 4, 5)

INSERT INTO Assets (AssetId, IndustryId, RegionId, RevenueId)

VALUES (3, 2, 4, 1)

INSERT INTO Assets (AssetId, IndustryId, RegionId, RevenueId)

VALUES (4, 2, 5, 4)

INSERT INTO Assets (AssetId, IndustryId, RegionId, RevenueId)

VALUES (5, 3, 5, 1)

INSERT INTO Assets (AssetId, IndustryId, RegionId, RevenueId)

VALUES (5, 2, 4, 5)

INSERT INTO Assets (AssetId, IndustryId, RegionId, RevenueId)

VALUES (5, 3, 1, 1)

INSERT INTO Assets (AssetId, IndustryId, RegionId, RevenueId)

VALUES (6, 3, 2, 4)

Thanks.

View 7 Replies View Related

Why Should We Sample Nested Table Separetely For Data Mining Model Trainings?

Dec 1, 2006

Hi, all here,

Thank you very much for your kind attention.

I dont think we should sample any nested tables for data mining model training? Since I think any nested tables are bound to the case table. Therefore whenever we sample the case table, the nested tables are like any other input attributes within the case table to be rectrieved as inputs accordingly?

Thank you very much for any guidance to clear my confusion.

With best regards,

Yours sincerely,

 

 

View 3 Replies View Related

How Data File And Log File Grow?

Jul 20, 2005

Greetings,The following shows how the Properties of a database look like:Data Files:File Name: student_datLocation: e:dataMSSQLDatastudent.mdfSpace allocated (MB): 62'Automatically grow file' checkedFile growth: 'By percent 10%' checkedMaximum file size: 'Unrestricted file growth' checkedTransaction Log:File Name: student_logLocation: e:dataMSSQLDatastudent.ldfSpace allocated (MB): 52'Automatically grow file' checkedFile growth: 'By percent 10%' checkedMaximum file size: 'Unrestricted file growth' checkedThe physical files look like this:Name Size Type Modified------------------------------------------------student.ldf 52,416 KB Database File 2/11/2004 10:34PMstudent.mdf 63,424 KB Database File 2/11/2004 10:34PMMy question is now that it has been specified 'Unrestricted file growth'for both the data and the log file, why both haven't increased any insize since 2/11/2004? Actually, the modified timestamps of some otherdatabases files are also '2/11/2004 10:34PM'. That's weird.I found the following message that's relevent to the above timestamp inthe SQL Server Logs:=====2004-02-11 22:34:10.12 server SQL Server terminating because ofsystem shutdown.=====I'm pretty sure there have been a lot updates taking place on thisdatabase. We don't hear any complaints from the customers that theyhave had any problems (such as, no space left) with the databases.Did the SQL server write the data and log somewhere else?Any insight on what's going on would be appreciated.Bing

View 7 Replies View Related

Create Table From Text File, Extract Data, Create New Table From Extracted Data....

May 3, 2004

Hello all,

Please help....

I have a text file which needs to be created into a table (let's call it DataFile table). For now I'm just doing the manual DTS to import the txt into SQL server to create the table, which works. But here's my problem....

I need to extract data from DataFile table, here's my query:

select * from dbo.DataFile
where DF_SC_Case_Nbr not like '0000%';

Then I need to create a new table for the extracted data, let's call it ExtractedDataFile. But I don't know how to create a new table and insert the data I selected above into the new one.

Also, can the extraction and the creation of new table be done in just one stored procedure? or is there any other way of doing all this (including the importation of the text file)?

Any help would be highly appreciated.

Thanks in advance.

View 3 Replies View Related

How Does SQL 7 Grow Databases?

Mar 24, 2000

Hi,

I know that SQL 7 grows databases dynamically, but I'm wondering how it determines how much to grow it by? I have a couple of databases on our servers that are 3.4 GB but with 1.6 GB space available. So I'm wondering when it determines it needs to grow a database and what it does to determine how much to grow it by.

Thanks,
Mike Gagne

View 2 Replies View Related

LDF File Does Not Grow..

Jun 27, 2007

Bear with me - My SQL Server 2005 Maintenance is as good as a Newbie..

I was running a Very Large Transaction over the weekend (Say 10Mill Inserts)..
And after waiting for 3/4 Hrs for the transaction to complete -- Checked the LDF File, I has grown to a 100 GB.

After that i discovered that i had the Recovery Model as FULL .. So Killed the Job and Changed the recovery mode from Full -> Simple.

Now i see that the LDF file is not growing in size even though there are many transactions that were complete successfully (Still Very slow though)...

What am i missing here - Iam clueless as to why my LDF is not growing in size?

Any Ideas??

View 4 Replies View Related

Alert For Auto Grow In DB

Feb 9, 2000

Hi ,
I have a SQL 7 database in which I have set the autogrow on. I need some way to be notified when the database does an autogrow. The reason for this is that if it does an autogrow once then if I am notified then I can manually expand the DB size without having SQL Server do multiple autogrows. I was looking at setting an alert but cannot find any message in sysmessages that seem to be information types for auto grow. Has anyone done this kind of thing.
Thanks
Venkat

View 2 Replies View Related

Database Grow/Shrink

Jan 13, 1999

OK. Here's a good one.

I wrote a query that caused a HUGE amount of stuff to be written to the transaction log. Since I set the database up before I had enough coffee yesterday, I didn't turn on a "Restrict Filegrowth" on the log. So the transaction ran until it filled up the available space on the drive (my local workstation, so it grew to about 6 GB) and then it rolled back. (BTW: Microsoft finally figured out that rolling back a transaction shouldn't be a blocking operation. ISQLW tells you that the transaction failed as soon as it fails, and then releases the connection to you, so you can go on with your life while SQL Server cleans up. Good one!)

OK. So that done, I figured I'd just truncate the transaction log and do the nifty new "DBCC SHRINKFILE()" thing. So I truncate the log and do DBCC SHRINKFILE. Nothing happens. Enterprise Mangler (OOPS Manager. I really mean Manager) shows that only 43 MB of the 6 GB file is in use. DBCC SHRINKFILE reports that the minimum size is 128 pages, the current size is 697,256 pages, and 697,256 pages are used.

Great. So I can't shrink the file.

Step 2: I dump (OOPS, sorry, BACKUP) the database, delete the database, make sure all the files are gone, and then restore the database. It re-creates the 6 GB file, which, by the way takes a very long time. What's funny about that is the query timer in ISQLW reports that the query took 30 minutes, but the return from the restore command shows that it took about 300 and some seconds (about 5 minutes) because the restore command doesn't count the amount of time it took to build the files (I'm guessing). After I figure out that it rebuilt the 6 GB file, I screamed, and started downloading PostGreSQL for my Linux box, and got on to other projects.

This morning I came in and started reading Books Online to figure out what's going on. It says something about "Virtual Log Files" and how a log can't be shrunk past that point. Great. MS basically defines a virtual log file as "the point past which you can't shrink a log". So I have a 5 GB virutal log file, and I can't truncate it, shrink it, or make it go away.

So I have a stroke of genius and decide to build a new log file in the database, and then use the DBCC SHRINKFILE command with the EMPTYFILE option, and then use ALTER DATABASE to remove the file.

Then I get this really cool error that says:
Server: Msg 5020, Level 16, State 1, Line 1
The primary data or log file cannot be removed from a database.

OK. Last time I checked, a log file doesn't belong to a primary filegroup, so there's something else going on here. Basically, it looks like the first file that gets created is the "Primary" file and can never be removed.

So, new policy, every "first" file in a database is going to be a 2 MB file, with a 2 MB growth limit, so we can remove it later. That's a load of....fertilizer.

It looks like the AutoShrink for logs is just a myth. Auto-Grow seems to work almost too well, though. I'm picturing one of those Access newbies using the Export function in Access to put data into SQL Server on one of our pre-production boxes, and having a 180 GB log that can't be shrunk. That'll be a good time.

The moral of the story: Always set growth restrictions, especially on log files.

The questions:
1. Anybody got any bright ideas on how I can get my disk space back WITHOUT using BCP (or DTS, or similar methods)?

2. Anybody know how a different file can be set as a "PRIMARY" file?

3. Anybody know why MS decided to fill the Transact-SQL help in ISQLW with "You can't get there from here" messages that reference Books Online?

Thankfully, this isn't anywhere in our production system, and if the quality continues this way, it won't ever be in our production system.

chris.

View 1 Replies View Related

Cant Manually Grow Database

Jan 24, 2003

Hardware:
IBM Netfinity 8500
2 processors Xeon 700
1,5 Gb memory
Windows 2000 Server SP2 Build 2195
SQL Server 2000 Standard Edition 8.00.534 SP2
There is only on Database (DB) of 16 Gb in drive G.
Drive G has 32 Gb space free.
Yesterday we appended tables to the database and in SQL logs appears the next error:

2003-01-23 12:26:42.57 spid101 fcb::ZeroFile(): GetOverLappedResult() failed with error 2.
2003-01-23 12:26:42.61 spid101 Error: 1105, Severity: 17, State: 2
2003-01-23 12:26:42.61 spid101 Could not allocate space for object 'ttdssc030104' in database 'MYDATABASE' because the 'PRIMARY' filegroup is full..
2003-01-23 12:26:48.03 spid101 fcb::ZeroFile(): GetOverLappedResult() failed with error 2.

DB configured to grow automatically by 100 Mb and transaction log Automatically grow in 10% .
Unrestricted file grow selected on both.

I try to expand the DB manually by Enterprise Manager to 20 Gb but not work and in SQL log appears the error

"2003-01-23 12:26:48.03 spid101 fcb::ZeroFile(): GetOverLappedResult() failed with error 2."

In Enterprise Manager-Databases-Properties-General-Size of DB maintain 16Gb.
Windows explorer say MYDATABASE.MDB is 20480 MB.

I delete the tables inserted and the problem persist.

Thanks in advance,

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved