Replication Related Questions

Oct 21, 2006

I have a couple questions about replication (for both 2000 and 2005 servers):

1. which system tables/dmvs/system sprocs can I look at to determine which columns of a table are being replicated?

2. which system tables/dmvs/sprocs can I call to get metadata about publishers and subscribers?

Thanks!

View 2 Replies


ADVERTISEMENT

SQL Count And Related Questions

Sep 8, 2006

Hi, I don't use SQL much but I need to know how to form the following query against a SQL table. I have a single table with two columns - CurrentPage and LastPage.

I need to write SQL to perform a number of iterations of a particular insert into another table, depending upon the count from CurrentPage to LastPage i've put the following Pseudocode together, but need help implementing this.

Declare counter
Set counter = currentpage
If counter > lastpage
Goto task exit loop
Else perform task - (insert string into table)
Increment counter and loop

I've been playing / reading up, but i'm getting nowhere fast -

DECLARE @Count int
DECLARE @Current string
DECLARE @Last string

SET @Current= dbSL.tblPaging_colCurrentPage
SET @Count= dbSL.tblPaging._colPagingCount
SET @Last= dbSL.tblPaging._colLastPage
WHILE @Count <= dbSL.tblPaging._colLastPage

BEGIN
PRINT 'Hello World'
SET @Count = @Count +1
END


Any help much appreciatted.

Thanks
nme

View 1 Replies View Related

Questions Related To SQL Queries

Dec 5, 2006

Good morning,
i have four tables

Student(iid , lname, address)
Teacher(tid, lname, salary, d_number)
Lesson_teach(tid,les_name)
Lesson_attend(iid,les_name)

Well, I'm trying to find the teachers who teach one lesson and more (e.g. only if sm teaches >= 2 lessons )

I do:

select teacher.lname
from teacher,lesson_teach
where teacher.tid = lesson_teach.tid
group by lesson_teach.tid
having count(*) >= 2)



Thanks,in advance!

View 19 Replies View Related

SSIS Related Questions

Nov 7, 2006

0) We are migrating data from SQL Server 2000 OLTP design to SQL Server 2005 OLAP design.

1) We have an data flow task SSIS package.

2) We managed to send a mail with various variables & their values in subject or body of mail.

3) How do we send mail with details of Error/Warning using OnError/OnWarning events?

4) Can we have bad tables i.e where records which failed to migrate get inserted into. If yes, what are the steps to implement this.

5) Can we have a mix of in-built & custom logging. Is logging provider necessary to do logging. What logging provider to use?

6) Where are the errors that come during build, deploy, install and execute stored? Is there a log file(s) & what it their location?

7) Please post links if that is better.

View 3 Replies View Related

Easy Questions Related With A-P Cluster

Jan 10, 2007

Hi everyone,

I'm just a newbie with clustering.
We've got a 64-bit A-P cluster running with Sql25k 64-bit too.
Each node own two local network adapters. One of them (the one currently is Active) own three IP and the another one only one.

Why? From CLUADMIN I see as one of these three is set as Cluster IP Address in Active Resources. So I see the following configuration for the Active node:

Adapter 1: IP public for Active Directory
Adapter2: IP1 (reserved or ???????)
IP2 (used as SQL IP Address 1 in Active Resources)
IP3 (used as Cluster IP Address in Active Resources)

Passive node:

Adapter 1: IP public for Active Directory
Adapter2: IP (only have one ???)


Is this correct/necessary? Does anyone have similar configuration?

Thanks for your time,

View 2 Replies View Related

Some Questions Related To Donut Charts In SSRS

May 3, 2007

I am interested in knowing the following things:

How to show total of all legend items in legend block itself as "Total".
How to show Total (say amount) in the center of donut chart.
How to customize the thickness of donut in donut chart and radius of inside and outside circle (the other thickness).
The lable markers (arrow) are not coming as a right angle arrows when i tried to use the donut and pie charts, the are coming as randomly angular lines which is hampering the beauty of the report.
Please reply as soon as possible. Thanks in advance.

View 1 Replies View Related

A Few SQLExpress Usage Questions (user Setup Related)

Dec 31, 2007

Hello

