SQL CE 3.1 Connection String And Some Other Basic Stuff

Oct 9, 2007

Since I couldnt find an easy way to connect Orcas Beta 2 with SQL CE 3.1

I'll try by a connection string

since im totally new at this
does anyone have any idea how to get started?

Thxs!

View 4 Replies


ADVERTISEMENT

Basic Connection String

Mar 31, 2006

Could someone please show me a basic connection string, please?

View 6 Replies View Related

Using Stuff To Return A String Of Values From A Column Without A Cursor

Dec 13, 2007

I think it was Pat Phelan who posted a little trick here where he used the STUFF function to create a string fo values from a column without using a cursor.

I am starting a brand new project and I did my table design and I am awaiting a finalized requirements document to start coding and I thought I would spend a little time writing some code to autogenerate some generic one record at a time SELECT, INSERT,UPDATE and DELETE stored procedures. With the coming holiday things are getting quiet around here.

The code that is not working is listed below. It does not work. It returns Null. I suck.

DECLARE @column_names varchar(8000)

SET @column_names = ''

SELECT @column_names = STUFF(@column_names,LEN(@column_names),0,C.COLUMN_ NAME + ', ')
FROM INFORMATION_SCHEMA.COLUMNS C
WHERE TABLE_NAME = 'MyTable'

SELECT @column_names

little help?

View 6 Replies View Related

Cannot Set Connection Property Of Backup Database Task If Connection String Is Customized In Connection Object

Aug 23, 2006

I added a connection (ADO.NET) object by name testCon in the connection manager - I wanted to programmatically supply the connection string. So I used the "Expressions" property of the connection object and set the connectionstring to one DTS variable. The idea is to supply the connection string value to the variable - so that the connection object uses my connection string.

Then I added a "Backup Database Task" to my package with the name BkpTask. Now whenever I try to set the connection property of BkpTask to the testCon connection object, by typing testCon, it automatically gets cleared. I am not able to set the connection value.

Then after spending several hours I found that this is because I have customized the connection string in testCon. If I don't customize the connection string, I am able to enter the "testCon" value in the connection property of the BkpTask.

Is this an intrinsic issue?

View 2 Replies View Related

Basic SQL Connection

Mar 5, 2007

   Hi all, having trouble with my first sql communication. I've got hosted service with an SQL database i've populated with a row.
 When it gets to the third line the page crashes with an error.
         SqlConnection connection = new SqlConnection("Server=mydbserver.com;Database=db198704784;");// +"Integrated Security=True");        SqlCommand cmd = new SqlCommand("SELECT UserName FROM Users",connection);        SqlDataReader reader = cmd.ExecuteReader();
 
is there somewhere i need to put in my username or password? or is this code just wrong
 
Many thanks burnside. 
 
-- Edited by longhorn2005

View 7 Replies View Related

Visual Basic With SQL-database Connection And Windows XP

Dec 21, 2005

When you work with Visual Basic 2005 Express Edition on windows XP, and if your application contains references to SQL-databases, I have discovered that it is important that all identities be logged off before you open the particular identity where you want to work on your Visual Basic project. I have earlier assumed that it was only possible to work with Visual Basic on one identity, the one where the version was registered.
 
This assumption was not quite correct. Actually, you may run Visual Basic applications with SQL-references on all identities on XP, provided that no other identities that are using the SQL-server are currently running.
 
For example, suppose you start your computer and log on the identity James. Then you switch identity, but you actually don't log off James. Then you log on the John identity. There you discover that it is impossible to create a new SQL-database in Visual Basic's Data-connections view. An error message appears. Why is that? It is because the SQL-server is busy on the James-identity. To solve this problem you want to log off the John identity, don't just switch. Then log on the James identity again, and log off properly. All identities should now be logged off. Now you may log on the John identity again, and it is now possible to create an SQL database.
 
Concerning deploying applications for XP. This issue is similar to the one I just described. You cannot run the installation-file successfully on one identity if the SQL-sever is busy on another identity. You want to log off all identities before logging on the identity where you want to install the application. Same thing when you want to run the deployed application.
 
