Tuesday, March 27, 2012
Can we directly execute a text file that contains all sql commands
We have our stored procedures (sp) saved in a .sql file, one for each. When
we want to create an sp, we open the corresponding .sql file using notepad o
r
sql query analyzer, and then execute it.
Do we have a way that we just need to pass those .sql files' name, including
full path, and run all those sp creation sql code in a batch, without
openning each .sql file one by one?
Thanks a lot for your help.Yes, use osql.
exec master..xp_cmdshell 'osql ...'
You can look up the syntax for osql in Books Online...
A
"Andrew" <Andrew@.discussions.microsoft.com> wrote in message
news:917F3B91-8A8E-454D-8782-A76CF5D59B4A@.microsoft.com...
> Hi, friends,
> We have our stored procedures (sp) saved in a .sql file, one for each.
> When
> we want to create an sp, we open the corresponding .sql file using notepad
> or
> sql query analyzer, and then execute it.
> Do we have a way that we just need to pass those .sql files' name,
> including
> full path, and run all those sp creation sql code in a batch, without
> openning each .sql file one by one?
> Thanks a lot for your help.|||You can use the command line tools for that. Look up 'osql' in BOL.
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"Andrew" <Andrew@.discussions.microsoft.com> wrote in message
news:917F3B91-8A8E-454D-8782-A76CF5D59B4A@.microsoft.com...
> Hi, friends,
> We have our stored procedures (sp) saved in a .sql file, one for each.
> When
> we want to create an sp, we open the corresponding .sql file using notepad
> or
> sql query analyzer, and then execute it.
> Do we have a way that we just need to pass those .sql files' name,
> including
> full path, and run all those sp creation sql code in a batch, without
> openning each .sql file one by one?
> Thanks a lot for your help.
Thursday, March 22, 2012
can u guide me writing a simple query
I am trying to do following thing:
i got a table which contains some words...all i need to do is whenever i see a word starting with 'R', i need to remove the starting 'R' and update it in the same table...
could anyone help me out here....thanks a lot in advance.......
I'm assuming by the title that you want to do it in the sql query. Here is one way to do it:
Select
Case WhenWordlike 'r%' Then right(Word, len(Word)-1) end
From Table1
Can you provide some sample data and what you are trying to update it to so we can get a better idea?
sqlThursday, March 8, 2012
Can SQL server encrypt a single column within table?
We have a SecUsers table that contains "Password" column, can SQL server
encrypt that column within that table? Please explain. If not, do we have
to buy a software that will encrypt single column in DB?
Thank you for your help.
Chai W.Is it possible for you not to store the password in the first place?
Try storing a hash (MD5 or SHA1 etc) of the password instead.
It has the benefit also, that the password is never transmitted over
the network (it must be hashed by the client application).
"Chai" <chai@.trs.state.il.us> wrote in message
news:OzJJtR7RDHA.3880@.tk2msftngp13.phx.gbl...
> Hello:
> We have a SecUsers table that contains "Password" column, can SQL server
> encrypt that column within that table? Please explain. If not, do we have
> to buy a software that will encrypt single column in DB?
> Thank you for your help.
> Chai W.
>
Friday, February 10, 2012
can not open file
Hello,
Using a foreach loop which contains dataflow. Inside dataflow there is a flatfile source.
The following error is produced inthe flat file source.
Error: 0xC020200E at Data Flow Task, Flat File Source [446]: Cannot open the datafile "EqRonnieHK".
Error: 0xC004701A at Data Flow Task, DTS.Pipeline: component "Flat File Source" (446) failed the pre-execute phase and returned error code 0xC020200E.
Please note, the file does indeed exist
Thanks
Are you using a fully qualified path though? Doesn't look like it. Always use fully qualified paths.