Hi everyone.
I have a Powershell script that calls sqlcmd to run a sql script that backs up a database:
function RunSqlScriptWithErrorMessage
{
param([string]$sqlServer, [string]$sqlUserName, [string]$sqlPassword, [string]$scriptName, [string]$errorMessage)
$commandName = "sqlcmd"
$startInfo = New-Object Diagnostics.Proces...
Is it possible for BULK INSERT/bcp to read from a named pipe, fifo-style?
That is, rather than reading from a real text file, can BULK INSERT/bcp be made to read from a named pipe which is on the write end of another process?
For example:
create named pipe
unzip file to named pipe
read from named pipe with bcp or BULK INSERT
or:
...
Hi folks,
I have the following trigger, but because a trigger needs to handle multiple records, I'm not sure how to correctly handle this, in my trigger code.
Can someone please suggest how I can change the TSql below to correctly handle multiple records, instead of just a single record (as is listed, below).
Table Schema and defaults...
I have two instances of SQL Server:
Server1 (SQL Server 2008)
Server2 (SQL Server 2005)
I am executing a stored procedure from Server1 which references tables on Server2.
It is working fine in my test environment:
Server1 runs Vista SP2, SQL Server 2008;
Server2 runs Windows XP SP2, SQL Server 2005.
However, it is not working in...
I just downloaded SQL Server 2005 Express edition. I was hoping it would come with a GUI to let me design my tables and such, but it doesn't. I'm working with ColdFusion/CF Builder here, so I don't really want one that integrates into Visual Studio. Also, it would be helpful if it has the option to connect to a remote database too. Sugge...
I would like to be able to execute a query only once and keep the resulting DataReader open all the time to get new rows as they are added to the database table. Something like this:
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "select * from table";
using (SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SequentialA...
I was planning to have my web application on one server instance, my sql (express) on another instance and a separate domain controller on another. The purpose to allow the asp.net application to access sql server under windows security. This is hosted on a cloud server. Am I getting any security benefit doing this considering its on t...
Hi All,
We are using NHibernate as our ORM for the project and we have only database read only feature. The application will not be updating,deleting or inserting any records into the database it will be just querying the database for records.
My question is which is the best method to query the database with NHibernate in the scenari...
HI all,
How does NHibernate executes the queries? Does it manipulates the queries and uses some query optimization techniques? And what is the query execution plan followed by NHibernate?
...
Hi ...
i am creating a table in sqlserver database using query like "SELECT Table1.* INTO Table2 FROM Table1"
here Table2 created successfully but it is not showing my database
when i again fire this query than it gives error that Table2 is already created but i can't see this in my database
i am refreshing my database also
so please...
How do I connect to SQL Server 2005/2008 using Management Studio or other desktop application over the internet?
...
I have a table called NUMS with a single column n.
And I fill values 1,2,3,4,5,null in it.
Now a query
SELECT n FROM Nums
WHERE n IN (1, 2, null)
In this case I guess it's converted to
SELECT n FROM Nums
Where n = 1 OR n = 2 OR n = null
I am also comparing n with a null value which should yield unknown and it should r...
I'm developing a dynamic data app, in which I'm trying perform insert RequestRevision during update of request (logging change of request, somthing like that)
public partial class ProjectDataContext
{
partial void UpdateRequest(Request instance)
{
RequestRevision rv = new RequestRevision...
I want to update a static table on my local development database with current values from our server (accessed on a different network/domain via VPN). Using the Data Import/Export wizard would be my method of choice, however I typically run into one of two issues:
I get primary key violation errors and the whole thing quits. This is ...
Here's my problem: I have an application which uses sql server express 2005, and it is installed under default sql server express instance, SQLExpress
Under this instance there are several other databases, used by other applications (web based or desktop)
If I need to restore the database, sometimes it works, but sometimes it fails, tell...
Hi all
There is a record like
SWD Lead QA Lead PD Lead Business Manager
AAAA BBBB CCCC DDDD
I want to use T-SQL to get a result like below with the column name
SWD Lead AAAA
QA Lead BBBB
PD Lead CCCC
Business Manager DDDD
Does anyone know how to do it ?
Best Regards,
...
Is there a way to place a sql query and call a callback function in C++ when the results are ready?
I know there is a way to do this in ado.net, but this is a native environment, so I can't use .net.
...
I've bought a CSV United States business database with ~20 million records, which is divided to 51 databases, every database represents a state.
I need to write an ASP.NET MVC Web Application that will query this database, by state and more arguments. Should I create a SQL Server database and import all the records in the all 51 csv fi...
I've got a stored procedure with an int output parameter. If I run SQL Server Profiler, execute the stored procedure via some .Net code, and capture the RPC:Completed event, the TextData looks like this:
declare @p1 int
set @p1=13
exec spStoredProcedure @OutParam=@p1 output
select @p1
Why does it look like it's getting the value of th...
I get a problem with SQL Server 2005, where a stored procedure seems to randomly hang/lock, and never return any result.
What the stored procedure does is to call a function, which in turn makes a union of two different functions – returning the same type of data, but from different criteria. Nothing advanced. I don’t think it’s the fu...