I think i have some syntax error in my script but can't figure out where.
I want to select the Integer that falls between a pair of ( ) begining from the right of a cell? Reason being, there might be another pair of brackets containing characters
and what if some records are w/o close brackets for some reason..
e.g.
Period | Program...
Hi,
I have partitioned a table and it has been partitioned according to an account id. ie also rows that have accountid =1 will be in A partition and all rows that have accountid = 2 will be in B partition. so now if i execute a query with where condition accountid =1 sql server will search only in A partition.
Suppose if i add anothe...
Hi all!
I'm not an expert on SQL Server/T-SQL/SMSS so please bear with me :)
I use the 'Generate change script' feature of SMSS to track database schema changes. This generates files like the following:
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULL...
I have two tables invoices and receipts
i have to show the alternate data of invoices and receipts in datagrid; condition is that
if Date column in INVOICE table matches with invoice columns in RECEIPTS table then the corresponding row of RECEIPTS table should come after INVOICES table row
if there is no match then INVOICES table n...
Is it possible to call a SQL Server stored procedure asynchronously via C#?
I have a stored procedure which writes a backup of a specific database (this can takes a longer time) and I want to show the progress of the backup process in a windows forms (for this I use http://www.wisesoft.co.uk/articles/tsql_backup_restore_progress.aspx)....
Hi there.
I'm implementing a logging feature on a asp.net mvc2 application, that uses SqlServer2008 as a database and Entity Framework as a data model.
I enabled CDC feature of SqlServer and it's logging changes well, but I just noticed that some of the old logging data is erased.
Does anyone know what's default period CDC keeps recor...
Does anyone have in their back pocket a function that can achieve this?
...
I'm looking at doing this, however I'm having difficulty find any code samples of how to do this. Presumably I make the call in the c# code for the provider ?, however what concerns me from a performance point of view is that I will be deserialising XML to objects from the web service and then turning these objects back into XML for serv...
Dear Friend,
How can i Retrive Root Directory in SQL Server using SQL Query???
Thanks.
...
I want to concat two Columns in the TableAdapter Wizard of the VS Dataset-Designer.
The problem is that one column has NULL-Values and hence the concatination results in NULL regardless of the value of the other column.
I've found out that i must SET CONCAT_NULL_YIELDS_NULL OFF, which is a Database option.
How can i change this setting ...
I have a table with timestamps, and I want to partition this table into hour-long intervals, starting at now and going backwards a couple of hours. I'm unable to get the results I need with the T-SQL DATEDIFF function, since it counts the number of times the minute hand passes 12 between the two dates - I want the number of times them mi...
Dear all,
I would like to insert data from a file into the table Division of this model which is very much simplified:
create table Statements (
Id INT IDENTITY NOT NULL
primary key (Id)
)
create table Item (
StatementFk INT not null,
ItemNameFk INT not null,
primary key (StatementFk)
)
cr...
I have a table with primary keys that look like this:
FIRSTKEY~ABC
SECONDKEY~DEF
FIRSTKEY~DEF
I want to write a SELECT statement that strips off the segment following the tilde and returns all rows that are duplicates after the post-tilde segment is gone. That is,
SELECT ...
Gives me:
FIRSTKEY~ABC
FIRSTKEY~DEF
As "duplicates".
...
How to convert a column value from varbinary(max) to varchar to read..
...
I'm working on some stuff for an in-house CRM. The company's current frontend allows for lots of duplicates. I'm trying to stop end-users from putting in the same person because they searched for 'Bill Johnson' and not 'William Johnson.' So the user will put in some information about their new customer and we'll find the similar names (i...
I am creating a .net application, with a Sql Server db engine. I would like my site to be accessed by thousands of users per second. What does the number of connections rely on?
How many connection can IIS hold, and Sql Server?
...
I'm working with an SQL Server 2005 Express instance. Any attempt (both programatically or by using a table editor (for example VS Server Explorer --> Edit Table Data)) to enter a unicode string results in a sequence of question marks (????). I guess that either SQL Server 2005 Express doesn't support unicode at all or it requires some e...
I am trying to link several tables together in SQL Server. The code below shows how I have linked the tables together so far:
select *
from profile
left join learner l on l.learnerid = profileid
left join learner_levels ll on ll.learnerid = l.learnerid
left join subjects s on s.subjectid = ll.subjectid
left join learner_group lg on lg.l...
I have an SP like so (using SQL Server):
ALTER PROCEDURE [dbo].[sp_ClientNotes_update]
@id uniqueidentifier,
@ordering smallint = NULL,
@title nvarchar(20) = NULL,
@content text = NULL
AS
BEGIN
SET NOCOUNT ON;
UPDATE tbl_ClientNotes
SET ordering=@ordering, title=@title, content=@content
WHERE id=@id
END
...
I know you can create a script to replicate a table using:
right click table > script table as > create to > new query editor window
But how can I generate a script that contains a bunch of insert commands for each row in the table?
Table1
Id1, Row1
Id2, Row2
Id3, Row3
Insert into Table1 values(Row1);
Insert into Table1 values(Row2);...