SQLCMD supports the -s parameter to specify the column separator, but I couldn't figure how how to represent the tab (CHAR(9)) character.  I have tried the following but both don't work:
sqlcmd -S ServerName -E -Q"select * from mytable" -s"\t" -o results.txt
sqlcmd -S ServerName -E -Q"select * from mytable" -s'\t' -o results.txt
Any i...
            
           
          
            
            I have the following in a field ABCD, EFG, HIJ and can confirm this by selecting it.  I need to be able to search this string for ABCD so I used the following:
case
when CHARINDEX(g.letters ,'ABCD') <> 0
then (- 2)
else (- 1)
end
However its always returning -1     
...
            
           
          
            
            Hello, I want to connect to an MSSQL Server 2000 from PHP installed in a unix platform (CentOs) and to be able to run queries (SELECT and UPDATE). The solution must support UTF-8 data.
As search through the web, I find out that there exists many different approaches (freeTDS, unixODBC, ODBTP, Easysoft ODBC, Easysoft ODBC-ODBC Bridge, PD...
            
           
          
            
            I have the following folders in the table 'Folders' in my database:
Folder1
Folder2
Folder3
Folder4
The path of the folders - Folder1\Folder2\Folder3\Folder4
When i click on Folder3,i have to get the path as - Folder1\Folder2\Folder3.For this i am passing the folderID of Folder3.
How can i get this result ? 
table structure
Folde...
            
           
          
            
            Hi,
i'm running 12 sql server replications, 11 of which have 1 subscription, and 1 has 2 subscriptions.
Now i have a problem with a very large transaction log which i want to shrink, but i get the messages that the transaction log is in use.
I suspect that the replication (publication, maybe the subscription too) is causing this problem...
            
           
          
            
            Up until yesterday I have been happily connecting to SQL Server Express 2005 using PHP 5 on IIS 7.
Yesterday I started getting errors when selecting a database.
<?php
$link = mssql_connect('localhost,1433', 'login', 'password');
if(!$link) {
    die('could not connect to MSSQL');
}
 if(!mssql_select_db('database', $link)) {
    echo ...
            
           
          
            
            Can anyone tell me what wrong I have written in the following query so that this error message is being shown.
strSelectQuery = "SELECT LED_ID AS PK_ID, FIRST_NAME + ' ' + LAST_NAME AS NAME"
                        + " FROM M_LEADERLED INNER JOIN M_USER_DETAILS"
                        + " ON M_LEADERLED.LED_ID = M_USER_DETAILS.PK_ID"
 ...
            
           
          
            
            I am pulling out my hair over here.  I have a table that has a UNIQUE Key (IX_tblTable) and the unique key is on a column Number.  I am parsing some data from the web and storing it in the table.  My latest collection of data from the web contains number THAT ARE NOT CONTAINED IN THE DATABASE.  so I am getting data from the site and all ...
            
           
          
            
            Situation
I'm creating a C#/WPF 4 application using a SQL Compact Edition database as a backend with the Entity Framework and deploying with ClickOnce.
I'm fairly new to applications using databases, though I don't suspect I'll have much problem designing and building the original database. However, I'm worried that in the future I'll ...
            
           
          
            
            Currently in a simple form i have the following declared table in code:
declare @FileIDs as table
(
    ID int not null
)
and i can fill it up e.g. manually like this:
insert into
    @FileIDs
values
    (1)
insert into
    @FileIDs
values
    (2)
insert into
    @FileIDs
values
    (3)
Also i have another table called Files and ...
            
           
          
            
            string date = p_text_data.Text;
string sql = @"INSERT INTO Warehouse (title,count,price,date) ";
try
{
    using (SqlConnection connection = ConnectToDataBase.GetConnection())
    {
        SqlCommand command = new SqlCommand(sql, connection);
        for (int i = 0; i < mdc.Count; i++)
        {
            sql += "SELECT @title" + i + ...
            
           
          
            
            I'm using this sql query:
SELECT     id, datetime
FROM         (SELECT     id, datetime
                       FROM          DanskAktieAnalyse.dbo.vTest
                       UNION ALL
                       SELECT     id, datetime
                       FROM         vTest2) AS articles
ORDER BY datetime
Is it possible to get an extr...
            
           
          
            
            I have a table, Table1, containing the fields TimeStamp and Humidity, which have the values:
TimeStamp
    '2010-09-29 11:05:29.6'
    '2010-09-29 11:05:29.7'
    '2010-09-29 11:05:29.8'
    '2010-09-29 11:05:29.9'
    '2010-09-29 11:05:30.0'  
Humidity
       15.291
       17.379
       16.857
       16.335
       15.813 
I would lik...
            
           
          
            
            Hello,
I am making a login form on my site, and need a little bit of help. I keep receiving an error when I use this script:
<?php
$em = $_REQUEST["email"];
$pa = md5($_REQUEST["password"]);
//connectioninfo hidden   
$connectionInfo = array( "UID"=>$uid,                              
                         "PWD"=>$pwd,           ...
            
           
          
            
            Is it possible to use our solution's existing authentication mechanism for determining access rights to a MS Analysis services cube?
We already have a system that manages usage policies and we would like to avoid duplicating this on the SQL Server.
Our authentication system is based on NetSqlAzMan and we could expose it as a web servic...
            
           
          
            
            I have a webpage that takes 10 minutes to run one query against a database, but the same query returns in less than a second when run from SQL Server Management Studio.
The webpage is just firing SQL at the database that is executing a stored procedure, which in turn is performing a pretty simple select over four tables.  Again the code...
            
           
          
            
            I hate code that looks like its been hacked together.  I have just written this:
update table1.dbo.totals
    set @FEE = case
       when isnull(g.SGROUPS,0) > 1
         then @GROUPPRICE * case
             when CHARINDEX('JMCG', g.GROUPS) > 0
                 then (g.SGROUPS - 2)
                 else (g.SGROUPS - 1)
                 ...
            
           
          
            
            What are the limitations, unexpected pitfalls and performance traits of moving from in process C# code to SQL CLR Functions? 
We currently have several data heavy processes that run very fast using in process C# Asp.net MVC project without using a db at all.  Performance is very important.  The application uses a static in memory cache ...
            
           
          
            
            I have a query in SQL Server that I am trying to convert to a query in MS-Access 2003. The query is designed to be used as the basis for a report. The report has two fields .. 'Cases Assigned' and 'Cases Closed'.
SELECT 
(SELECT COUNT(*) 
FROM CaseDetail 
WHERE CaseAssignedDate Between '1/1/2008' AND '1/1/2009') as 'Cases Assigned',
(SE...
            
           
          
            
            I would like to have a stored procedure that will update values in a table row depending on whether or not the parameters are provided. For example, I have a situation where I want to update all the values, but also a situation where I'm only required to update two values. I was hoping to be able to do this with only one procedure, rathe...