Showing posts with label appreciated. Show all posts
Showing posts with label appreciated. Show all posts

Monday, March 19, 2012

generating ALTER statement with SMO

Is it possible to generate ALTER statement for the stored proc with the SMO?

Any link will be appreciated. Thanks.

Any help please. Or it is not possible at all.|||In practice I always drop an existing stored procedure and recreate it when a change is required. Is there a particular reason why you'd rather alter the procedure?

generating ALTER statement with SMO

Is it possible to generate ALTER statement for the stored proc with the SMO?

Any link will be appreciated. Thanks.

Any help please. Or it is not possible at all.|||In practice I always drop an existing stored procedure and recreate it when a change is required. Is there a particular reason why you'd rather alter the procedure?

Friday, March 9, 2012

Generate SQL Script including actual Data

Hi NG
Is there a way to generate an SQL Script that not only includes database
structure but also the content / data of tables ?
helps appreciated
ChristianChristian
BACKUP\RESTORE commnads
"Christian" <chmug@.swissonline.ch> wrote in message
news:e6efCvUUFHA.548@.tk2msftngp13.phx.gbl...
> Hi NG
> Is there a way to generate an SQL Script that not only includes database
> structure but also the content / data of tables ?
> helps appreciated
> Christian
>|||i can't figure out what you're talking about . could you give me some infos
?
Chris
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:O1wkL1UUFHA.3944@.tk2msftngp13.phx.gbl...
> Christian
> BACKUP\RESTORE commnads
>
> "Christian" <chmug@.swissonline.ch> wrote in message
> news:e6efCvUUFHA.548@.tk2msftngp13.phx.gbl...
>> Hi NG
>> Is there a way to generate an SQL Script that not only includes database
>> structure but also the content / data of tables ?
>> helps appreciated
>> Christian
>>
>|||Try QALite (Downloadable from the internet), i will provide you with a set
of functions to get additional Insert Statements for the data.
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"Christian" <chmug@.swissonline.ch> schrieb im Newsbeitrag
news:e6efCvUUFHA.548@.tk2msftngp13.phx.gbl...
> Hi NG
> Is there a way to generate an SQL Script that not only includes database
> structure but also the content / data of tables ?
> helps appreciated
> Christian
>|||Sure
--We perfom a backup of the database
BACKUP DATABASE test TO DISK='C:\mydatabase.bak'
--Now we restore the database with a new name
RESTORE DATABASE test_newname
FROM 'C:\mydatabase.bak'
WITH RECOVERY,
MOVE 'test_data' TO 'D:\Test_data.mdf',
MOVE 'test_log' TO 'D:\Test_log.ldf'
For more details please refer to the BOL
"Christian" <chmug@.swissonline.ch> wrote in message
news:OdSr26UUFHA.3952@.TK2MSFTNGP15.phx.gbl...
> i can't figure out what you're talking about . could you give me some
infos
> ?
> Chris
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:O1wkL1UUFHA.3944@.tk2msftngp13.phx.gbl...
> > Christian
> > BACKUP\RESTORE commnads
> >
> >
> > "Christian" <chmug@.swissonline.ch> wrote in message
> > news:e6efCvUUFHA.548@.tk2msftngp13.phx.gbl...
> >> Hi NG
> >>
> >> Is there a way to generate an SQL Script that not only includes
database
> >> structure but also the content / data of tables ?
> >>
> >> helps appreciated
> >>
> >> Christian
> >>
> >>
> >
> >
>|||Ok, downloaded and installed ... but where can i generate an SQL Script ?
My intension / target
i've a database with content. i wan't the whole database structure INCL. the
data i a SQL Script .. i don't wanna backup / restore the database! my
target is to have a SQL-Script!
Christian
"Jens Süßmeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote in
message news:ee67X9UUFHA.2892@.TK2MSFTNGP14.phx.gbl...
> Try QALite (Downloadable from the internet), i will provide you with a set
> of functions to get additional Insert Statements for the data.
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
>
> "Christian" <chmug@.swissonline.ch> schrieb im Newsbeitrag
> news:e6efCvUUFHA.548@.tk2msftngp13.phx.gbl...
>> Hi NG
>> Is there a way to generate an SQL Script that not only includes database
>> structure but also the content / data of tables ?
>> helps appreciated
>> Christian
>|||My intension / target
i've a database with content. i wan't the whole database structure INCL. the
data i a SQL Script .. i don't wanna backup / restore the database! my
target is to have a SQL-Script!
Christian
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uojSeDVUFHA.928@.TK2MSFTNGP15.phx.gbl...
> Sure
> --We perfom a backup of the database
> BACKUP DATABASE test TO DISK='C:\mydatabase.bak'
> --Now we restore the database with a new name
> RESTORE DATABASE test_newname
> FROM 'C:\mydatabase.bak'
> WITH RECOVERY,
> MOVE 'test_data' TO 'D:\Test_data.mdf',
> MOVE 'test_log' TO 'D:\Test_log.ldf'
> For more details please refer to the BOL
>
> "Christian" <chmug@.swissonline.ch> wrote in message
> news:OdSr26UUFHA.3952@.TK2MSFTNGP15.phx.gbl...
>> i can't figure out what you're talking about . could you give me some
> infos
>> ?
>> Chris
>> "Uri Dimant" <urid@.iscar.co.il> wrote in message
>> news:O1wkL1UUFHA.3944@.tk2msftngp13.phx.gbl...
>> > Christian
>> > BACKUP\RESTORE commnads
>> >
>> >
>> > "Christian" <chmug@.swissonline.ch> wrote in message
>> > news:e6efCvUUFHA.548@.tk2msftngp13.phx.gbl...
>> >> Hi NG
>> >>
>> >> Is there a way to generate an SQL Script that not only includes
> database
>> >> structure but also the content / data of tables ?
>> >>
>> >> helps appreciated
>> >>
>> >> Christian
>> >>
>> >>
>> >
>> >
>>
>|||DOn´t know how many tables you´ve got... but there is a qay to script a
single table in QA, right click on the Table --> DDL and inserts.
Jens SUessmeyer.
"Christian" <chmug@.swissonline.ch> schrieb im Newsbeitrag
news:eApftPVUFHA.548@.tk2msftngp13.phx.gbl...
> Ok, downloaded and installed ... but where can i generate an SQL Script ?
> My intension / target
> i've a database with content. i wan't the whole database structure INCL.
> the data i a SQL Script .. i don't wanna backup / restore the database! my
> target is to have a SQL-Script!
> Christian
> "Jens Süßmeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote
> in message news:ee67X9UUFHA.2892@.TK2MSFTNGP14.phx.gbl...
>> Try QALite (Downloadable from the internet), i will provide you with a
>> set of functions to get additional Insert Statements for the data.
>> HTH, Jens Suessmeyer.
>> --
>> http://www.sqlserver2005.de
>> --
>>
>> "Christian" <chmug@.swissonline.ch> schrieb im Newsbeitrag
>> news:e6efCvUUFHA.548@.tk2msftngp13.phx.gbl...
>> Hi NG
>> Is there a way to generate an SQL Script that not only includes database
>> structure but also the content / data of tables ?
>> helps appreciated
>> Christian
>>
>|||try the free data and schema scripter from Innovartis. It comes free with the
evaluation of DB Ghost -
http://www.innovartis.co.uk/database_change_management_evaluation.aspx
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Build, Comparison and Synchronization from Source Control = Database change
management for SQL Server
"Christian" wrote:
> Hi NG
> Is there a way to generate an SQL Script that not only includes database
> structure but also the content / data of tables ?
> helps appreciated
> Christian
>
>