I have a windows application that connects to a SQLExpress database hosted on a shared server. The client machines will run an interface software and interact with the info within SQL The SQL database isn't huge (50 megs) and all of the info is text. The interface application isn't too complex either, it was designed using VB.net05. I have a few setup questions:

1 - Is it best to use Windows or SQL authentiaction? Currently I am using Windows authentication and I have a user group setup on the DNS that is setup as a user for the SQL database. That has worked so far, but I've only had a few users logged in at one time so far. My plan was to add all DNS accounts that will use the software to the DNS user group, thus giving them access to the SQL database.

2 - I know this gets asked a TON, but I am interested in knowing how many users I should be able to support using the current setup. I have the one user acount setup for the DNS user group. The SQL table is not huge and it is all reading and writing text. The server is running Windows Server 03 and is a couple years old (not sure of exact specs).

Thanks for any help, I am still learning my way around SQL and it's great to have such a vast amount of support for the product.

Happy New Year!

Paul

View 1 Replies View Related

Replication Related Issues

Oct 15, 2007

Over the past few days, we've been experiencing some very disturbing issues that may be directly related to our prod database (publisher) replicating to the reports database (subscriber). Both machines run SQL Server 2005 unpatched (I know, I know).

When I run replication monitor, everything seems fine until I go to the Undistributed Commands page and I see a HUGE number there, currently 2 million and growing. I check the net for solutions and I find reference to setting SubscriptionStreams to a number other than default (4 cpus on each machine).

Problem one is that there is no way I can add this (that I could find anyway) to the Distribution agent through its properties.

Problem two is when I try running Activity Monitor on the subscription DB or exec sp_lock, both seem to time out or hang. This leads me to believe something is blocked in the distributor or the report db?

Any suggestions would be greatly appreciated.

View 10 Replies View Related

Replication Setup Under 7.0 (related Question)

Sep 20, 1999

Sorry for the previous mail.. Didnt mean to send it like that..

I have a question about replication. I have created the destination machine as the subscriber, where I created a pull subscribtion and tried to replicate I got this error.
"Subscriber must be running in perseat license moe to use this."

The cd I used to install MSSQL 7.0 is the msdn back office test platform. Where am I going wrong??/ because I never got to specify the per seat license anywhere..
The documentation says that If I can have it installed on a 95/98 box then it means I have a perseat licesne, which I was able to do..

Any any help is appreciated!!

TIA
JOsh

View 5 Replies View Related

Merge Replication Replicate Master And Related Tables

Jan 19, 2007



hi all,

Could we configure a merge replication such as replicate the master table and its all related tables (relation deep could be 1.)

We dont want to manually find master table relations and configure replication for the related tables.

please help for that configuration

kinds

View 5 Replies View Related

Replication Questions

Mar 26, 2001

I am reading up on Replication because soon I must set up merge replication at two branch offices. The reading has confused me a little....

1. Do I have to run the Distribution database on another server than the one holding the headquarters database? I tried to configure replication on this server, and I get a message that says, "SQL Server Agent on ROCK currently uses a system account, which causes replication between servers to fail. In the following dialog, specify a domain account for the service startup account."

It then presents a dialog allowing me to add an account and password. I mistakenly assumed that it would create the account if it didn't exist, but it warned me that it didn't have sufficient rights to check the account, and was I sure that it existed with all the rights required? So I cancelled, to send this message :-)

When it says "Account", I assume it means create a virtual user? What rights should I give the account? I assume it will have to be able to do anything. What database should I give it as the default? Could I have the first agent not use a system account, and thereby run the distribution server on the same machine? (I have another machine available, I just want to know if I need it, or at what point of activity I would need it.) Will it matter whether the agent on this third machine usese a system account?