Question. Does this limitation exist only in the express-editions of Visual Studio 2005 as a drag on free-ware, or is it prevalent in commercial editions as well?  I would like to know a little more about this before purchasing the standard or professional edition of Visual Studio 2005.
 
Best Regards
Ziper

View 7 Replies View Related

The Connection Name 'LocalSqlServer' Was Not Found In The Applications Configuration Or The Connection String Is Empty.

Sep 27, 2007

Hi,
I'm having a BIG problem, this is my 3rd day looking for answer !I'm trying to create a custom membership provider with MS SQL database 2005 but not the default ASPNETDB. I've changed the web.config to be as following:<connectionStrings><add name="sqlConn" connectionString="Data Source=.;Integrated Security=True;Initial Catalog=ASPNETDB;"providerName="System.Data.SqlClient" /></connectionStrings> <system.web><trace enabled="true" /><roleManager enabled="true" /><authentication mode="Forms" />
<membership defaultProvider="MySqlProvider"><providers><remove name="AspNetSqlProvider"/><add name="MySqlProvider" connectionStringName="SqlConn" type="System.Web.Security.SqlMembershipProvider" applicationName="/" /></providers></membership>
But when I try to login to the site using the login control the following error occurs:
Server Error in '/etest' Application.


Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.Source Error:



Line 149: <roleManager>
Line 150: <providers>
Line 151: <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 152: <add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 153: </providers>Source File: C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Configmachine.config    Line: 151


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.213
 It is clear that this is a prblem with my Machine.Config file - since I've "worked!" on this file for a while. But when I've checked the Machine.config file I've found the LocalSqlServer connection it is talking about! .
I'm lost and I dunno what to do, can anyone help?
Here is the mahine.config in case if you need it:<connectionStrings>
<add name="LocalSqlServer" connectionString="data source=.;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" /></connectionStrings>
<system.data><DbProviderFactories>
<add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /><add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /><add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /></DbProviderFactories>
</system.data><system.web>
<processModel autoConfig="true" /><httpHandlers />
<membership><providers>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" /></providers>
</membership><profile>
<providers><add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers></profile>
<roleManager><providers>
<add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /><add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers></roleManager>
</system.web>

View 8 Replies View Related

Data Access :: JDBC Connection Is Not Using Username Passed In Connection String

Sep 16, 2015

I am using sqljdbc41.jar to connect with MSSQL database, it is working fine on my local machine.Where as on the remote server, same class giving me error

Login failed for user '<domain><windows loginID>'
My connection string is URL...

I am using sqljdbc41.jar  and on 64 bit processor , I am using following command which included path for sqljdbc_auth.dll java -Djava.library.path= C: sqljdbc_4.1enuauthx64 TestDao and error is Login failed for user '<domain><windows loginID>' why it is not picking up username passed in connection string. I have 2 machines, one is local and other is remote. on both machine I login using my domain, it is working absolutely fine on local then why the error is coming on remote machine.Both the machines are identical.

View 4 Replies View Related

The Connection Name 'name' Was Not Found In The Applications Configuration Or The Connection String Is Empty

Jan 18, 2008

I have been trying to host my website on Go Daddy for about 3 weeks and I have cleared several problems but this one remains. I can get into the ASPNETDB database for doing logins , etc but I cant access my database called "PINEmgt".
To try to understand where the problem is located,I built a very simple application without login controls and put on it one Detailform accessing a single line table "Signin". I continually get the error message I got with my real app :"The connection name 'PINEMgtConnectionString2' was not found in the applications configuration or the connection string is empty. " There is only one connection string in my app -'PINEMgtConnectionString2'. When I run the app locally on my machine it works. After I move everything to Go Daddy, I get the error message and the following dump"





Line 24: </Fields>
Line 25: </aspetailsView>
Line 26: <aspqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStringsINEMgtConnectionString2 %>"
Line 27: InsertCommand="INSERT INTO Signup(first_name, last_name, email, customer_id) VALUES (,,,)"
Line 28: SelectCommand="SELECT * FROM [Signup]"></aspqlDataSource>

This is indeed the code from my single page app.

The dump is:




