Is PDO for SQL Server support query contain Link Server ? I try using mssql_connect but it didn't work. I have try PDO but it alwas return error on query() method.
I have an application which intensively uses DB (SQL Server).
As it must have high performance I would like to know the fastest way to insert record into DB.Fastest from the standpoint of execution time.
What should I use ?
As I know the fastest way is to create stored procedure and to call it from code (ADO.NET).
Please let me know is there any better way or may be there are is some other practices to increase performance.
The following SQL query isn't working. I think the error is on the first line.
SELECT SUBSTRING(tbl_news.comment, 1, 250) as tbl_news.comment,
tbl_news.id, tbl_news.date, tbl_news.subject, tbl_users.username FROM tbl_news
INNER JOIN tbl_users ON tbl_news.creator = tbl_users.id
ORDER BY date DESC
is it possible to retrieve by using connection.getschema() the description item from a sql server table column, just like it's possible to retrieve the column name, data type, is nullable, column default value, etc?
Hi,
I have recently discovered the tablediff utility of SQL Server 2005.
I have 2 instances of the same database each on a different server.
Is it possible to compare all tables using tablediff without having to replicate the same command while only changing the table name?
For example, compare table1 on server1 with table1 on server2 then compare table2 on server1 with table2 on server2, until all tables have been compared.
I have been playing around with creation of pdf documents for a project that I'm working on. I would like to store the generated pdf document in a SQL database and then later be able to retrieve this pdf as well.
What are some suggestions for doing this? Can the document be stored in the database without physically creating the document on the server?
I'm doing a little digging and looking for a explanation on how SQL server evaluates MIN(Varchar).
I found this remark in BOL: MIN finds the lowest value in the collating sequence defined in the underlying database
So if I have a table that has one row with the following values:
Data
AA
AB
AC
Doing a SELECT MIN(DATA) would return back AA. I just want to understand the why behind this and understand the BOL a little better.
Thanks!
Situation:
Running a report on SQL Server Reporting Services
When I do a Preview of the Report all my charts look fine. No problems.
When I run a subscription for the report, the chart look different. Like completely different legends are gone etc.
Any ideas what the cause would be?
BTW the charts are Dundas Charts.
I want to batch insert multiple records in sql server database using ADO.NET command/sqldataadapter and get identity value generated for all the rows in a single database trip.
What are my options?
I have a SQL Server 2008 database with 300 tables. The application I have to design is an Windows Forms app, .NET 3.5, C#.
Which is the best way to work with LINQ2SQL ?
I intend to make a datacontext for each business entity.
Is there any problem ?
I need to know if this way of working with LINQ has any disadvantage or can create performance issues ?
Thanks.
My database has to store all the available departments in my company.
Some departments are sub-departments on another existing department. I've decided to solve this like this:
Departments
ID Description HeadOfDepartment ParentDepartment
ParentDepartment can be null, indicating it is a root department. If it has a parent I'll act accordingly, my question is how can I code this in Microsoft SQL?
Is there a tool around that would produce a diagram showing existing tables and their relationships given a connection to a database or by any other means?
This is for SQL Server 2008 Express Edition.
Im using Native SQL from ABAP language. The query to get data is something like this
SELECT COUNT(ROWID)
FROM <SCHEMANAME>.<TABLENAME>;@<DATABASENAME>
INTO :localvariable
I want to somehow set the schemaname and database name as default so that i do not need to use them in the SELECTs later. Then i can only use the table name in the SELECT.
thanks !!
Hi all,
I have an sql query here and it returns a number of results. I'd like to show these results in groups.
What I mean is,
show the first 20 results in some part of the page,
show the next 20 results in another part of the page
etc...
How can I do that?
Hi, im trying to connect to a remote sql express server using win. authentication.
I´m logued with a user with username Administrator, but when loggin, i got the next error:
Login failed for user guest ...
Why is not using the Administrator account?
Thanks in advance.
Hi,
Is there any place where I can find all possible object dependencies in Sql Server?
What I mean by "object dependency" is a list of object that one object can depend on. For example, TABLE can depend on SCHEMA, TYPE, TABLE, FUNCTION, etc.
For Data Explorer I would like to add support for a Batch separator.
So for example if users type in:
select 'GO' go select 1 as go
Go
select 100
I would like to return the three result sets.
Its clear that I need some sort of parser here, my hope is that this is a solved problem and I can just plug it in. (writing a full T-SQL parser is not something I would like to do)
What component / demo code could achieve splitting this batch into its 3 parts?
In my code I am using java.sql.PreparedStatement.
I then execute the setString() method to populate the wildcards of the prepared statement.
Is there a way for me to retrieve (and print out) the final query before the executeQuery() method is called and the query is executed? I Just want this for debugging purposes.
Thanks.
Hi,
I'm trying to do some work with my SQL table.
I have 2 buildings with room numbers 1 - 100 in building 1 and 101 - 199 in building 2.
I have a location field (which I've just created) and want to run a query to populate it with either 'Building 1' or 'Building 2' depending on which room number it has in the 'Room' field.
Many thanks for your help.
Regards
Scott
I've stuck with syncing a Sql server 2008 having changes tracking enabled with a 2005 one that doesn't have this mechanism.
Would you please point me a right track, how can I handle this.
Thank you,
So i need to figure out how i can get a record count value and use that count as a new value to insert into a table.
Ex: In My Stored Procedure
@Count int
What im looking for
@Count to equal "select top (1) _fieldName from _someTable order by _fieldName Desc"
Finally
insert into _newTable (_fieldName) values (@Count)
End
I dont have to use a variable, just trying to demonstrate what im really trying to do. My SQL knowledge is pretty limited so no laughing, or smirking! ;)
Hi. I'm new to SQL Server Compact edition. I'm using Compact edition 3.5. I tried renaming the table. But, I couldn't do that through the following query.
alter table tablename to newname
Plz, someone help me.........
Hi
I currently loook after 20 odd databases in SQL server 2005 and need a tool for monitoring the performance and keep me informed if a database is running slow. Is there anything I can run within Managment studio of any other good third party tool (Pref free) that can do the job.
Thanks
I am looking for a publicly available SQL database with free access, where one can run some SELECT queries for free on some meaningful data (not item1, item2, item3). Have you seen any? Even better if it came together with some tutorial.
Vendor is not that relevant, as long as one can connect using a generic JDBC client.