2. Virtually all the tables in the database use incrementing keys. Will I have to modify this at each branch, say seeding Branch 1 to start with values of 1, Branch 2 with values of 10000, and branch 3 with values of 100000 (or other sufficiently disparate values to prevent PK collisions?

3. How frequently can I merge the databases? Can it be done at different intervals with different tables? (I.e., there are a small number of tables in which updated values would be ideally propagated as soon as possible, while most of the tables are less critical. We sell tickets, so quantity-available is pretty important, whereas someone in one office hardly cares who purchased the tickets on a sale recorded in another office. This data we can wait for, but the counts are critical.)

Advice, etc. from those experienced in implementing replication would be most appreciated.

Thanks!

View 2 Replies View Related

6.5 Replication Questions HELP ME!!!

Mar 20, 2001

We have a subscription that is failing due to '24000[Microsoft][ODBC SQL Server Driver]Invalid cursor state'

My thought was to unsubscribe and subscribe again synching the tables.
HOWEVER, I have been told that I cannot drop the table in question
and have been asked to truncate instead.
There are over 25 subscriptions to this article, so I am unable to
modify the actual article.
I started playing in the pubs database to see if I can do it before
I messed with production...

I thought if I just change the .sch script located in the repldata direcotry to truncate table instead of create table, that would be it...
However the drop table command seems to come before it even reaches
that script, cause the error I get now is 'S0002[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot truncate table 'authors', because this table does not exist in database 'pubs'.'

My question is - when and where does the "drop table" command get executed
and can I modify it without effecting the other subscriptions?

I checked the sysarticles and the column that says del_cmd is Null....

PLEASE HELP....

View 1 Replies View Related

Replication Questions???

Mar 31, 2006

Hi,

I'm having a headache with the following questions weavering around...Hope that someone can help me with the answers.

1) I've implemented a immediate updating transactional replication on 2 servers. The loopback detection is also set to true. Under normal circumstances, when there is an transaction at the subscriber, it should be replicated to the publisher. However, this was not the case here. There were some transaction in the subscriber, but they were not replicated to the publisher. Is it because of the "loopback detection" option?

2) If a bi-directional transaction is to be implemented as according to the BOL, there will be 2 distributors. When a publisher has a transaction, it will be replicated to the subscriber. When the subscriber commit the transaction, will the transaction be sent back to the publisher's distribution database? or will the distribution agent at the subscriber will know that it originated from the publisher and will not sent it to the publisher?



Pls pardon my long msg. Any advice is welcome.

View 3 Replies View Related

Replication--Too Many Questions---Too Little Solutions

Dec 15, 1998

1) Do I have to install publishing on both servers (A and B) even though one will be publisher and the other will be subscriber.

View 1 Replies View Related

Replication--Too Many Questions---Too Little Solutions

Dec 15, 1998

1) Do I have to install publishing on both servers (A and B) even
though one will be publisher and the other will be subscriber.


2)a. Can named pipes be used for communication between these two servers
which are on the same domain but not on the same network. Why or why
not, whatever the answer may be?
b. If I use TCP/IP, it the connection set up using the client
configuration utility? How is the connection string set up in this
case?
c. Suppose the publishing server was not using Net-Beui. Could this pose
any problems for communication. (is using lmhosts sufficient in this
scenario)


3) I have set up a (remote) SQL Server to be a Publisher/ Distributor.
Both SQL servers have been configured to be remote servers relative to
each other. Following are the steps I have carried out to set up
replication:

______On the Publication Server (a remote server)
I went to Server --> Replication Configuration ---> Install Publishing

Next, I chose a local distribution server. I think that the
instdis.sql script ran fine because the distribution database was
installed successfully.

___Next, I went into Manage Publications from Server menu to set up
the publications.


_____________When I went the subscription server to subscribe to the
published articles, I got the following error message:


Error 14093: [SQL Server] You must be System Administrator (SA)
or Database Owner (dbo) or Replication Subscriber (repl_subscriber)
to execute the stored procedure.




PS
Please Help

View 1 Replies View Related

MSSQL Replication Questions

Feb 16, 2007

Hello, I am playing around with the replication feature within mssql.

The system that I am developing requires a master database at a remote location, possibly at a data centre and have a onsite database. The idea of having a local database is that the system can be running in the event of no internet connection and all the local databases update the master server and the master server updating all the local databases so they all have the same data.

I have some questions.

1. I create a publication on the master server and setup a subscription on a local database; does information only go 1 way? Or do I need to setup a publication on the local database and setup a subscription on the master server for data to go both ways?

2. What is the best type of replication for information on all databases to be up-to-date with each other, Merge?

3. Is there any limitations with the replication feature that I need to be aware of?

4. Is there anything that I need to keep in mind when I set this up?

5. How much bandwidth does replication take up, I know there are a lot of factors involved when trying to calculate this type of thing but a good idea would be good.

Thank you for all your replies.

