Showing posts with label therei. Show all posts
Showing posts with label therei. Show all posts

Tuesday, March 20, 2012

Copy Database to another server

Hello there
I have database on my local server
I have also database on internet server
at 12:00pm i would like to update the internet server with all the changes
that made on the local server
how can i do this?
any help would be useful
If every table on your database has a primary key you should be using
transactional replication for this.
"Oded Kovach" <roygoldh@.hotmail.com> wrote in message
news:u8joTU$kEHA.1936@.TK2MSFTNGP12.phx.gbl...
> Hello there
> I have database on my local server
> I have also database on internet server
> at 12:00pm i would like to update the internet server with all the changes
> that made on the local server
> how can i do this?
> any help would be useful
>
|||Thankes kilary
I have many databases on the server
and some of the tables in some databases realy haven't primary key
These databases shouldn't be raplicated at all
How can i remove them from the list of the replication?
hope that you can help me
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:eDrqXlAlEHA.2500@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> If every table on your database has a primary key you should be using
> transactional replication for this.
>
> "Oded Kovach" <roygoldh@.hotmail.com> wrote in message
> news:u8joTU$kEHA.1936@.TK2MSFTNGP12.phx.gbl...
changes
>
|||Thanks Hilary
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:eDrqXlAlEHA.2500@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> If every table on your database has a primary key you should be using
> transactional replication for this.
>
> "Oded Kovach" <roygoldh@.hotmail.com> wrote in message
> news:u8joTU$kEHA.1936@.TK2MSFTNGP12.phx.gbl...
changes
>

Sunday, February 19, 2012

Converting to crosstab table

Hello there
I have table with 2 fields: table1(Field1, Field2)
I need to present it as crosstab in this way:
Original:
1, 1
2, 2
2, 3
3, 4
3, 5
3, 6
3, 7
Should look like this:
1, 1
2, 2, 3
3, 4, 5, 6
4, 7
How can i do this dinamicly?See if this helps.
http://groups.google.com/group/micr...br />
6dd9e73e
AMB
"Roy Goldhammer" wrote:

> Hello there
> I have table with 2 fields: table1(Field1, Field2)
> I need to present it as crosstab in this way:
> Original:
> 1, 1
> 2, 2
> 2, 3
> 3, 4
> 3, 5
> 3, 6
> 3, 7
> Should look like this:
> 1, 1
> 2, 2, 3
> 3, 4, 5, 6
> 4, 7
> How can i do this dinamicly?
>
>|||Can you explain the logic behind the result?
--
"Roy Goldhammer" wrote:

> Hello there
> I have table with 2 fields: table1(Field1, Field2)
> I need to present it as crosstab in this way:
> Original:
> 1, 1
> 2, 2
> 2, 3
> 3, 4
> 3, 5
> 3, 6
> 3, 7
> Should look like this:
> 1, 1
> 2, 2, 3
> 3, 4, 5, 6
> 4, 7
> How can i do this dinamicly?
>
>|||I think he had a typo in his sample data.
Roy, this is why producing something we can repro will cause less problems.
Please generate CREATE TABLE and INSERT statements instead of typing out
tabular data by hand, it will be much less prone to errors. See
http://www.aspfaq.com/5006
"Omnibuzz" <Omnibuzz@.discussions.microsoft.com> wrote in message
news:A4DFEBEC-BABA-4929-9821-3077466EFA2F@.microsoft.com...
> Can you explain the logic behind the result?
> --
>
>
> "Roy Goldhammer" wrote:
>|||We don't need your ddl statements to confirm that whatever
type of dynamic xtab you want you can do easily with Rac:)
www.rac4sql.net

Tuesday, February 14, 2012

Converting Text to number

Hello there
I have table with field which is a text field that provide numbers and text
I would like to drop all the records that on the current field has text and
leave only the records with the number on the field
For this i've tried to use the convertion process but it gave me an error
when the data is text
Is there a way to know if the data is text or number so i can deal with it?
any help would be useful
roy@.atidsm.co.il
' 050-7709399"Roy Goldhammer" <roygoldh@.hotmail.com> wrote in
news:#Ok5SqLIFHA.2564@.tk2msftngp13.phx.gbl:

