Newbee Q: What Is Sysname?

Feb 12, 2003

Hi.

I`m new to MS Sql and have been studying some tutorials and stuff.

What I can`t get a hold of is this sysname-thing. I see it is referenced to when i.e you create a new table...


Can anyone help me?

Freddy....

View 1 Replies


ADVERTISEMENT

Sysname

Jan 6, 2008

Hi ALL,
What does "sysname" type indicates. 
 
 
USE <database, sysname, AdventureWorks>
GO
IF OBJECT_ID('<schema_name, sysname, dbo>.<table_name, sysname, sample_table>', 'U') IS NOT NULL
DROP TABLE <schema_name, sysname, dbo>.<table_name, sysname, sample_table>
GOCREATE TABLE <schema_name, sysname, dbo>.<table_name, sysname, sample_table>
(<columns_in_primary_key, , c1> <column1_datatype, , int> <column1_nullability,, NOT NULL>,
<column2_name, sysname, c2> <column2_datatype, , char(10)> <column2_nullability,, NULL>, <column3_name, sysname, c3> <column3_datatype, , datetime> <column3_nullability,, NULL>,
CONSTRAINT <contraint_name, sysname, PK_sample_table> PRIMARY KEY (<columns_in_primary_key, , c1>)
)
GO

View 1 Replies View Related

What Is Sysname?

Oct 23, 2006

USE <database, sysname, AdventureWorks>

What is "sysname" object? I frequently see it among parameters for stored procedures.

Thanks.

View 16 Replies View Related

What Is It Mean That User_name Is A Sysname?

Apr 25, 2007

Hi,



In SQL Server 2005 Express BOL,

it says in 'Arguments' description part like this.



user_name

Specifies the name by which the user is identified inside this database. user_name is a sysname.
It can be up to 128 characters long.



What 'user_name is a sysname' imply?

View 2 Replies View Related

Newbee

Jul 20, 2005

Hi Alljust been given a project converting clipper app with Dbase filesinto Windows using "CA Visual Objects"Now my question: My objective is to keep the selling price of the appas low as possible but I need SQL database.MS SQL 2000 is 1st price I know but what els is available at minimalcost. ?Is MySql an option to look at ? and what pitfalls are there?Gunter

View 2 Replies View Related

Collation Conflict On Sysname?? Really?

Nov 9, 2006

Okely dokely, here it is.I have a database that has a differing collation to that of the tempdb. And obviously because of this I've run into problems when referencing table variables and temp tables. BUT! Given the following example, what am I doing wrong, or is there no solution to this. <Start Example>/*================================================= ================================================== ==========================fnPM_ForeignKey ================================================== ================================================== =========================*/IF exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[fnPM_ForeignKey]')) BEGINDROP FUNCTION [dbo].[fnPM_ForeignKey]ENDGOCREATE FUNCTION fnPM_ForeignKey (@ChildTable as sysname, @ChildColumn as sysname)RETURNS @ForeignKey TABLE (FKName sysname,ParentTable sysname,ParentColumn sysname,DescriptionColumn sysname COLLATE SQL_Latin1_General_CP1_CI_AS)ASBEGININSERT INTO @ForeignKey (FKName, ParentTable, ParentColumn)SELECT FK.Name, Parent.Name, ParentCol.NameFROM sysforeignkeysINNER JOIN sysobjects FK on sysforeignkeys.constid = FK.IDINNER JOIN sysobjects Parent on sysforeignkeys.rkeyid = Parent.idINNER JOIN syscolumns ParentCol on ParentCol.id = Parent.id and sysforeignkeys.rkey = ParentCol.colidINNER JOIN sysobjects Child on sysforeignkeys.fkeyid = Child.idINNER JOIN syscolumns ChildCol on ChildCol.id = Child.id and sysforeignkeys.fkey = ChildCol.colid WHERE Child.Name = @ChildTable and ChildCol.Name = @ChildColumn--> UPDATE @ForeignKey Set DescriptionColumn = syscolumns.Name COLLATE SQL_Latin1_General_CP1_CI_ASFROM @ForeignKey ForeignKeyINNER JOIN sysobjects on ForeignKey.ParentTable = sysobjects.NameINNER JOIN syscolumns on syscolumns.id = sysobjects.idWHERE syscolumns.Name like '%Name%'UPDATE @ForeignKey Set DescriptionColumn = syscolumns.NameFROM @ForeignKey ForeignKeyINNER JOIN sysobjects on ForeignKey.ParentTable = sysobjects.NameINNER JOIN syscolumns on syscolumns.id = sysobjects.idWHERE ForeignKey.DescriptionColumn is null and syscolumns.Name like '%Description%'RETURN ENDGO< end example >So here I'm defining my function which basically returns the parent table details of a given foreign key relationship. But when trying to run the above script I get this,Server: Msg 446, Level 16, State 9, Procedure fnPM_ForeignKey, Line 22Cannot resolve collation conflict for equal to operation.First up I find this weird because isn't sysname equvalent to nvarchar(128)? And aren't nvarchar fields independant of collation? But it gets better,I thought, ok maybe I'm wrong about sysname needing collation, so I figured I'll check the collation of the syscolumns.name column,Heres the queryselect sysobjects.Name, syscolumns.name, syscolumns.collationfrom sysobjects inner join syscolumns on sysobjects.id = syscolumns.idwhere sysobjects.name ='syscolumns' and syscolumns.name = 'name'This is what it returns,syscolumnsnameSQL_Latin1_General_CP1_CI_ASSo, let me get this straight, I've explicitly stated that the table variable column is collation SQL_Latin1_General_CP1_CI_ASand the column I'm comparing it to also has a collation of SQL_Latin1_General_CP1_CI_AS, and it doesn't work. . . .I smell Microsoft, or is there something equally as hideous going on here.RegardsAdam.