*edit* I am testing with 2 copies of mssql enterprise trial

View 2 Replies View Related

Merge Replication Questions

Oct 27, 2005

1. When intitializing a new subscriber, data that is on the publisher is not being transferred to the new subscriber. Why?

2. Data that is already on the subscriber is not being uploaded to the publisher. Why?

3. When I perform a data validation, the validation fails, but there is no option to resolve the failure (ie, transfer data one way or the other). Why?

4. For the conflict resolver: I have a rowguid and a timestamp column on each article in the publication. It was my hope that by having the timestamp, I could avoid the need to manually reconcile the conflicts between publisher and subscriber. However, I see that the conflicts are still there and still require manual intervention to eliminate. Why?

5. Where is there additional documentation on the conflict resolver (such as what values to enter in the field "Enter information needed by the resolver")?

6. What is a "Local Subscriber"? As in the statement "Use the default merge resolver and create local Subscribers." as described in the "Choosing a Resolver" topic in SQL BOL.

7. What is a "Global Subscriber"? Same reference.

Sorry for all the ignorance. Replication is relatively new to me.


Regards,

hmscott

View 1 Replies View Related

Help With This Replication Questions SQL Mobile

Mar 10, 2008


This customer has an SFA application. They are using NET CF 2.0 SP2, SQL Mobile and Merge Replication with SQL Server 2005. The device they are using are Symbol MC7094. It has integrated phone and is a Windows Mobile 5 Aku 3.

They have set up 5 differents publications for this applications. His business case makes them to have 1 publication to recreate all database structure and the first population of the tables.

For this they use AddSubscription .. Syncronize and the DropSubscription

They use the another 4 publications to sync particular tables because they don€™t want to sync everything, every time. All publications point to the same snapshot.

Each time they want to use one of this publication they instance the SqlceReplication object, then AddSuscription.. Synchronize .. then DropSubscription..

They have one of this publications that use a filter 1=0. Doing the previous steps SQLCE doesn€™t track the change and doesn€™t upload the data of the sql ce table to the server. It seems SQL Server recognize it as a new Sincronization, delete the records of the client and doesn€™t upload the changes (if I don€™t do the DropSubscription it works perfect) I can reproduce that using a device or an emulator.

They have 100 devices via GPRS - VPN. They need to be assure that this Add / DropSubscription will assure they don€™t lose the information. They want to assure all the process of sync is fine just to go to the carrier and make some GPRS connection monitor and test.

How is the best way to approach where the NET CF application needs to use more than one publication to the same database? I have suggested to put all the transactional tables in the same publication but due the business case it is not possible. What are the risks to use many publications?

Another question€¦ each X hours they do a full sync using the first subscription the application returns the next message: The snapshot for this publication has become obsolete. Why this happens? Due the changes in the another publications? How could we manage that to avoid this message? Note: All the test were doing via cradle and GPRS with the same results.

View 3 Replies View Related

SQL Server - Transactional Replication Questions

Sep 5, 2005

Our database has grown to the point where our current server is struggeling with the query load. One option is to get a 4 processor machine with 16GB of RAM, but I'm also looking at transactional replication as a solution. Currently we run dual Xeon with 4GB of ram (using the /3GB switch in the OS) We have SQL 2000 Enterprise.
The idea is to setup a secondary server with transactional replication pushed from the main server, so that some SELECT-only queries can be executed on the secondary server - thus taking load of the main one. We should be able to add PKs to the small number of tables that currently don't have them, and we should be able to run all updates / inserts on the main server.I'll setup a push-subscription for the entire DB (maybe excluding some log tables) and then for ceratain stored procedures I'll direct our applications to use the backup instead of the main server.
So: Is this a good idea? Is it easy to backup the server using transactional replication? How much extra overhead will this mean for the main server?

View 1 Replies View Related

Database Mirror + Snapshot + Replication Questions

Aug 28, 2007

All,

We have SQL 2005 db mirror configured with a witness server for high availability. Node 1 is the principal and Node 2 is the mirror. A nightly job creates a snapshot on Node 2. The snapshot is used for previous day reporting queries. We have now been asked to present another copy of the database for near-time reporting. I thought about possibly adding a peer-to-peer replication as part of my environment but was hoping to see what everyone else out there is doing.

Regards,

Ian