> Hello there
> I have table with field which is a text field that provide numbers and
> text
> I would like to drop all the records that on the current field has text
> and leave only the records with the number on the field
> For this i've tried to use the convertion process but it gave me an
> error when the data is text
> Is there a way to know if the data is text or number so i can deal with
> it?
Try ISNUMERIC(expression)|||Although ISNUMERIC will provide the desired results in many cases, it will
also consider some obscure numeric values to be numeric. You can use LIKE
to test for integer digits. The example shows some differences between
ISNUMERIC and LIKE.
CREATE TABLE MyTable
(
MyNumber varchar(10)
)
GO
INSERT INTO MyTable VALUES('')
INSERT INTO MyTable VALUES(' ')
INSERT INTO MyTable VALUES('1')
INSERT INTO MyTable VALUES(' 2')
INSERT INTO MyTable VALUES('3 ')
INSERT INTO MyTable VALUES('1D')
INSERT INTO MyTable VALUES('0D1')
INSERT INTO MyTable VALUES('0E1')
SELECT *
FROM MyTable
WHERE ISNUMERIC(MyNumber) = 0
SELECT *
FROM MyTable
WHERE MyNumber LIKE '%[^0-9]%' OR
DATALENGTH(MyNumber) = 0
Hope this helps.
Dan Guzman
SQL Server MVP
"Roy Goldhammer" <roygoldh@.hotmail.com> wrote in message
news:%23Ok5SqLIFHA.2564@.tk2msftngp13.phx.gbl...
> Hello there
> I have table with field which is a text field that provide numbers and
> text
> I would like to drop all the records that on the current field has text
> and
> leave only the records with the number on the field
> For this i've tried to use the convertion process but it gave me an error
> when the data is text
> Is there a way to know if the data is text or number so i can deal with
> it?
> any help would be useful
> --
>
> roy@.atidsm.co.il
> ' 050-7709399
>|||ISNUMERIC also interprets '.', '-' and '+' as numeric.
Dan Guzman wrote:
> Although ISNUMERIC will provide the desired results in many cases, it
> will also consider some obscure numeric values to be numeric. You
> can use LIKE to test for integer digits. The example shows some
> differences between ISNUMERIC and LIKE.
> CREATE TABLE MyTable
> (
> MyNumber varchar(10)
> )
> GO
> INSERT INTO MyTable VALUES('')
> INSERT INTO MyTable VALUES(' ')
> INSERT INTO MyTable VALUES('1')
> INSERT INTO MyTable VALUES(' 2')
> INSERT INTO MyTable VALUES('3 ')
> INSERT INTO MyTable VALUES('1D')
> INSERT INTO MyTable VALUES('0D1')
> INSERT INTO MyTable VALUES('0E1')
> SELECT *
> FROM MyTable
> WHERE ISNUMERIC(MyNumber) = 0
> SELECT *
> FROM MyTable
> WHERE MyNumber LIKE '%[^0-9]%' OR
> DATALENGTH(MyNumber) = 0
>
> "Roy Goldhammer" <roygoldh@.hotmail.com> wrote in message
> news:%23Ok5SqLIFHA.2564@.tk2msftngp13.phx.gbl...

Sunday, February 12, 2012

Converting problem

Hello there
I'm imporing data from csv files.
one of the field with data lile '20060105' should be converted to date.
Vbscript isdate function cannot convert it to date, but sql server can
convert it.
Does someone knows whay?"Roy Goldhammer" <roy@.hotmail.com> wrote in message
news:O7A0OcAdGHA.3388@.TK2MSFTNGP05.phx.gbl...
> Hello there
> I'm imporing data from csv files.
> one of the field with data lile '20060105' should be converted to date.
> Vbscript isdate function cannot convert it to date, but sql server can
> convert it.
> Does someone knows whay?
>
Because SQL is better than VB Script? :-)
Regards
Colin Dawson
www.cjdawson.com|||when you do an import, the data in the column in the import file is matched
up with the column in the table. an implicit conversion occurs to get load
the data into the table. your text string '20060105' is converted/seen as
'YYYYMMDD'. Thus tis a valid value.
vb hostscript will intepret the value just as a string.
-oj
"Roy Goldhammer" <roy@.hotmail.com> wrote in message
news:O7A0OcAdGHA.3388@.TK2MSFTNGP05.phx.gbl...
> Hello there
> I'm imporing data from csv files.
> one of the field with data lile '20060105' should be converted to date.
> Vbscript isdate function cannot convert it to date, but sql server can
> convert it.
> Does someone knows whay?
>

Friday, February 10, 2012

Converting Numbers

Hello there
I have numbers that i would like to present it as standart currency: 0.00
and still has it as number
So far i could do this only by convert it to text. and it's not good because
i'm export it afterword to Excel.
I've tried to convert it to Decimal(10,2) and it didn't do the job
Is there another way to do this?
..
roy@.atidsm.co.il
: 03-5611606
' 050-7709399Why don't you deal with formatting in Excel post importing? If you need to
automate the process, you can use a vba script that formats the result.
T-SQL is not really intended for formatting, rather for data manipulation.
If you must do this with T-SQL, the STR function allows you to specify
length and decimal places, but it results in a character string.
BG, SQL Server MVP
www.SolidQualityLearning.com
"Roy Goldhammer" <roygoldh@.hotmail.com> wrote in message
news:eAJXE7OnFHA.3552@.TK2MSFTNGP10.phx.gbl...
> Hello there
> I have numbers that i would like to present it as standart currency: 0.00
> and still has it as number
> So far i could do this only by convert it to text. and it's not good
> because
> i'm export it afterword to Excel.
> I've tried to convert it to Decimal(10,2) and it didn't do the job
> Is there another way to do this?
> --
>
> ..
> roy@.atidsm.co.il
> : 03-5611606
> ' 050-7709399
>|||When importing to Excel, you really don't need to format the data - or rathe
r
*shouldn't* format it.
If you let Excel format the values, the data can't end up being corrupted in
any way, and can be used further - using all the capabilities of Excel
(graphs, pivot tables, filtered views,...). But only if data gets to Excel i
n
its native form.
Plus: Excel's formatting capabilities by far exceed those provided by SQL
Server.
ML|||I am not sure what the problem is. So I am just throwing this in the air:
CONVERT(MONEY, Col_name)
--
Cathy B
"ML" wrote:

> When importing to Excel, you really don't need to format the data - or rat
her
> *shouldn't* format it.
> If you let Excel format the values, the data can't end up being corrupted
in
> any way, and can be used further - using all the capabilities of Excel
> (graphs, pivot tables, filtered views,...). But only if data gets to Excel
in
> its native form.
> Plus: Excel's formatting capabilities by far exceed those provided by SQL
> Server.
>
> ML