[InvalidOperationException: The connection name 'PINEMgtConnectionString2' was not found in the applications configuration or the connection string is empty.]
System.Web.Compilation.ConnectionStringsExpressionBuilder.GetConnectionString(String connectionStringName) +3039085
ASP.default_aspx.__BuildControlSqlDataSource1() in d:hostinguck7scoutDefault.aspx:26
ASP.default_aspx.__BuildControlform1() in d:hostinguck7scoutDefault.aspx:10
ASP.default_aspx.__BuildControlTree(default_aspx __ctrl) in d:hostinguck7scoutDefault.aspx:1
ASP.default_aspx.FrameworkInitialize() in d:hostinguck7scoutDefault.aspx.vb:912306
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +40
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) +29
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


After Googleing, asking Go Daddy for info (which they dont give) , etc for three weeks, I need serious mental help
in the form of a solution of this problem. Your help with the problem or the name of a good mental health professional in eastern N.C. (maybe both) would be appreciated.

View 10 Replies View Related

The Connection Name 'name' Was Not Found In The Applications Configuration Or The Connection String Is Empty

May 30, 2008



I have seen another thread with this same problem, but the problem seemed to be a typo. I am getting an error when I try to access the web site ..


The connection name 'USASH-AS0013' was not found in the applications configuration or the connection string is empty.

However, in my web.config file I do have a connection named USASH-AS0013. Here is my web.config file (with my user/pwd hidden). Any help would be greatly appreciated.



<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
WindowsMicrosoft.NetFrameworkv2.xConfig
-->
<configuration>
<appSettings/>
<connectionStrings>
<add name="USASH-AS0013" connectionString="Provider=SQLOLEDB;Data Source=USASH-AS0013;User ID=****;Password=*****;Initial Catalog=&quot;Smart Factory&quot;"
providerName="System.Data.OleDb" />
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.

Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<compilation debug="true" strict="false" explicit="true"/>
<pages theme="MySkin" >
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
</pages>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>

View 3 Replies View Related

SQL Server 2008 :: Connection Manager Not Using Connection String Value

Feb 19, 2015

I have a child package where the ConnectionString property of a Connection Manager is set by a Parent Package Variable Configuration. I set up a script task that brings up a message box with the value of the ConnectionString property right before the dataflow task.

MessageBox.Show(Dts.Connections["CPU_*"].ConnectionString.ToString());When I run the parent package, the message box shows that the connection string is changing with every iteration, but in the dataflow it always draws the data from the same source.

The connection manager is an ADO.Net type, RetainSameConnection is set to False, and I've been researching this for days.

(Update 2/23/2015): To make this stranger, when I look at the diagnostic logs, they tell me that when the new connections are being opened they are using the new connection strings.

View 2 Replies View Related

Cannot Set Connection String For Bulk Insert Source Connection

Jan 4, 2006

I came across something strange today. I was wondering I was doing something wrong.

View 7 Replies View Related

Edit Connection Manager Connection String At Runtime With C#

Jul 3, 2007

This is the first time I have used SSIS, so please bear with the ignorance.



I have a super simple package that inserts x000's of rows into a temporary table. The data source is a file that the user will upload. I need to be able to tell the package what file to upload. I'm thinking the simplest thing would be to edit the connectionString property of the SourceConnectionFlatFile at runtime. Is this possible? What form should the file path be in (UNC, other)? And, are there any other considerations I should be aware of?



Thanks!

View 1 Replies View Related

Variable Connection String For OLE DB Connection

May 15, 2007

Good Morning,



I hope that I am just missing a step in the process somewhere. I have established a string variable called DatabaseServer and another called DatabaseName. In the OLE DB connectionstring expression I have the following:




Code Snippet

"Data Source=" + @[User::DatabaseServer] + ";Initial Catalog=" + @[User::DatabaseName] + ";Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;"



My understanding is that changing the variable from SERVERA to SERVERB should repoint the connection. (Test to pre-production to production in my current promotion environment.) This should also take effect in any dataflow task using the database connection above right? When I try to repoint the server variable (and only the server variable) I am either a.)throwing errors saying the original connection cannot be found in the data flow task, or b.)the job appears to be processing fine, but the repoint did not take place and data is still flowing to the original server.



Can anyone offer suggestions as to what I am missing?



The properties values in the DB connection:

ConnectionManagerType is OLEDB