View 1 Replies View Related

Merge Replication Questions [SQL2k5 Non Express]

Jun 1, 2006

I can choose synchronization direction for articles: a) Bidirectional b) one way

1) Is that possible somehow to replicate the schema only of an article but no synchronization / zero direction :-)/

2) Same question about columns, I should replicate schema only for few columns, but without data synch. These columns are freely updateable at anywhere (publisher and subscribers), but the data changes shouldn't be replicated.

Thanks for the answers in advance

View 6 Replies View Related

SQL Replication Questions - Http://defaultwebsite/test/sqlcesa30.dll

Jul 17, 2007

Hi,



I am seeing an unusual pop up when I try to hit the Website directory. I have setup replication setup for mobile units on IIS 6.0. When I try to hit the - http://defaultwebsite/test/sqlcesa30.dll - it tells me to open, save for cancel the sqlcesa30.dll file. This is weird. I have not seen this before.



When I hit the path from a internet browser - http://defaultwebsite/test/sqlcesa30.dll - it should come back with something like SQL Mobile Agent 3.0.



Any thoughts,



P

View 1 Replies View Related

Mirroring, Snapshot Replication, Load Balancing And Other BIG Questions

Mar 22, 2006

You will all have to excuse my ignorance. I'm a developer who also doubles up as a development DBA. I am however not particularly knowedgeable about all the really important DBA stuff.

We've built a small BI solution using SQL Server 2000. Our problem is that our server is getting on in years (5) and doesn't really have enough disk space or grunt. We havce a number of summary cubes that we've optimised quite successfully but our billing line level cubes run to 60 million rows and, well, they're about as quick as a dead ferret. Especially given the stupid queries our data analysts keep running.

We have however proved our point. That this can be done and indeed SQL Server can do it. So we're now looking at some infrastructure spend and some new copies of SQL2005.

But i need some advice. Our user base is climbing through the roof, we originally had 10, now we have closer to 50 and at this rate it'll be a couple of hundred by the end of the year. We're using a plugin called XLCubed to deliver that data into Excel from the Analysis Server.

The OLTP database that sits behind it is fairly robust but we have a number of web based apps (mostly lookup systems) that want to use the nice shiny new accurate tables of data we have created.

So I'm looking at a fairly big server to hold the OLTP DB, this will also serve up live data to our web apps. Its worth pointing out that the source data system is a batch system that processes overnight so we load data from yesterday at 6pm each evening and process our cubes and stuff overnight. Thus the data is a couple of days out of date. Don't laugh they used to use MS Access and got one mangy data set a month so this is a massive leap forward.

I wanted to mirror the DB to another machine but I also want to have a separate Cube Server. I wondered if the cube server could use the mirror to read its data from as opposed to loading the Main Server (the mirror would be an identical box) we would also have a separate box running some of our other systems acting as the witness.

I also wonderd about exporting the Cubes onto file shares for use locally as opposed to via the server which is how they connect now.

We have been using Reporting Services and some of the queries the devs write are not exactly efficient. So I was also planning on clustering a pair of smaller servers into a reporting farm. Could I use another SQL Server to serve data up to them? Could I use a DB snapshot to copy the data required to this server? What are the time / size implications of using a snapshot and replicating it over each night?

Any suggestions for places to read up on this? I've looked at the MS marketing blurb and while its big on buzzwords its light on specifics. Like how it actually works and how you would actually configure it to do some of this and what the implications would be.

Any advice?



many thanks


Steve



View 4 Replies View Related

Peer-to-peer Replication Questions

Dec 20, 2006

Our current setup is as follows:

serverA - DB1, DB2

ServerB - DB3

ServerC - DB4, DB5

Question 1: In peer-to-peer, is this the right setup?

ServerA - DB1, DB2, DB3, DB4, DB5

ServerB - DB1, DB2, DB3, DB4, DB5

ServerC - DB1, DB2, DB3, DB4, DB5

Question 2: Are we backing up all DBs or just DB1?

Question 3: When serverA.DB1 goes down, does it affect the other DB1s?

Question 4: Can any of the DBs publish to any server say a reporting_serverG that is outside the peer-to-peer topology.

Question 5: Is it best to have .mdf, .ldf, tempdb, etc. on local drive or in the SAN?