Sunday, February 26, 2012

Generate Random Numbers

Hi, how do I use the Rand Function to generate a Random integer value between 1 and 20. Any help will be appreciated.

Thanks

What about this one:

SELECT

CEILING(RAND()*20) AS myrandIntegerBetween0And20

Sunday, February 19, 2012

Generate a unique alphanumeric password

Hi There!
Does anybody know how to generate unique alphanumeric passwords in SQLServer?
You help will be very much appreciated :)
:) :)
Mel!Hello,

I don't think it is possible in SQLServer.
You can try:
http://www.burney.ws/software/demos/password_generator/

Kind regards,

Jan|||Originally posted by melaniemayfield
Does anybody know how to generate unique alphanumeric passwords in SQLServer?


I guess you don't think GUID is a nice password? ;-)

Just using RAND you can create some random passwords like this...

DECLARE @.PwdLen SMALLINT,
@.Chr TINYINT,
@.Password VARCHAR(20)

-- Seed
SET @.Chr = RAND(DATEPART(ms, GETDATE())) * 0
SET @.Password = ''

SET @.PwdLen = 1
WHILE @.PwdLen < 8
BEGIN
SET @.Chr = RAND() * 62
SET @.Password = @.Password + CHAR(
CASE WHEN @.Chr < 10 THEN @.Chr + 48
WHEN @.Chr BETWEEN 10 AND 35 THEN @.Chr + 55
ELSE @.Chr + 61
END)

SET @.PwdLen = @.PwdLen + 1
END

SELECT @.Password [Password]

Perhaps can get you something to work from.

Cheers,
Robert