DataSourceID is blank

DelayValidation is False (Setting to true changes nothing in my test)

Expression for ConnectionString is (see above)

RetainSameConnection is False

SupportsDTCTTransactions is True (and appears to be unchangeable.)

View 7 Replies View Related

AWE, /3gb And /pae Stuff

Jul 4, 2007

Hi all,



I'm running under Windows Server 2000 datacenter sp4 with sql server 2000 Sp4

on 16GB Ram.



I enabled the /PAE in the boot.ini file and also enabled the AWE and set the SLQ Server maximum memory to 6144.



Do I need to include the /3GB switch in the boot.ini file?



I'm a little bit confused with the article found on the site. http://support.microsoft.com/default.aspx/kb/274750

Here are the lines.

Use of the /PAE switch in the Boot.ini and the AWE enable option in SQL Server allows SQL Server 2000 to utilize more than 4 GB memory. Without the /PAE switch SQL Server can only utilize up to 3 GB of memory.
or-Use of the /3GB switch in the Boot.ini file allows SQL Server 2000 to use up to 3 GB of available memory.


Regards,

Larry

View 5 Replies View Related

Easy Stuff

Jul 1, 2004

hi.. guys this is simple for you guys how can i make ms access to display the current date in a col.... when i go to insert a new line i how can i make it so that its allready there? i dont have to type it??????

View 3 Replies View Related

Locale Stuff

Jan 25, 2005

Hi,

You might just be able to save me downloading and installing SQL Server French...

I'm having localization problems with some .NET code - and I might be able to solve the problem if I know how SQL is parsed in different locales. Say my table MyTable contains a float column FloatColumn. In English, I would say
SELECT * FROM MyTable WHERE FloatColumn = 2.3

If my locale was, say for argument's sake, French, would I have to write
SELECT * FROM MyTable WHERE FloatColumn = 2,3
???

Thanks for your help,
T

View 1 Replies View Related

Datetime And Other Stuff

Dec 12, 2005