Question 6: What is the recommended NLB hardware needed to handle peer-to-peer?

View 4 Replies View Related

Newbie-DELETE A Record In A Table A That Is Related To Table B, And Table B Related To Table A

Mar 20, 2008

Hi thanks for looking at my question

Using sqlServer management studio 2005

My Tables are something like this:

--Table 1 "Employee"
CREATE TABLE [MyCompany].[Employee](
[EmployeeGID] [int] IDENTITY(1,1) NOT NULL,
[BranchFID] [int] NOT NULL,
[FirstName] [varchar](50) NOT NULL,
[MiddleName] [varchar](50) NOT NULL,
[LastName] [varchar](50) NOT NULL,
CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED
(
[EmployeeGID]
)
GO
ALTER TABLE [MyCompany].[Employee]
WITH CHECK ADD CONSTRAINT [FK_Employee_BranchFID]
FOREIGN KEY([BranchFID])
REFERENCES [myCompany].[Branch] ([BranchGID])
GO
ALTER TABLE [MyCompany].[Employee] CHECK CONSTRAINT [FK_Employee_BranchFID]

-- Table 2 "Branch"
CREATE TABLE [Mycompany].[Branch](
[BranchGID] [int] IDENTITY(1,1) NOT NULL,
[BranchName] [varchar](50) NOT NULL,
[City] [varchar](50) NOT NULL,
[ManagerFID] [int] NOT NULL,
CONSTRAINT [PK_Branch] PRIMARY KEY CLUSTERED
(
[BranchGID]
)
GO
ALTER TABLE [MyCompany].[Branch]
WITH CHECK ADD CONSTRAINT [FK_Branch_ManagerFID]
FOREIGN KEY([ManagerFID])
REFERENCES [MyCompany].[Employee] ([EmployeeGID])
GO
ALTER TABLE [MyCompany].[Branch]
CHECK CONSTRAINT [FK_Branch_ManagerFID]

--Foreign IDs = FID
--generated IDs = GID
Then I try a simple single row DELETE

DELETE FROM MyCompany.Employee
WHERE EmployeeGID= 39

Well this might look like a very basic error:
I get this Error after trying to delete something from Table €œEmployee€?


The DELETE statement conflicted with the
REFERENCE constraint "FK_Branch_ManagerFID".
The conflict occurred in database "MyDatabase",
table "myCompany.Branch", column 'ManagerFID'.

Yes what I€™ve been doing is to deactivate the foreign key constraint, in both tables when performing these kinds of operations, same thing if I try to delete a €œBranch€? entry, basically each entry in €œbranch€? and €œEmployee€? is child of each other which makes things more complicated.

My question is, is there a simple way to overcome this obstacle without having to deactivate the foreign key constraints every time or a good way to prevent this from happening in the first place? Is this when I have to use €œON DELETE CASCADE€? or something?

Thanks

View 8 Replies View Related

SQL License Questions And Other Questions &&>&&>&&>&&>

Mar 3, 2006

1.    Is it legal  and OK to use a MSDN SQL copy on a production environment or is it strickly for test environments ??

2.   If I own a legal copy of SQL 7 with 5 cals, can I legally use SQL MSDE and have more than 5 people access my SQL server or am I also limited to 5 users as my original ??

 Sorry I am a newbie at this SQL thing.

View 1 Replies View Related

Need Help Related To MDX Please

Nov 23, 2004

Hi,

Is there a format function in MDX which will help me solve the following
scenario:

One of my measures is Net Sales and I have tried all different formats
in Analysis Services so that it shows without the decimal places i.e.
instead of showing the Net Sales for any selected combination of
Dimensions as 123,456.04, I want to show it as 123,456

When I browse the cube (in Analysis Services), I can meet my
requirement. However, in my front-end (Microsoft Data Analyzer), I am
still getting it as 123,456.04 (even when the same in Analysis services,
i.e. when I browse the cube, is being shown as 123,456).

I do not have much choice at the moment and am stuck with Microsoft Data
Analyzer and unfortunately have not been able to solve this :(

Can someone think of a solution/workaround/use of MDX which will help me
get the results being displayed without the decimal. Is there a format function that I can use in MDX and how to use it???

Many TIA

View 2 Replies View Related

MS-SQL Related

Aug 5, 2006

Hello,What is uniqueidentifier as a data type?Also what is the data type for setting unique STRINGS ((nchar,nvarchar), for example to be used for emails and user names in a userregistration system).SQL Server does not allow me set primary keys for columns where datatypes are not INT.Thanks in advance.

View 3 Replies View Related

This Seems Messy To Me... [OOP-related]

Nov 20, 2006

I've been working on a performance review web application (i.e., employee's annual reviews done via the web). In the process of creating the application I've been teaching myself .NET - maybe not the best way to do it but I've been learning a lot. However, I still feel like I'm not doing something right.On each Page_Load I'm doing database work with a data reader: Reading the data in, displaying it, letting the user add, edit, or delete it, etc. So every Page_Load code behind looks like this: string sql = "SELECT UserID, Passwd, RecID, Name FROM UserList";

SqlConnection myConn = new SqlConnection("Server=BART; Database=WSSD; User ID=sa; Password=wss1231");
SqlCommand cmd = new SqlCommand(sql, myConn);
SqlDataReader dr;

myConn.Open();
dr = cmd.ExecuteReader(); And so forth and so on. Now since I re-use this code again and again - I imagine it's a good idea to implement my connection code in a class that I can re-use easily. But I have no idea where to start on something like that. What can I say? I'm a newb. A push in the right direction would be great.

View 8 Replies View Related

Getting Exactly 1 Row From Related Table

Jan 5, 2008

I have the following tablestblUserdatausercode username firstname lastname5 peter peter smith11 john433 john doe15 simonsays Simon SmithtblEventsID postedbycode title eventtext createdate1 5 woodstock 'oldies'  12/12/20082 11 love parade 'dance all night 1/1/20083 11 spring break 'great party' 2/2/2006tblEventVisitorsusercode eventid5   15   311  111 211 3As you can see User John433 is going to 3 events.But I only want to select the one that has the first upcoming startdate bigger than now: getdate()Desired output would be:username firstname lastname eventid title eventtext eventdatepeter Peter Smith 1 woodstock 'oldies'  12/12/2008john433 john doe 2 love parade 'dance all night 1/1/2008simonsays Simon Smith NULL NULL NULL NULLHow can I make such a selection? (perhaps see this thread for similar info: http://forums.asp.net/t/1201266.aspx)Thanks!

View 16 Replies View Related

Database Related..

Feb 12, 2008

I want to make simple database application but I want that I make just one transaction with the database..

If I have , say 10 insert queries, i want to transact with the database just once.

Somebody told me this could be done by 'containers' or 'data transfer objects'

So please, somebody help..

View 1 Replies View Related

DTS Related Question

Mar 10, 2005

Hi,

I made a DTS which appends data coming infrom a view to an exisiting table.So far no problem and all goes well.

I am facing a problem due to the format of the date that is coming in (getting appended) and while going through BOL, came across the following topic:

mk:@MSITStore:C:Program%20FilesMicrosoft%20SQL%2 0Server80ToolsBookshowtosql.chm::/ht_dts_trns_97ou.htm

I tired the above tips but it appears that if I try to do this in my DTS (which appends data),the logic of the DTS will change. A single arrow also gets added whichI think represents a simple mapping/transformation rather than a append. To clarify my point, please note the attached image which represents that the data is being appended (due to the many sided arrows pointing to the source and destination - visible under the Transformations tab of my DTS).

Sincerely hoping that my post is clear, can someone help me find how to make changes in a DTS (which appends data) and ensuring that thelogic remains the same i.e. it should append data.

Many TIA

View 4 Replies View Related

Hello Everyone, Urgently Need Help Related To UDF

Jul 24, 2007

I have a function written in postgresql that I want to create in sql server (UDF). After effort of full day I am seding this request to please help me, here is the function:

CREATE OR REPLACE FUNCTION fn_comma_env(int4)
RETURNS text AS
$BODY$
DECLARE
rec record;
str text;
comstr text;
BEGIN
str := '';
comstr := '';
FOR rec IN SELECT class.classname FROM hostenv, class WHERE hostenv.classid = class.classid AND (hostenv.hostid = $1) LOOP
str := str || comstr || rec.classname;
comstr := ',';
END LOOP;
RETURN str;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;

Thanks in advance,
Syed

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved