Showing posts with label mssql. Show all posts
Showing posts with label mssql. Show all posts

Friday, March 30, 2012

How Do I Add Time with integer value in MSSQL ?

Hi, Expert

How Do I Add Time with integer value in MSSQL ??

For Example: 07:00:50 + 20 = 07:01:10

Note: 20 is in second

Thanks in advance

Check out the DATEADD function in BOL (documentation).|||

Hi,

You can play with DATEADD function for your question, for example:

SELECT dateadd(s, 20, getdate())

this one will add 20 seconds to now.

You can look up this function from Books Online to find more information. By the way, in SQL Server there is datatime data type, but not time or date only data type.

Monday, March 26, 2012

How create Excel linked server without Security Admin

I need to import excel data to mssql, i am creating linked server and then
selecting from it
Is there a why to create linked server without security admin role or some
other way to import data from excel spreadsheet to MsSQL 2000. It is not
very good security policy to have 10 users with Security administrator
server role :)
--
MusonDTS?
"Muson" <nu@.nu.nu> wrote in message
news:ufic8sc8GHA.788@.TK2MSFTNGP05.phx.gbl...
>I need to import excel data to mssql, i am creating linked server and then
>selecting from it
> Is there a why to create linked server without security admin role or some
> other way to import data from excel spreadsheet to MsSQL 2000. It is not
> very good security policy to have 10 users with Security administrator
> server role :)
> --
> Muson
>|||In SQL Server 2005, you can grant ALTER ANY LINKED SERVER permission, which allow to execute
sp_addlinkedserver. See below BOL URL:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/fed3adb0-4c15-4a1a-8acd-1b184aff558f.htm
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Muson" <nu@.nu.nu> wrote in message news:ufic8sc8GHA.788@.TK2MSFTNGP05.phx.gbl...
>I need to import excel data to mssql, i am creating linked server and then selecting from it
> Is there a why to create linked server without security admin role or some other way to import
> data from excel spreadsheet to MsSQL 2000. It is not very good security policy to have 10 users
> with Security administrator server role :)
> --
> Muson
>

How create Excel linked server without Security Admin

I need to import excel data to mssql, i am creating linked server and then
selecting from it
Is there a why to create linked server without security admin role or some
other way to import data from excel spreadsheet to MsSQL 2000. It is not
very good security policy to have 10 users with Security administrator
server role
MusonDTS?
"Muson" <nu@.nu.nu> wrote in message
news:ufic8sc8GHA.788@.TK2MSFTNGP05.phx.gbl...
>I need to import excel data to mssql, i am creating linked server and then
>selecting from it
> Is there a why to create linked server without security admin role or some
> other way to import data from excel spreadsheet to MsSQL 2000. It is not
> very good security policy to have 10 users with Security administrator
> server role
> --
> Muson
>|||In SQL Server 2005, you can grant ALTER ANY LINKED SERVER permission, which
allow to execute
sp_addlinkedserver. See below BOL URL:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/fed3adb0-4c15-4a1a-8acd-
1b184aff558f.htm
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Muson" <nu@.nu.nu> wrote in message news:ufic8sc8GHA.788@.TK2MSFTNGP05.phx.gbl...een">
>I need to import excel data to mssql, i am creating linked server and then
selecting from it
> Is there a why to create linked server without security admin role or some
other way to import
> data from excel spreadsheet to MsSQL 2000. It is not very good security po
licy to have 10 users
> with Security administrator server role
> --
> Muson
>

Friday, March 23, 2012

How create Excel linked server without Security Admin

I need to import excel data to mssql, i am creating linked server and then
selecting from it
Is there a why to create linked server without security admin role or some
other way to import data from excel spreadsheet to MsSQL 2000. It is not
very good security policy to have 10 users with Security administrator
server role
Muson
DTS?
"Muson" <nu@.nu.nu> wrote in message
news:ufic8sc8GHA.788@.TK2MSFTNGP05.phx.gbl...
>I need to import excel data to mssql, i am creating linked server and then
>selecting from it
> Is there a why to create linked server without security admin role or some
> other way to import data from excel spreadsheet to MsSQL 2000. It is not
> very good security policy to have 10 users with Security administrator
> server role
> --
> Muson
>
|||In SQL Server 2005, you can grant ALTER ANY LINKED SERVER permission, which allow to execute
sp_addlinkedserver. See below BOL URL:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/fed3adb0-4c15-4a1a-8acd-1b184aff558f.htm
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Muson" <nu@.nu.nu> wrote in message news:ufic8sc8GHA.788@.TK2MSFTNGP05.phx.gbl...
>I need to import excel data to mssql, i am creating linked server and then selecting from it
> Is there a why to create linked server without security admin role or some other way to import
> data from excel spreadsheet to MsSQL 2000. It is not very good security policy to have 10 users
> with Security administrator server role
> --
> Muson
>
sql

Friday, March 9, 2012

How can upload and connection my mssql database my site

I make a site in my computer it's work localhost I make mssql connection in localhost but ? don't know how i make mssql connection on website

This is a little hard to explain: But if mssql is installed on your development machine, then it makes sense that it would work, when you are testing in on localhost. That same database is most likely NOT installed on your web host. You didnt provide the details we would need to help you work through this issue but we may be able to walk you through getting it setup correctly...

Post your connection strings (minus any user names and passwords) and tell us if you are using a web host that includes an MSSQL or MSSQL-Express installation.

|||

? upload my mssql database from ftp my site i use that connection but don't work

data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\char.mdf;integrated security=true;user Instance=true"

|||

Thats a connection for an SQL Express Database, that exists inside your project, is uploaded and auto attached the first time the application is run.

I've never been able to get that to work on a webhost. It always seems to work just great in a development enviroment, but I dont think I've had a single time, across multiple hosting providers, that the attach method has worked without at the very least, some minor tweaking. Mostly thats because shared hosting enviroments get really funny about attaching databases.

I would contact your webhost. Make sure they have SQL Express 2005 running on the machine you are trying to run your site on. I would also ask them if there is a way that you can attach the file manually (through the Configuration Manager or the Management Studio Express 2005) and then we can modify your connection string to point to it.

Who is your web host?

|||

hi

i create my database on web host

and my connection string

New

SqlConnection("data source=server Catalog=database; User ID=username; Password=password; Integrated Security=True;")

but error

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

|||

This gets hard to troubleshoot at this point, because there are so many variables. Typically this is something you're going to be able to solve with the data source= section.

Good values if your application is running on the same server as the database will be

data source=localhost

data source=127.0.0.1

data source=(ip address of server)

But you may be in a shared hosting enviroment - which may have a shared database server, so you may need to specifiy an instance name as well. Have you contacted your hosting provider yet to try to resolve this issue?

Wednesday, March 7, 2012

How can import mdf file to mssql 2005

Dear All,

I have a mdf file and want to import the file to mssql 2005, But i can't find the function when i right click the database name in SQL Server Management Studio. What should i do?

Regards,

Ricky

You can choose to attach the mdf file as a new database. Right-click on the 'Databases' option on SSMS and click attach or use T-SQL (sp_attach_db).|||

hi

Gargi is very right,

I would like to Add,

the thing is you need to attached the .mdf file as well as its log file with that mdf file.

(this is the process of attaching, there is no direct process of importing a mdf file)

Regrds,

Thanks.

Gurpreet S. Gill

|||I just want to add once you attach a 2000 database in 2005 you can't go back just make sure you have a copy.

How can import mdf file to mssql 2005

Dear All,

I have a mdf file and want to import the file to mssql 2005, But i can't find the function when i right click the database name in SQL Server Management Studio. What should i do?

Regards,

Ricky

You can choose to attach the mdf file as a new database. Right-click on the 'Databases' option on SSMS and click attach or use T-SQL (sp_attach_db).|||

hi

Gargi is very right,

I would like to Add,

the thing is you need to attached the .mdf file as well as its log file with that mdf file.

(this is the process of attaching, there is no direct process of importing a mdf file)

Regrds,

Thanks.

Gurpreet S. Gill

|||I just want to add once you attach a 2000 database in 2005 you can't go back just make sure you have a copy.

how can i view customized error message?

hello
when error messages are added to my sql server, how can i view them?
i can not find them from the table (in master)
where does mssql 2000 store this information?
thank you
Hank,
Are you referring to master..sysmessages table?
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"hank" <anonymous@.discussions.microsoft.com> wrote in message
news:7DE6C377-84FF-411D-BCDD-A12848CA58C5@.microsoft.com...
> hello
> when error messages are added to my sql server, how can i view them?
> i can not find them from the table (in master)
> where does mssql 2000 store this information?
> thank you
|||thank you!!

how can i view customized error message?

hello
when error messages are added to my sql server, how can i view them?
i can not find them from the table (in master)
where does mssql 2000 store this information?
thank youHank,
Are you referring to master..sysmessages table?
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"hank" <anonymous@.discussions.microsoft.com> wrote in message
news:7DE6C377-84FF-411D-BCDD-A12848CA58C5@.microsoft.com...
> hello
> when error messages are added to my sql server, how can i view them?
> i can not find them from the table (in master)
> where does mssql 2000 store this information?
> thank you|||thank you!!

how can i view customized error message?

hell
when error messages are added to my sql server, how can i view them
i can not find them from the table (in master
where does mssql 2000 store this information
thank youHank,
Are you referring to master..sysmessages table?
--
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"hank" <anonymous@.discussions.microsoft.com> wrote in message
news:7DE6C377-84FF-411D-BCDD-A12848CA58C5@.microsoft.com...
> hello
> when error messages are added to my sql server, how can i view them?
> i can not find them from the table (in master)
> where does mssql 2000 store this information?
> thank you|||thank you!!

Friday, February 24, 2012

How can i use embbed sql(e.g. SQC) program to access MSSQL from linux or unix?

hello all!
Help!
I've a lot of programs written in sqlc to mssql on the windows platform.Now the boss wants to use linux server and I've to tune all my programs in sqlc to linux.But how to do it?Does anyone help me?Don't have any experience in linux, thought this link (http://www.linux.org/apps/AppId_8044.html) may give you required information.

HTH|||Thanks, but this link was on MySQL, not MSSQL. I also have some information on this through using freeTDS or DBI, but on embedded sql, I found nothing!:(|||Then may be you need to do other way round, how about this link? (http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=921&lngWId=8)