Overview. Machine data is fed into DOWNTIMELOG via a Cimplicity. I do not have the ability to change the way that it goes in. It contains the time that a machine has stopped and where the stoppage has occurred. Via a web page I want to give the operator the amount of time the machine stopped. From that they will provide some more detail. As they enter time, I need to subtract what they entered from the total (DOWNTIMELOG). That is the reason I created ENTERED_TIME. [PDNTOTAL_TEMP_VAL0] hold the total time for each stoppage, [TOTTIME] is intended to hold the value that has been accounted for. [DWNCATEGORY_TEMP_VAL0] holds the category and matches up with [DWNCATEGORY]. Also, I need to match Date and Shift. The problem is that DOWNTIMELOG does not capture shift. However, 1st shift occurs between 700 and 1500, 2nd shift occurs between 1500 and 2300, 3rd shift occurs between 2300 and 700. 3rd shift presents a problem as it occurs across 2 dates. Could someone please help me with a query that provides the net between the two tables that is matched by date, shift and category?
CREATE TABLE [dbo].[DOWNTIMELOG] (
[timestamp] [datetime] NOT NULL ,
[DWNTIMESTAMP_VAL0] [varchar] (25) NULL ,
[UPTIMESTAMP_VAL0] [varchar] (25) NULL ,
[PDNHOUR_VAL0] [int] NULL ,
[PDNMIN_VAL0] [int] NULL ,
[PDNSEC_VAL0] [int] NULL ,
[PDNTOTAL_TEMP_VAL0] [int] NULL ,
[DWNMSG_TEMP_VAL0] [int] NULL ,
[DWNCATEGORY_TEMP_VAL0] [varchar] (50) NULL

CREATE TABLE [dbo].[ENTERED_TIME] (
[REC_ID] [int] IDENTITY (1, 1) NOT NULL ,
[DWNCATEGORY] [varchar] (50) NULL ,
[DWNMSG] [int] NULL ,
[ENTRYDATE] [smalldatetime] NULL ,
[SHIFT] [int] NULL ,
[TOTTIME] [int] NULL

View 4 Replies View Related

Sql Automated Task Stuff

Jan 14, 2008

Where can i learn about making the sql server execute task when a certain situation happens. Like lets say make the server delete all entrys older than 40 days? Or have a entry deleted automatically when a certain situation happens like lets say it take 4 votes and a entry get deleted how do i make it do that automatically

View 2 Replies View Related

T-SQL (SS2K8) :: Matching Value After Using STUFF

Aug 22, 2014

This is my code, table and result,

declare @t_JobNoticeID table (cvid int, JobNoticeID int)
insert into @t_JobNoticeID values(2456, 24);
insert into @t_JobNoticeID values(4000, 124);
insert into @t_JobNoticeID values(245, 9);
insert into @t_JobNoticeID values(2456, 19);
insert into @t_JobNoticeID values(4000, 904);
insert into @t_JobNoticeID values(4000, 11);
insert into @t_JobNoticeID values(24, 19);

[Code] ....

My question is -

How update statement looks like compare RESULT A1 with x_JobMatching?

So, my FINAL RESULT shown as follow,

CVIDJobNoticeIDisMatch
1925450
6590690
459130
2456191
4569110
40009041
24560
900240
24191

View 5 Replies View Related

CHARINDEX And STUFF/REPLACE

Jul 23, 2005

Hello,I need to be able to replace only the first occurance of a space characterin a column.Reason being is the data in the column I am trying to replace seems to haveumpteen space characters after each entry, so a simple replace functionwill replace all the spaces after it with what I want!I have thought of RTRIM to get rid of the spaces after and then replace, Ihave also thought of CHARINDEX to find the first occurance of a space andSTUFF to replace it.I have done my homework on these functions!But I am having trouble writing such a statement,I've never written a query which would use more then one function on onecolumn you see and I am getting confused!I'll tell you what I want to do in simple stepsReplace only the first found space in a name column, but then if a name hasa middle initial that will be a problem,Replace that with a dot.then concatanate '@emailaddress;@emailaddress2' after itso when SQLServer does the select it will bring back something likejoe.bloggs@emailaddress;emailaddressBut I guess I'd also need joe.n.bloggs@emailaddress;emailaddressThe data in the column looks like this at the momentjoe bloggsBut I guess there may come a time when we havejoe n bloggs, just to complicate things!What is your advice, and how do I write a query like thisI have been playing around with it in Query Analyser but as I said I amgetting confused and need some help if you don't mindThanks a lot to all who reply :-)RegardsJayne

View 2 Replies View Related

Why Does The Automatic Scripts That Are Generated Have So Much Stuff?

Dec 11, 2007

For example if I make a column not null the SQL Script generated.
Removes all indexes, keys, etc... than creates a temp tableThan moves the data into the temp tablethen deletes the old tablerenames the temp tableRecreate all the indexes, keys, etc...
Is there a structure reason for it? Like now that the DB is being alerted that the column is not null it wants to re insert all the data so it can re-organize it?
Because I can just write my own script to the effect of
ALTER [TABLE] [COLUMN] PARAM TYPE NOT NULLone line of script that seemingly does the exact same thing..
So I'm just curious when I change a column to non null why doesn't it just generate a simple one liner?

View 3 Replies View Related

Newbie - SQL Server Express And Other Stuff

Feb 16, 2008

Hi

View 1 Replies View Related

Use Stuff To Define Range Of Values?

Nov 13, 2014

I have this query that calculates the next possible shipping day, based on 3 conditions:

- It has to be a workingday (WORKTIMECONTROL: 1 workingday, 0 holiday) - marked green
- There might be extra days (@xdays) required by the process - marked blue
- Customer wants their goods to be shipped on special days - marked red:select TOP 1 Transdate
from WORKCALENDARDATE
where Transdate > @startday and WORKTIMECONTROL = 1 and DATEPART(WEEKDAY,TRANSDATE)-1 in (2,4) and

[code]...

So customer 123456 accepts shipping of goods only on tuesday and thursday as in the above example "... in (2,4)". Multiple shipping days means that the Subquery returns more than one record, which gives me a headache as I don't see how to integrate this portion into my query. I tried to use the stuff function as I formally need a result that can be provided that way; but the format is incorrect as it in varchar, while an array of integer is needed.

DATEPART(WEEKDAY,TRANSDATE)-1 in (select stuff((select ',' + CAST(DELIVERYDAY as nvarchar) from CollectiveShipment where custaccount = '123456'
for xml path('')),1,1,''))

View 2 Replies View Related

Separate Data Stuff From Applications

Jan 22, 2007



Hi,

This is probably for most of you a very basic question. My goal is to define in a seperate instance from application all infos related to DataSets and DataAdapters that are needed when connecting to a specific database. Why?

First, I would like to be able to have in a single instance everything needed when hooking to a SQL Server Express database and in an other everything needed when hooking to a SQL Server CE database. Then, from application, I would like to be able following a few basic configuration steps to choose from one or the other, or even both in specific cases.

Second, I want to be able to seperate Database related stuff from application so that I can re-use everything from any other application when needed.

I've read several books, articles on the subject and would like to have your opinion as several approaches were illustrated through them. What would you use for this:

- Component class?

- Class library?

- or else?

Any good articles on the subject?



Thanks in advance for sharing,

Stéphane

View 3 Replies View Related

Transact SQL :: Query Using Stuff Keyword

Jun 17, 2015

CREATE TABLE BILL_DETAIL
([objid] int,[x_billable_to] varchar(19), [x_bill_quantity] int,
     [x_billable_yn] int, [x_bill_rate] int,   [COST_TYPE] varchar(19) )
INSERT INTO BILL_DETAIL
([objid], [x_billable_to], [x_bill_quantity], [x_billable_yn], [x_bill_rate],[COST_TYPE])

[code]...

how to get records using stuff keyword as above i want to query using where condition with where objid=1 and should frame output as Parking, Toll only 1 input parameter need to given.

View 20 Replies View Related

Merge Replication - Weird Stuff

May 21, 2007

I'm implementing merge replication between SQL CE and sql server 2005 SP2. Here is the problem I'm facing



I have dynamic filters on some tables like

Select * from table1 inner join table2

ON table1.field1 = table2.field3

and table2.flag = true



When table2 flag turns true then all the matching records in table1 should be returned to the subscriber.



But that is not happening. The filter does not return any records to the subscriber even though i see records when i run the query on the server. My take on this is the publisher thinks there is no changes on table1 so there is nothing to update. So to fix that i run dummy updates like

update table1

set [name] = [name]

where table1.field1 in

(Select field2 from table2 where flag=true)



This updates the records and the publisher updates the subscriber the first time. When i set the flag to false, it is supposed to remove the data from the subscriber but i get this error.




The merge process failed because it detected a mismatch between the replication metadata of the two replicas, such that some changes could be lost leading to non-convergence. This could be due to the subscriber not having synchronized within the retention period, or because of one of the replicas being restored to a backup older than retention period, or because of the publisher performing more aggressive cleanup on articles of type download-only and articles with partition_options = 3. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199363)
Get help: http://help/MSSQL_REPL-2147199363