View 1 Replies View Related

Newbee...SSIS

Oct 1, 2006

Hi guys,

I am a newbee withh SSIS, I used DTS in SQL 2000 way back to migrate data from AS/400 DB2UDB iSeries to SQL 2000. It was easy to use DTS just specify Source and Destination and do some mapping and bingo. But now how do I do the same things with SSIS?

Is there some sort of tutorial out there? Any nice books? Any help is greatly appriciated.

T.I.A.

View 4 Replies View Related

Newbee To SQL. Need Help Accessing An Online Database

Jun 27, 2002

Hi. I have a database online. I have to run some scripts, and check out my database. The ISP i have, has currently changed the IP address for the database, now I can not hook up with it via Enterprise Manager. Can someone help me. I am using Microsoft ME as the platform.

View 1 Replies View Related

Several Newbee Questions About MSSQL Backups

Mar 12, 2008

hi all,

i have some questions about backing up mssql database, please, if you can help me with them.


1. what is main difference between Full Recovery and Bulk_Logged Recovery models? when to use one, and when to use the other?

2. why do i need marks in my backup? can you tell me in which case do i need marks? i don't understand, why wolud i ever wanted to recover database to some marked point? in which case i would like to recover only it's part and not full database?

3. if i do have backup of transaction log, it means nothing if i do not have backup of database structure? i need to have complete backup of transaction log to be able to recover all of the data?

4. i have database, and i did make no changes in database structure. in that case, only one backup of the system tables of the database is enough? there is no need to backup it all the time?

5. when i backup my transaction log file, do i backup only a differences between last backup of transaction log file and current, or i always backup complete transaction log file?

thank you in advance!

View 3 Replies View Related

Newbee Help Needed, I Need To Find Column Names If Any After 2 “check” Columns.

Sep 15, 2002

I need to find column names if any after 2 “check” columns.

Scenario: I have a database, with approx 400-1500 tables, depending on installation of software. The software is structured so that, when it synchronizes the SQL database it will create all the columns e.g. custacc, custname etc. and then it will always put in two check columns “CheckOne” and “CheckTwo” these two columns has to be the two last ones. In 99.9 this always works fine, but sometime if the users creates a new field in the software, when it synchronizes the new field “lands” behind the two checkfields, which is not good.

So what I am after is a script, which can run through all user tables, tell me if there are columns after the two checkfields and list those tables if any.

Any help would be greatly appreciated.
Cheers
Henrik.

View 3 Replies View Related







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