Thursday, March 29, 2012
Data Files
I've got one database with a 50GB file. I want to split that file on, for
example 12 files of 4GB each. What is the best aproach to this operation ?
Any ideas ?
Thanks in avance
CCHere's the FileGroup example from BOL, this will enable the creation of the
12 x 4Gb files. If you then re-create all your CLUSTERED indexes specifying
this new filegroup the data will move...
B. Add a filegroup with two files to a database
This example creates a filegroup in the Test 1 database created in Example A
and adds two 5-MB files to the filegroup. It then makes Test1FG1 the default
filegroup.
USE master
GO
ALTER DATABASE Test1
ADD FILEGROUP Test1FG1
GO
ALTER DATABASE Test1
ADD FILE
( NAME = test1dat3,
FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\t1dat3.ndf',
SIZE = 5MB,
MAXSIZE = 100MB,
FILEGROWTH = 5MB),
( NAME = test1dat4,
FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\t1dat4.ndf',
SIZE = 5MB,
MAXSIZE = 100MB,
FILEGROWTH = 5MB)
TO FILEGROUP Test1FG1
ALTER DATABASE Test1
MODIFY FILEGROUP Test1FG1 DEFAULT
GO
--
HTH. Ryan
"CC" <CC@.discussions.microsoft.com> wrote in message
news:28E95830-203F-4658-B585-DB92E47E305B@.microsoft.com...
> Hi,
> I've got one database with a 50GB file. I want to split that file on, for
> example 12 files of 4GB each. What is the best aproach to this operation ?
> Any ideas ?
> Thanks in avance
> CC|||Why do you want to split them? if you mean in operation, you can use
filegroups...
MC
"CC" <CC@.discussions.microsoft.com> wrote in message
news:28E95830-203F-4658-B585-DB92E47E305B@.microsoft.com...
> Hi,
> I've got one database with a 50GB file. I want to split that file on, for
> example 12 files of 4GB each. What is the best aproach to this operation ?
> Any ideas ?
> Thanks in avance
> CC
Wednesday, March 21, 2012
Data Dictionary
it?
thankshttp://www.answers.com/data%20dictionary%20
Roji. P. Thomas
Net Asset Management
http://toponewithties.blogspot.com
"ichor" <ichor@.hotmail.com> wrote in message
news:%23YzwJNXnFHA.3448@.TK2MSFTNGP12.phx.gbl...
> hi what is a data dictionary and can anyone give me an example / sample of
> it?
> thanks
>|||"ichor" <ichor@.hotmail.com> wrote in message
news:%23YzwJNXnFHA.3448@.TK2MSFTNGP12.phx.gbl...
> hi what is a data dictionary and can anyone give me an example / sample of
> it?
Here are a couple of links on it as well as one that has a script to
generate the information from Sql Server.
http://www.dthomas.co.uk/src/reques...r
ticles
http://searchsqlserver.techtarget.c...1114748,00.html
Here is page with a script that works out of the box as well as turning into
a function:
http://codebetter.com/blogs/raymond...3/04/56519.aspx
Tom
> thanks
>|||It is a repository of meta-data ("data about data"). Google for
packages that do this kind of thing.
A good DD will also alllow you to store code for generating your code
(i.e. you click on "client_nbr" and you get the constraints when you
create DDL)sql
Monday, March 19, 2012
Data Conversion in SSIS
what is the use of Data Conversion
please give me an example
Hi
BOL: "The Data Conversion transformation converts the data in an input column to a different data type and then copies it to a new output column. For example, a package can extract data from multiple sources, and then use this transformation to convert columns to the data type required by the destination data store. You can apply multiple conversions to a single input column. "
For example, I used it when the DataSource date column was treated as a string , but I needed it to be converted to Datatime , or input column was INT datatype, but I needed to populate BIGINT destination column.
Sunday, March 11, 2012
Data conversion
Usually how people do the data conversion? For example, I have a well
defined database, the new client use another similar relations database and
have few years data in it, he want to migrate to my system, so I need to
convert his data into my database, customer, appointment, transactions,
etc.)
Is it a