The common generation watermark is invalid at this replica since it does not exist or metadata for changes not yet propagated may have been cleaned up. (Source: MSSQLServer, Error number: 21800)
Get help: http://help/21800





I have no idea whats going on. Any clues, anyone? Thanks for your help.





Ramesh

View 13 Replies View Related

Renaming A Project... Some Minor Stuff

Apr 16, 2008

I have a project. Originally when I created this project, I called it "Project_A", (and I did not create a solution directory).

Doing this created a folder called "Project_A" with the following files within it. I guess these are meta data files and I shouldnt be messing around with them. Anyway, I see

(1) Package.dtsx (The default package that gets created with a new project)
(2) Project_A.database
(3) Project_A.dtproj
(4) Project_A.dtproj.user
(5) Project_A.sln
(6) Project_A.suo

When I rename my project in the Solution Explorer to "Project_B", the following happens in my folder.

Everything remains the same except Project_A.dtproj gets renamed to Project_B.dtproj and a new file called Project_B.dtproj.user gets created.

Now, my questions.

Question 1: What if I wanted my folder to have the same name as my project? Can I just change the folder name in Windows Explorer without having any ill-behaviors later on? I always have 1 project to 1 solution so I want to use the convention of keeping my folder named the same as my project.

Question 2: What about the files that are still named with Project_A dot blah blah. Is it bad if I renamed these to Project_B dot blah blah?



