|
Hello,
I want to alter a column in a table. The column is called GroupID and is the primary key in this table.
Currently the groupID is a auto incremented and a int datatype. Now I need to change this just to a int and not have the auto increment.
I am not sure of the syntax of how to do this. I know you can add and drop columns, but can you change from an auto increment to not a auto increment.
Many thanks for any syntax you can offer me.
Steve
|
|
|
|
|
|
The docs say this attribute must be applied to any assembly to allow it to be deployed to SQL Server, and that it is automatically added to AssemblyInfo.cs in SQL Server Projects.
I have a SQL Server project that I have just deployed to my SQL Server, and this attribute isn't applied to the assembly, and it wasn't added to AssemblyInfo.cs.
What is the story with this attribute?
|
|
|
|
|
Hi,
I am trying to import data from an Access database to SQL 2005 Express Edition. Express does not have an Import Export wizard. How can I get the data from a Access DB to SQL?
Thank you!
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
You could create a number of "Linked Tables" within MS-Access that point to you SQL-Server instance - then use "INSERT INTO MyLinkedTable SELECT * FROM MyAccessTable" SQL queries to copy the data.
|
|
|
|
|
This also depend on if the destination database have the schema allready set up? Are they on the same computer? If you need to create the database, schema from the access db in code, you could import it into a datatable and then use SMO and sqlbulkcopy to create the destination schema and tranfser the data.
Click on my alias and take a look at the article and see if that might help. SMO is a little buggy as a coworker of mine has realized.
Let me know
AAron
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|
|
Hi All,
Iam new to ado.net
I want to know merge()method of dataset when we use this,
Wat is AcceptChanges() method of dataset when it is required.
Pls describe with sample example.
Thanks in Advance
|
|
|
|
|
Hello plz refer it.........
DataSet.Merge (DataRow[]) Merges an array of DataRow objects into the current DataSet.
DataSet.Merge (DataSet) Merges a specified DataSet and its schema into the current DataSet.
DataSet.Merge (DataTable) Merges a specified DataTable and its schema into the current DataSet.
DataSet.Merge (DataSet, Boolean) Merges a specified DataSet and its schema into the current DataSet, preserving or discarding any changes in this DataSet according to the given argument.
DataSet.Merge (DataRow[], Boolean, MissingSchemaAction) Merges an array of DataRow objects into the current DataSet, preserving or discarding changes in the DataSet and handling an incompatible schema according to the given arguments.
DataSet.Merge (DataSet, Boolean, MissingSchemaAction) Merges a specified DataSet and its schema with the current DataSet, preserving or discarding changes in the current DataSet and handling an incompatible schema according to the given arguments.
DataSet.Merge (DataTable, Boolean, MissingSchemaAction) Merges a specified DataTable and its schema into the current DataSet, preserving or discarding changes in the DataSet and handling an incompatible schema according to the given arguments
(2) AcceptChanges() Call when u sure u'r all statement exected succesfully, Otherwise use RejectChanges()
Parwej Back...............DON of Developer.......
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
Hi all,
This is the first time I set up an SQL database (I worked with mdb before), so please excuse me if I ask the most basic thing here .
Here is the situation. I am developing a VC++ program that connects to a local SQL Express 2005 database locally, this works fine. This is the connection string that I use:
Provider=SQLNCLI;Server=myComputerName\MYSQLEXPRESS;Database=myDatabase;Uid=myUsername;Pwd=myPassword;
Now when I set up this SQL Express 2005 on WinServer 2003 and ran the program, it worked as well. But when I ran the program from a client connected to the server, it wouldn't connect (the program crashed). Do I need to install "Microsoft SQL Server Native Client" on it as well? or do I need different connection string?
Could anyone please give me some pointers here. Thanks in advance.
|
|
|
|
|
first check if ur sqlserver2005 is enabled for remote . normally it is disabled. then change ur sonnection string..
Your Connection String
Provider=SQLNCLI;Server=myComputerName\MYSQLEXPRESS;Database=myDatabase;Uid=myUsernamewd=myPassword;
New Connection String
Provider=SQLNCLI;Server=myComputerName\MYSQLEXPRESS,1433;Database=myDatabase;Uid=myUsernamewd=myPassword;
The only change i have made is that, I have added a ,1433 in servername and i think u know what it is default remote port for accessing SQLSERVER 2005,
|
|
|
|
|
Would the connection string with 1433 work for local connection as well?
This way I can test it locally right now and I don't have to differentiate between local and remote connection strings
I am guessing that enabling remote connection is done thru Surface Area Configuration?
Thanks for your help.
|
|
|
|
|
I tested the new string (with ",1433) and got the error below:
Code = 800a0e7a
Code meaning = Unknown error 0x800A0E7A
Source = ADODB.Connection
Description = Provider cannot be found. It may not be properly installed.
I also have enabled remote connection thru tcp/ip (in surface area configuration).
Do I have to enabled named pipe as well?
What do I do now, please? Thanks for any input.
|
|
|
|
|
In addition to what blue_arc said here is a site with all of the connection strings for just most of the dBs out there http://www.connectionstrings.com/[^]
Joe Smith IX wrote: it wouldn't connect (the program crashed).
Any time your dealing with the dB that code should be encased in try catch brackets so you know where the error is and can handle it properly
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hello,
For remote connections you don't need to use the port number, the port number would only be used if you don't have sql browser (this is needed if you have don't have the default instance named) not running and you are connecting to the server through an IP address.
I think what the problem would be is that you have not setup your sql server for remote connections, by default it is local only.
This can be done easily by going to the server surface area configuration, select your server and click on remote and make sure that named pipes and tcp/ip is selected.
Another check you can make is by going to the server configuration manager and sql server network configuration | select the protocol for you server and make sure that named pipes and tcp/ip is enabled.
Hope this helps,
Steve
|
|
|
|
|
Hi Steve, you responded to the wrong person.
Reviewing the posts a little closer your right. But I rather doubt the OP will see your response.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hello,
For remote connections you don't need to use the port number, the port number would only be used if you don't have sql browser (this is needed if you have don't have the default instance named) not running and you are connecting to the server through an IP address.
I think what the problem would be is that you have not setup your sql server for remote connections, by default it is local only.
This can be done easily by going to the server surface area configuration, select your server and click on remote and make sure that named pipes and tcp/ip is selected.
Another check you can make is by going to the server configuration manager and sql server network configuration | select the protocol for you server and make sure that named pipes and tcp/ip is enabled.
Hope this helps,
Steve
|
|
|
|
|
In C#, the date in DateTime uses slashes ("/"). Sql uses -'s. How do I change the format in order to save dates (like DateTime.Now) in my sql database?
|
|
|
|
|
davidstern100 wrote: In C#, the date in DateTime uses slashes ("/").
It depends on your locale. A DateTime does not store dates with slashes. That is only how they are rendered in your locale.
davidstern100 wrote: How do I change the format in order to save dates (like DateTime.Now) in my sql database?
Dates are stored as SMALLDATETIME or DATETIME types, not in any specific format with dashes, slashes or whatever. It is the responsibility of the presentation layer to render the dates in a human readable form.
If you are attempting to inject a date into a SQL statement in order to make up something like this:
INSERT MyTable(SomeDate) VALUES ('2006-01-28')
then I suggest you don't. Use Parameterised queries instead.
If you tell us exactly why (in other words, to what higher purpose) you want to convert dates in this way we may be able to suggest a better solution.
|
|
|
|
|
Hi all,
I have a table named schedule which contains a col named sel_date which is a datetime.I want to display only those records which have month and year specified as parameters in a stored procedure. I want tis because i want to display records monthwise.
|
|
|
|
|
If I understand you correctly , DatePart [^] function is what your looking for:
<br />
SELECT *<br />
FROM schedule <br />
WHERE DATEPART(MONTH,sel_date) = @MonthParameter<br />
AND DATEPART(YEAR,sel_date) = @YearParameter<br />
|
|
|
|
|
Thankx a lot buddy:->!!! My problem is now solved.Thanks again
|
|
|
|
|
Hi.
I am running Windows XP Professional, and have just installed SQLServer 2000.i can set DSN in my system and access The Server.but I
need another computer to connect to the SQLServer in my system, whenever I try to connect from the remote pc via ODBC connection
it cannot connect to the database. Running netstat on my machine shows that the system is not listening to
1433/ms-sql-ms. I have checked in Network Config in SQLServer
Enterprise Manager, and TCP/IP is set to be using 1433.
so I'm pretty sure the issue is related to this 1433/ms-sql-s problem.
|
|
|
|
|
Hi,
I have installed SQL server 2005 trial.
In the connect to server dialog box of SQL server management studio,
there is no server name available in the "Server name" list.
And I cannot see any server in the browse for server window also.
I tried ping "pc_name" in SQL command prompt and was ok.
I tried using the pc_name to connect with all protocols in connect to window but nothing was working. "cannot connect to pc_name" is displayed always.
There is no service started in SQL server configuration manager's SQL server 2005 services. How to start SQL server service?
Any help would be greatly appreciated!!
Thanks & Regards,
Suman
|
|
|
|
|
Not totally sure what your issues are, but have you tried looking at the server configurations in the SQL Server Configuration Manager to verify that your server exists? This is where I would start.
Also, if you open up the sql server management studio and click cancel in connect you should have s database engine icon. If you right click on this you can create a new server. I would then go into VS2005 and connect to it. Then I would look in the properties window at the connection string.
Hope this helps.
-- modified at 15:33 Sunday 28th January, 2007
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|
|
Hello Aaron,
Thanks a lot for your help.
But I have not yet resolved the problem.
My SQL Server Configuration Manager window looks like:
SQL Server Configuration Manager(local)
|-SQL Server 2005 Services (No icons on the right pane)
|-SQL Server 2005 Network configuration (No icons on the right pane)
|-SQL Native client configuration
|-Client Protocols(Shared Memory, TCP/IP, Named Pipes & VIA icons on the Right pane)
|-Aliases(No icons on the right pane)
How to see whether the server exist or not?
Also when I select cancel in connect window of Management Studio,
I cannot see any icon in both panes. "No Server Connection. You are not connected to a server." is there because I did not able to connect.
I am trying to fix it.
Any help would be greatly appreciated.
Thanks & Regards,
Suman
|
|
|
|