> Hi,
> Usually how people do the data conversion? For example, I have a well
> defined database, the new client use another similar relations
> database and have few years data in it, he want to migrate to my
> system, so I need to convert his data into my database, customer,
> appointment, transactions, etc.)
>
> Is it a

If this is a one-off scenario, you need to scope out the migration with
a complete mapping of the source and destination databases and any
scrubbing that needs to occur to the data, design the migration code,
test it repeatedly on a test server and then run it in production when
it's ready. You can use DTS to help with the migration if the data
scrubbing is involved. If not, you may be able to do this using T-SQL.
David Gugick
Imceda Software
www.imceda.com|||Thanks David,
"David Gugick"
> js wrote:
> If this is a one-off scenario, you need to scope out the migration with a
> complete mapping of the source and destination databases and any scrubbing
> that needs to occur to the data, design the migration code, test it
> repeatedly on a test server and then run it in production when it's ready.
> You can use DTS to help with the migration if the data scrubbing is
> involved. If not, you may be able to do this using T-SQL.
>
Is it any articles available to learn?
This is not a one-off scenario (depend on the clients system) , the business
logics in general are deal the same, for example, custom info, order info,
but they can represent different in the field name and size
I did lots of data conversion use queries before. Just wander there are good
ways (or tools) out there can simplify the process?
Use DTS in my case is slow, I could use it wrong, because I always use it to
process the records by row to massage the data. Using T-SQL (deal with
large set of data), it is faster. Is it right?
Thursday, March 8, 2012
Data casting, casting operations
or subtracting @.b to @.c), having for example a declaration like this:
DECLARE @.a CHAR(12)
DECLARE @.b DATETIME
DECLARE @.c INT
SET @.b='3.04.04';
SET @.c=6
and to calculate the number of days between two dates with this kind
of declaration(@.a-@.b or @.b - @.a):
DECLARE @.a CHAR(12)
DECLARE @.b DATETIME
DECLARE @.c INT
SET @.a='12.2.04';
SET @.b='3.04.04';
Thanks in advance.Take a look at the DATEADD and DATEDIFF functions in Books Online.
Don't specify dates in code in the format you have done. Use 'YYYYMMDD'
which will work safely regardless of regional server and connection
settings.
--
David Portas
SQL Server MVP
--
Saturday, February 25, 2012
data acess class
i was reading book about asp.net and i found example for a dataacess class but i didn't understand this part
Private m_FieldData As New NameObjectCollection
Private _m_ConnectionString As String
Private m_dbConnection As SqlConnection
Private Sub AddParameters( _
ByVal objCommand As SqlCommand, _
ByVal objValues() As Object)
Dim objValue As Object
Dim I As Integer
Dim objParameter As SqlParameter
objCommand.Parameters.Clear()
SqlCommandBuilder.DeriveParameters(objCommand)
I = 0
For Each objParameter In objCommand.Parameters
If objParameter.Direction = ParameterDirection.Input _
Or objParameter.Direction = _
ParameterDirection.InputOutput Then
objValue = objValues(I)
objParameter.Value = objValue
I = I + 1
End If
Next
End Sub
Private Sub AddFieldParameters _
(ByVal objCommand As SqlCommand)
Dim objParameter As SqlParameter
objCommand.Parameters.Clear()
SqlCommandBuilder.DeriveParameters(objCommand)
For Each objParameter In objCommand.Parameters
objParameter.Value = _
_FieldData.Item(objParameter.ParameterName. _
Substring(1))
Next
End Sub
Public Function ExecDataReader _
(ByVal strStoredProc As String, _
ByVal ParamArray objValues() As Object) _
As SqlDataReader
Dim objCommand As SqlCommand
Dim objReader As SqlDataReader
objCommand = New SqlCommand
objCommand.CommandText = strStoredProc
objCommand.CommandType = CommandType.StoredProcedure
objCommand.Connection = dbConnection
Try
objCommand.Connection.Open()
If (objValues.Length = 0) Then
AddFieldParameters(objCommand)
Else
AddParameters(objCommand, objValues)
End If
objReader = objCommand. _
ExecuteReader(CommandBehavior.CloseConnection)
Catch ex As Exception
If objCommand.Connection.State.Open Then
objCommand.Connection.Close()
End If
End Try
Return objReader
End Function
can anybody help me what the author want to doTamer, can you be more specific?
Thanks|||hi i don't understand sub AddParameters and addfieldparameter
and why to add values as an array
and the parameter have only one single value why to pass an array of object i can pass a single value hope u understand me|||I'm going to have to kind of guess here as I don't know the source or the context of the script. That being said
Looking at just the AddFieldParameters sub:
---------------------------------
Private Sub AddFieldParameters (ByVal objCommand As SqlCommand)
Dim objParameter As SqlParameter
objCommand.Parameters.Clear()
SqlCommandBuilder.DeriveParameters(objCommand)
For Each objParameter In objCommand.Parameters
objParameter.Value = FieldData.Item(objParameter.ParameterName.Substring(1))
Next
End Sub
---------------------------------
I read this as the SQL command is being passed into the sub as a value and that value can have multiple lines to it. The FieldData object is being created with each line of the SQL command as a different entry in the array.
The AddParameters looks pretty much the same.
Does this answer your question?
I can look into this further if you provide me with the origional source and location of the script.
Thanks
Friday, February 24, 2012
DAO and SQL Server
Is it possible and if so, Does anyone have any example how to do so?
Thanks,Possible: Yes
Examples: No
Advice: Don't do it.|||he he
I don't have much choice. We are running DAO here in my office and then don't want to ship ADO.
How would I go about doing it?
How would I connect to the server?
I can then run the Create Database SQL command, correct?
Thanks,|||Oh yeah, I don't want to use ODBC.|||Is this MSDE and not SQL Server?
If it's SQL Server, don't you have SQL Server client tools?|||Yes it is MSDE.
I have to do it all programmatically.
The point for this application will be to take an existing Access database and convert it to MSDE and then transfer all the data.
I have to do it programmatically due to the following reasons:
over 600 clients
clients have different versions of the application
only DAO is distributed.|||Originally posted by vbgladiator
Yes it is MSDE.
I have to do it all programmatically.
The point for this application will be to take an existing Access database and convert it to MSDE and then transfer all the data.
I have to do it programmatically due to the following reasons:
over 600 clients
clients have different versions of the application
only DAO is distributed.
Let's all bow or heads in a moment of silence...|||he he he
thank you, thank you.
he heh e
I know, this is a pain.
I had it in ADO but I don't even know how to connect to SQL server using DAO.|||Check out the link in this thread...
it's a link to some shareware that you might find useful...
http://www.dbforums.com/t972789.html
(would help if I paste it here, wouldn't it)|||What thread?
Friday, February 17, 2012
Cutting to a certain word
Hi there, i need to know how to cut a string to the nearest word. For example, i've got an article and i need to extract just a part of the beginning, i could use LEFT([content], 250) but there is little chance this will cut on a word. Therefore i need to know if there is a function that will cut to the nearest word in T-SQL or i will simply put a summary field in the database. (I prefer to generate the summary on the fly if possible)
You could use CHARINDEX.
SELECT LEFT(column, CHARINDEX(' ', column) ) FROM yourTable
|||I just looked up what you said and this doesn't make sense...
I didn't even try but i know what this will result in... Returns the first word of a column...
But i guess if i provide a startAT value(param 3) to charindex i can start the search at 250 characters and it will cut accordingly...
|||Yes, this will always give you a full word:
Declare @.tvarchar(100), @.startatintSET @.t ='this is a good test and a long sentence to test end of word'SET @.startat = 33SELECT @.t,left(@.t,@.startat + CHARINDEX(' ',right(@.t,len(@.t) - @.startat)))