View 7 Replies View Related

VS Express Free For Good And Other Fun Stuff

Apr 19, 2006

A whole bunch of exciting new stuff announced around the Visual Studio Express Editions today. VS Express is now free for good, not just 1 year (just like SQL Server!). Also lots of great new content and fun projects to do.

See Dan Fernandez's blog posting at http://blogs.msdn.com/danielfe/archive/2006/04/19/579109.aspx for lots of details.

Best, MJ

View 1 Replies View Related

Partitioning Tables And Filegroup Stuff

Jan 17, 2007

Hi everyone,
 
Primary platform is 64-bit on A-P cluster.
 
Our needs are on yearly basis and on monthly basis. We're forced to keep up five years for the majority of the production tables.
In terms of years, I see three ways:
 
1.Create all the ranges for a FILEGROUP with a only NDF
 
2004, 2005, 2006 => FG1 =>  ONE.NDF
 
2.Create all the ranges for a FILEGROUP along with more than one NDF.
 
2004, 2005, 2006 => FG1 =>  ONE.NDF
                                                       TWO.NDF  
 
3.Create each range to a FILEGROUP where there will be  one NDF or  (n) NDF
 
2004 => FG0=> ZERO.NDF
2006 => FG1 => ONE.NDF
2005 => FG2 => TWO.NDF
 
What is the best approach in terms of availability, performance and best practices? Maybe is a silly question, I'm sorry if it is.
 
As usual, thanks a lot for your time.
 

View 3 Replies View Related

Please Help Me With The Connection String In Asp.net

Jul 19, 2006

Hi,
I need your help!!!!!!!!!!
Ii'm running the application using the sql SDK version , i'm having trouble openning the connection. my connection string is:
strConnect="data source=DEFAULT_WINXP\VSDOTNET;initial catalog=try1;integrated security=SSPI;persist security info=True;workstation id=DEFAULT_WINXP;packet size=4096";
and i get an exception: Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'DEFAULT_WINXPASPNET'.
this is my code:
 
string strConnect;
SqlConnection objConnect;
SqlCommand objCommand;
SqlDataAdapter objDatatAdapter;
DataSet objDataSet;
strConnect="data source=DEFAULT_WINXP\VSDOTNET;initial catalog=try1;integrated security=SSPI;persist security info=True;workstation id=DEFAULT_WINXP;packet size=4096";
objConnect = new SqlConnection(strConnect);
objCommand=new SqlCommand();
objDatatAdapter = new SqlDataAdapter();
objDataSet=new DataSet();
objConnect.Open();
objCommand.Connection = objConnect;
objCommand.CommandType = CommandType.Text;
objDatatAdapter.SelectCommand = objCommand;
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'DEFAULT_WINXPASPNET'.Source Error:



Line 166:objDatatAdapter = new SqlDataAdapter();
Line 167:objDataSet=new DataSet();
Line 168:objConnect.Open();
Line 169:objCommand.Connection = objConnect;
Line 170:objCommand

View 5 Replies View Related

Connection String In ASP.NEt

Jul 21, 2006

Hi
 
I'm using  VB.NET in ASP.NET . 
 
Windows 2000
 
Visual Studio 2005
 
and SQLServer 2005.
 
I'm new to VS 2005
I'm using the following code for connection
<add key="dsnstring" value="persist Security info=False; User ID=; password=;Initial Catalog=TransMate1; Data Source=Localhost trusted_connection=yes" />
it is giving the error as 'Cann't do the connection since user id cann't be null
It is not exact words of the error message.
following code is working fine with the SQL Server 2003 but not with SQL Server 2005.
<add key="dsnstring" value="persist Security info=False; User ID=sa; password=dreams;Initial Catalog=TransMate; Data Source=Localhost" />
 
Kindly help me
 
Thanks in advance
 
Regards.
 

View 1 Replies View Related

Connection String

Aug 8, 2006

I have made an app (the first one) and im trying to find the right connection string to the database. Im using sqlexpress on my local computer, and my host uses MSSQL, can anyone tell me what the connection string could

View 1 Replies View Related







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